Skip to content

Commit

Permalink
Fix attribute quick assist
Browse files Browse the repository at this point in the history
  • Loading branch information
zulus committed Oct 15, 2023
1 parent 5b7c8aa commit 0f4b2d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,16 @@ private static int internalGetPossibleElementKinds(ASTNode node) {
}

ASTNode parent = node.getParent();
if (parent.getType() == ASTNode.NAMESPACE_NAME) {
parent = parent.getParent();
}

switch (parent.getType()) {
case ASTNode.CLASS_DECLARATION:
case ASTNode.INTERFACE_DECLARATION:
kind = SimilarElementsRequestor.CLASSES | SimilarElementsRequestor.INTERFACES;
break;

case ASTNode.METHOD_DECLARATION:
kind = SimilarElementsRequestor.ALL_TYPES;
break;
Expand All @@ -243,6 +247,9 @@ private static int internalGetPossibleElementKinds(ASTNode node) {
case ASTNode.FUNCTION_NAME:
kind = SimilarElementsRequestor.FUNCTIONS;
break;
case ASTNode.ATTRIBUTE:
kind = SimilarElementsRequestor.CLASSES | SimilarElementsRequestor.INTERFACES;
break;
default:
}
return kind;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static SimilarElement[] findSimilarElement(ISourceModule cu, Identifier n
requestor.setIgnored(CompletionProposal.LABEL_REF, true);
requestor.setIgnored(CompletionProposal.PACKAGE_REF, true);
requestor.setIgnored(CompletionProposal.VARIABLE_DECLARATION, true);
requestor.setIgnored(CompletionProposal.METHOD_REF, true);
// requestor.setIgnored(CompletionProposal.METHOD_REF, true);
requestor.setIgnored(CompletionProposal.FIELD_REF, true);
requestor.setIgnored(CompletionProposal.LOCAL_VARIABLE_REF, true);
requestor.setIgnored(CompletionProposal.VARIABLE_DECLARATION, true);
Expand Down

0 comments on commit 0f4b2d5

Please sign in to comment.