Skip to content

Commit 6bdfa97

Browse files
committed
Debug missing parse tree/contributions.
1 parent ab1a6b0 commit 6bdfa97

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/parametric/ParametricTextDocumentService.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ private void handleParsingErrors(TextDocumentState file, CompletableFuture<Versi
421421
.map(diagnostic -> diagnostic.instantiate(columns))
422422
.collect(Collectors.toList());
423423

424-
logger.trace("Finished parsing tree, reporting new parse errors: {} for: {}", parseErrors, file.getLocation());
424+
logger.info("Finished parsing tree, reporting new parse errors: {} for: {}", parseErrors, file.getLocation());
425425
facts(file.getLocation()).reportParseErrors(file.getLocation(), diagnostics.version(), parseErrors);
426426
});
427427
}
@@ -694,7 +694,10 @@ private ILanguageContributions contributions(ISourceLocation doc) {
694694
.map(contributions::get)
695695
.map(ILanguageContributions.class::cast)
696696
.flatMap(Optional::ofNullable)
697-
.orElseGet(() -> new NoContributions(extension(doc), exec));
697+
.orElseGet(() -> {
698+
logger.error("No contributions for {}", doc);
699+
return new NoContributions(extension(doc), exec);
700+
});
698701
}
699702

700703
private static String extension(ISourceLocation doc) {
@@ -1042,7 +1045,7 @@ public Set<String> fileExtensions() {
10421045

10431046
private void updateFileState(LanguageParameter lang, ISourceLocation f) {
10441047
f = f.top();
1045-
logger.trace("File of language {} - updating state: {}", lang.getName(), f);
1048+
logger.info("File of language {} - updating state: {}", lang.getName(), f);
10461049
// Since we cannot know what happened to this file before we were called, we need to be careful about races.
10471050
// It might have been closed in the meantime, so we compute the new value if the key still exists, based on the current value.
10481051
var state = files.computeIfPresent(f, (loc, currentState) -> currentState.changeParser(contributions(loc)::parsing));

0 commit comments

Comments
 (0)