-
Notifications
You must be signed in to change notification settings - Fork 446
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
Exclude certain packages from autocomplete/autoimport #1059
Conversation
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.
I would add com.sun.*
Signed-off-by: Snjezana Peco <[email protected]>
@fbricon I have updated the PR. |
"type": "array", | ||
"description": "Defines the type filters. All types whose fully qualified name matches the selected filter strings will be ignored in content assist or quick fix proposals and when organizing imports. For example 'java.awt.*' will hide all types from the awt packages.", | ||
"default": [ | ||
"java.awt.*", |
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.
what is the default list added by eclipse jdt ?
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.
empty list
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.
I don't think that is true - maybe in Eclipse JDT raw, but when you run default Eclipse IDE download I believe they preconfigure the list, right ?
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.
I have checked Eclipse I20190830-0550 (eclipse 4.13) and Eclipse 2019-06 (4.12)
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.
ack - you are right. Just something I probably just added as a reflex in the past ;)
@@ -263,6 +263,15 @@ | |||
], | |||
"scope": "window" | |||
}, | |||
"java.completion.filteredTypes": { |
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.
it would be great if this list of import type filters would be possible to read from the project in a way we avoid to duplicate the list of filters between vscode, eclipse, che and more ide's. Could we add a file it would read ? like a .javafiltertypes
all three IDE's would honor ? Maybe there exist something already for other IDE we could reuse?
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.
VS Code and che already use <project_home>/.vscode/settings.json ( Workspace settings).
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.
yes, but that is not present in other IDE's - does intellij have a mechanism we could reuse or ?
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.
right now will start with the low hanging fruit of exposing the list of filtered types directly in the server settings.
These settings are global for JDT - will they behave globally for jdt.ls too ? What we really want in the end is the ability to have global filters (like java.awt.) but then per project say - in this project I don't care for (x.y.z.Resource imports/content assist) Is that somehow doable ? basically dynamically set the type filters dependent on in which project the "operation" occurs ? |
The org.eclipse.jdt.ui.typefilter.enabled property can't be set at the project level in Eclipse. See org.eclipse.jdt.core.manipulation.TypeNameMatchCollector.getPreference(String) |
no, but could we "cheat" by setting it before doing import/content assist action and afterwards roll it back ? :) cheeky but might work. |
See #1059 (comment) |
Fixes #710
Requires eclipse-jdtls/eclipse.jdt.ls#1176
Signed-off-by: Snjezana Peco [email protected]