Skip to content

Commit

Permalink
Fix classname and packagename not showing in snippets. Add null check…
Browse files Browse the repository at this point in the history
… for cursorContext
  • Loading branch information
evie-lau committed May 31, 2023
1 parent 232c75a commit 109d65e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ public CompletableFuture<Either<List<CompletionItem>, CompletionList>> completio
return getCursorContext.thenCombineAsync(getSnippetContexts, (cursorContext, list) -> {
// Given the snippet contexts that are on the project's classpath, return the
// corresponding list of CompletionItems
var kind = cursorContext.getKind();
list.add(kind.name());
if (cursorContext == null) {
LOGGER.severe("No Java cursor context provided, using default values to compute snippets.");
cursorContext = new JavaCursorContextResult(JavaCursorContextKind.BEFORE_CLASS, ""); // error recovery
}
return Either.forLeft(
snippetRegistry.getCompletionItem(replaceRange, "\n", true, list, cursorContext, prefix.toString()));
});
Expand Down

0 comments on commit 109d65e

Please sign in to comment.