GH-1409: do not compute completion proposals when cursor is on attribute name instead of value
This commit is contained in:
@@ -77,6 +77,7 @@ public class AnnotationAttributeCompletionProcessor implements CompletionProvide
|
||||
}
|
||||
// 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);
|
||||
|
||||
@@ -169,6 +169,11 @@ public class DependsOnCompletionProviderTest {
|
||||
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<*>\")");
|
||||
|
||||
Reference in New Issue
Block a user