Skip to content

Infer the source root only when necessary #2178

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

Merged
merged 1 commit into from
Aug 4, 2022

Conversation

jdneo
Copy link
Contributor

@jdneo jdneo commented Jul 28, 2022

  • only infer the source root when the opened Java source file belongs
    to an unmanaged folder.

Signed-off-by: Sheng Chen [email protected]

- only infer the source root when the opened Java source file belongs
  to an unmanaged folder.

Signed-off-by: Sheng Chen <[email protected]>
@jdneo
Copy link
Contributor Author

jdneo commented Jul 28, 2022

This PR temporarily avoids conflicts between different kind of invisible projects (e.g. unmanaged folder & JBang script)

Once the unmanaged folder has its own nature id, we can do a more accurate check.

@rgrunber
Copy link
Contributor

rgrunber commented Aug 2, 2022

Made a comment at redhat-developer/vscode-java#2552 (comment) since this patch doesn't fix the issue there. It seemed to me like the problem wasn't with JDT-LS so just want to verify that this change is necessary.

@jdneo
Copy link
Contributor Author

jdneo commented Aug 3, 2022

Hi @rgrunber,

This PR is not aimed to fix redhat-developer/vscode-java#2552.

Since now we will increasingly infer the source root of the unmanaged folder when user opens a new java file. This PR is to skip the inference when the java file already belongs to other invisible kind projects (e.g. a JBang project).

Copy link
Contributor

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

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

The change makes sense then.

It's certainly true that our unmanaged (invisble) project has a single nature, which is org.eclipse.jdt.core.javanature .

Other unmanaged project types (eg. jbang) should define their own for in addition, or in place of that.

@jdneo jdneo merged commit dd610bd into eclipse-jdtls:master Aug 4, 2022
@jdneo jdneo deleted the cs/check-is-invisible branch August 4, 2022 01:52
@jdneo
Copy link
Contributor Author

jdneo commented Aug 4, 2022

And once #2182 is ready, we can make more accurate checks. I'll play around that change to see if it will break anything.

@jdneo jdneo added the bug label Aug 4, 2022
@jdneo jdneo added this to the End August 2022 milestone Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants