make language of parser task more important than the lang property

This commit is contained in:
Clément Fournier
2022-07-23 00:08:15 +02:00
parent 2ec6b6c648
commit 019169d69d
13 changed files with 70 additions and 97 deletions

View File

@@ -24,18 +24,18 @@ public class HtmlTokenizer implements Tokenizer {
@Override
public void tokenize(SourceCode sourceCode, Tokens tokenEntries) {
HtmlLanguageModule html = HtmlLanguageModule.getInstance();
TextFile tf = TextFile.forCharSeq(
sourceCode.getCodeBuffer(),
sourceCode.getFileName(),
html.getDefaultVersion()
);
try (LanguageProcessor processor = html.createProcessor(html.newPropertyBundle());
TextFile tf = TextFile.forCharSeq(
sourceCode.getCodeBuffer(),
sourceCode.getFileName(),
html.getDefaultVersion()
);
TextDocument textDoc = TextDocument.create(tf)) {
ParserTask task = new ParserTask(
textDoc,
SemanticErrorReporter.noop(), // fixme
SemanticErrorReporter.noop(),
LanguageProcessorRegistry.singleton(processor)
);