Fix NPE in inlay hints
This commit is contained in:
@@ -16,9 +16,10 @@ import org.eclipse.lsp4j.InlayHint;
|
||||
import org.eclipse.lsp4j.Range;
|
||||
import org.eclipse.lsp4j.jsonrpc.CancelChecker;
|
||||
import org.springframework.ide.vscode.commons.util.text.TextDocument;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
||||
public interface InlayHintHandler {
|
||||
|
||||
List<InlayHint> handle(TextDocument doc, Range range, CancelChecker cancelChecker);
|
||||
@NonNull List<InlayHint> handle(TextDocument doc, Range range, CancelChecker cancelChecker);
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class JdtInlayHintsHandler implements InlayHintHandler {
|
||||
|
||||
private List<InlayHint> computeInlayHints(List<JdtInlayHintsProvider> applicableInlayHintsProviders, IJavaProject jp, CompilationUnit cu, Range r, TextDocument doc) {
|
||||
if (cu == null) {
|
||||
return null;
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Collector<InlayHint> collector = new Collector<>();
|
||||
CompositeASTVisitor visitor = new CompositeASTVisitor();
|
||||
|
||||
Reference in New Issue
Block a user