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

Include folders to import #1084

Closed
maxandersen opened this issue Oct 2, 2019 · 5 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#1200
Closed

Include folders to import #1084

maxandersen opened this issue Oct 2, 2019 · 5 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#1200
Assignees

Comments

@maxandersen
Copy link
Contributor

importing quarkus repo I end up with an almost impossible vscode which keeps waiting on maven to refresh on every java related action.

Was suggested to use java.import.exclusions to tell which projects to not import.

That’s rather tedious and I was realizing if I could just do java.import.exclusions=** and then `java.import.inclusions=integration-tests/maven/,devtools/' then I would be good.

As opposed to listing ~300 individual lines in exclusion.

Pretty please :)

@fbricon
Copy link
Collaborator

fbricon commented Oct 2, 2019

@maxandersen as usual with that kind of thing, there's always the problem of who takes precedence.
In your exemple java.import.inclusions takes precedence over java.import.exclusions, to a point where it would not even be necessary to define java.import.exclusions=**
But then, what if someone needed to include=foo/**, but exclude=foo/bar/** ?

@maxandersen
Copy link
Contributor Author

Alternatively adopt the convention/format of things like .gitignore/.dockerignore where a "!" negates the pattern. see https://git-scm.com/docs/gitignore#_pattern_format

Then it would be:
java.import.exclusions=foo/bar/**,!foo/**

@snjeza snjeza changed the title add java.import.inclusions Allow including folders Oct 7, 2019
@snjeza snjeza changed the title Allow including folders Include folders to import Oct 7, 2019
@fbricon fbricon added this to the Mid October 2019 milestone Oct 16, 2019
@fbricon
Copy link
Collaborator

fbricon commented Oct 16, 2019

"java.import.exclusions": [
        "**/node_modules/**",
        "**/.metadata/**",
        "**/archetype-resources/**",
        "**/META-INF/maven/**",
        "**/quarkus/**",
        "!**/quarkus",
        "!**/quarkus/build-parent",
        "!**/quarkus/bom",
        "!**/quarkus/bom/*",
        "!**/integration-tests",
        "!**/integration-tests/maven",
        "!**/devtools/*",
        "**/devtools/gradle"
    ]

You have to include a parent directory. The order is important.

@hannah23280
Copy link

"java.import.exclusions": [
        "**/node_modules/**",
        "**/.metadata/**",
        "**/archetype-resources/**",
        "**/META-INF/maven/**",
        "**/quarkus/**",
        "!**/quarkus",
        "!**/quarkus/build-parent",
        "!**/quarkus/bom",
        "!**/quarkus/bom/*",
        "!**/integration-tests",
        "!**/integration-tests/maven",
        "!**/devtools/*",
        "**/devtools/gradle"
    ]

You have to include a parent directory. The order is important.

what does it mean by "include a parent directory"? How does the ordering works? Wonder if there is any guide that explains this in details.

@snjeza
Copy link
Contributor

snjeza commented Nov 14, 2020

what does it mean by "include a parent directory"? How does the ordering works? Wonder if there is any guide that explains this in details.

if you want to include only the **/quarkus/bom/*, you have to set the following:

"java.import.exclusions": [
...
        "**/quarkus/**", // exclude **/quarkus/**
        "!**/quarkus", // include **/quarkus - parent
        "!**/quarkus/bom", // include **/quarkus/bom - parent
        "!**/quarkus/bom/*", //  // include **/quarkus/bom/*
...
    ]

! means include instead of exclude.

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

Successfully merging a pull request may close this issue.

4 participants