From 5a29298fe0f64628741a7e459e870ce08700c186 Mon Sep 17 00:00:00 2001 From: Steven Looman Date: Mon, 11 Sep 2023 17:30:05 +0200 Subject: [PATCH] Linting --- .../sw/magik/languageserver/definitions/DefinitionsProvider.java | 1 + .../sw/magik/languageserver/references/ReferencesProvider.java | 1 + 2 files changed, 2 insertions(+) diff --git a/magik-language-server/src/main/java/nl/ramsolutions/sw/magik/languageserver/definitions/DefinitionsProvider.java b/magik-language-server/src/main/java/nl/ramsolutions/sw/magik/languageserver/definitions/DefinitionsProvider.java index 21b1aec6..5230f95d 100644 --- a/magik-language-server/src/main/java/nl/ramsolutions/sw/magik/languageserver/definitions/DefinitionsProvider.java +++ b/magik-language-server/src/main/java/nl/ramsolutions/sw/magik/languageserver/definitions/DefinitionsProvider.java @@ -96,6 +96,7 @@ private List definitionsForCondition(final MagikTypedFile magikFile, f private List definitionsForAtom(final MagikTypedFile magikFile, final AstNode wantedNode) { final Scope scope = magikFile.getGlobalScope().getScopeForNode(wantedNode); + Objects.requireNonNull(scope); final String identifier = wantedNode.getTokenValue(); final ScopeEntry scopeEntry = scope.getScopeEntry(identifier); if (scopeEntry == null) { diff --git a/magik-language-server/src/main/java/nl/ramsolutions/sw/magik/languageserver/references/ReferencesProvider.java b/magik-language-server/src/main/java/nl/ramsolutions/sw/magik/languageserver/references/ReferencesProvider.java index 94a9254e..e653a2cc 100644 --- a/magik-language-server/src/main/java/nl/ramsolutions/sw/magik/languageserver/references/ReferencesProvider.java +++ b/magik-language-server/src/main/java/nl/ramsolutions/sw/magik/languageserver/references/ReferencesProvider.java @@ -95,6 +95,7 @@ public List provideReferences(final MagikTypedFile magikFile, final Po } else if (wantedNode.is(MagikGrammar.ATOM) && wantedNode.getFirstChild().is(MagikGrammar.IDENTIFIER)) { final Scope scope = magikFile.getGlobalScope().getScopeForNode(wantedNode); + Objects.requireNonNull(scope); final String identifier = currentNode.getTokenValue(); final ScopeEntry scopeEntry = scope.getScopeEntry(identifier); if (scopeEntry == null) {