Skip to content
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

Merged
merged 1 commit into from
Sep 16, 2019

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Sep 14, 2019

Fixes #710
Requires eclipse-jdtls/eclipse.jdt.ls#1176

Signed-off-by: Snjezana Peco [email protected]

Copy link
Collaborator

@fbricon fbricon left a 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.*

@snjeza
Copy link
Contributor Author

snjeza commented Sep 14, 2019

@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.*",
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty list

Copy link
Contributor

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 ?

Copy link
Contributor Author

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)

Copy link
Contributor

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": {
Copy link
Contributor

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?

Copy link
Contributor Author

@snjeza snjeza Sep 14, 2019

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).

Copy link
Contributor

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 ?

Copy link
Collaborator

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.

@maxandersen
Copy link
Contributor

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 ?

@snjeza
Copy link
Contributor Author

snjeza commented Sep 16, 2019

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)

@fbricon fbricon merged commit aaef6e8 into redhat-developer:master Sep 16, 2019
@maxandersen
Copy link
Contributor

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.

@snjeza
Copy link
Contributor Author

snjeza commented Sep 16, 2019

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude certain packages from autocomplete/autoimport
3 participants