Skip to content

Commit

Permalink
Merge pull request #459 from evie-lau/classSnippetFix
Browse files Browse the repository at this point in the history
Fix classname and packagename not showing in snippets.
  • Loading branch information
turkeylurkey authored May 31, 2023
2 parents 232c75a + 109d65e commit 5e9163e
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 5e9163e

Please sign in to comment.