-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept types if they are imported when completion #2467
Conversation
- if types already exist in import declarations, then the completion handler will accept them even if they've been configured in the types filter. Signed-off-by: Sheng Chen <sheche@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just one small thing that could probably be improved.
....ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/CompletionProposalRequestor.java
Outdated
Show resolved
Hide resolved
Signed-off-by: sheche <sheche@microsoft.com>
Current implementation is good for single file. I'm thinking of a different approach to improve it in future. Since the culprit is the typefilter blacklist, we can use existing import declarations of current file to remove the unexpected filter from the blacklist dynamically. This blacklist is a singleton in language server, so it ensures the refreshed blacklist also applies to other files in current project. I also found unexpected type filters in some other use cases:
I'm OK to merge current PR first, and find time to improve other use cases in future PR. |
@testforstephen Thank you for the input. The suggestions make sense to me. I can take some further look in next iteration. |
If types already exist in import declarations, then the completion handler will accept them even if they've been configured in the types filter.
This change should improve the experience for users who develop AWT applications, since the whole AWT package is set in the types filter by default now.
For example, if the compilation unit contains any of the below import declarations, the
java.awt.List
will appear in the completion list:java.awt.List
)fix redhat-developer/vscode-java#1147
fix redhat-developer/vscode-java#1966
Signed-off-by: Sheng Chen sheche@microsoft.com