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

Root path in the preference manager won't update when workspace folder changes #1388

Closed
jdneo opened this issue Mar 17, 2020 · 1 comment · Fixed by #1389
Closed

Root path in the preference manager won't update when workspace folder changes #1388

jdneo opened this issue Mar 17, 2020 · 1 comment · Fixed by #1389
Labels

Comments

@jdneo
Copy link
Contributor

jdneo commented Mar 17, 2020

The updateWorkspaceFolders in https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/ProjectsManager.java#L160

will not update the rootPaths in preferenceManager, which will cause some unexpected behavior when using rootPaths. for example, here:
https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/DocumentLifeCycleHandler.java#L309

Suppose we opened a multi-root workspace in VS Code. Then we added a new folder into the workspace, and the added folder contains an invisible project.

Because there is no trigger files information, the Invisible project importer won't work, and if we open its java source file, the Language server will open it as a default project file.

But if we correct the rootPaths field, the InvisibleProjectImporter will be triggered to import it.

@jdneo
Copy link
Contributor Author

jdneo commented Mar 17, 2020

I can raise a PR to fix this.

fbricon pushed a commit that referenced this issue Mar 20, 2020
fixes #1388

Signed-off-by: Sheng Chen <sheche@microsoft.com>
@fbricon fbricon added the bug label Mar 20, 2020
@fbricon fbricon added this to the End March 2020 milestone Mar 20, 2020
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 a pull request may close this issue.

2 participants