From c99c1f37ee889fd292da6d4f3789ef12cacb3fd9 Mon Sep 17 00:00:00 2001 From: Steven Looman Date: Sun, 10 Sep 2023 16:42:38 +0200 Subject: [PATCH] Fix error --- .../magik/languageserver/definitions/DefinitionsProvider.java | 3 ++- .../sw/magik/languageserver/rename/RenameProviderTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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 a4bbd6b6..21b1aec6 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 @@ -129,7 +129,8 @@ private List definitionsForAtom(final MagikTypedFile magikFile, final } private List definitionsForMethodInvocation(final MagikTypedFile magikFile, final AstNode wantedNode) { - final MethodInvocationNodeHelper helper = new MethodInvocationNodeHelper(wantedNode); + final AstNode methodInvocationNode = wantedNode.getFirstAncestor(MagikGrammar.METHOD_INVOCATION); + final MethodInvocationNodeHelper helper = new MethodInvocationNodeHelper(methodInvocationNode); final String methodName = helper.getMethodName(); final AstNode previousSiblingNode = wantedNode.getPreviousSibling(); diff --git a/magik-language-server/src/test/java/nl/ramsolutions/sw/magik/languageserver/rename/RenameProviderTest.java b/magik-language-server/src/test/java/nl/ramsolutions/sw/magik/languageserver/rename/RenameProviderTest.java index 6a58f8aa..abc35c61 100644 --- a/magik-language-server/src/test/java/nl/ramsolutions/sw/magik/languageserver/rename/RenameProviderTest.java +++ b/magik-language-server/src/test/java/nl/ramsolutions/sw/magik/languageserver/rename/RenameProviderTest.java @@ -24,7 +24,7 @@ class RenameProviderTest { private Either3 getPrepareRename( - String code, final Position position) { + final String code, final Position position) { final URI uri = URI.create("tests://unittest"); final ITypeKeeper typeKeeper = new TypeKeeper(); final MagikTypedFile magikFile = new MagikTypedFile(uri, code, typeKeeper);