Skip to content

Commit

Permalink
GH-1409: do not compute completion proposals when cursor is on attrib…
Browse files Browse the repository at this point in the history
…ute name instead of value
  • Loading branch information
martinlippert committed Nov 15, 2024
1 parent d43f16a commit 0b90be1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ else if (node instanceof Name && node.getParent() instanceof Annotation
}
// case: @Qualifier(value=<*>)
else if (node instanceof Name && node.getParent() instanceof MemberValuePair
&& ((MemberValuePair)node.getParent()).getName() != node
&& completionProviders.containsKey(((MemberValuePair)node.getParent()).getName().toString())) {
String attributeName = ((MemberValuePair)node.getParent()).getName().toString();
computeProposalsForSimpleName(project, node, attributeName, completions, offset, doc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ public void testDependsOnCompletionOutsideOfAnnotation2() throws Exception {
assertCompletions("@DependsOn<*>(\"XXX\")", 0, null);
}

@Test
public void testDependsOnCompletionInsideOfAttributeName() throws Exception {
assertCompletions("@DependsOn(<*>value=\"bean1\")", 0, null);
}

@Test
public void testDependsOnCompletionInsideOfQuotesWithPrefixAndReplacedPostfix() throws Exception {
assertCompletions("@DependsOn(\"be<*>xxx\")", 2, "@DependsOn(\"bean1<*>\")");
Expand Down

0 comments on commit 0b90be1

Please sign in to comment.