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

Open projects that correspond to workspace folders. Prevents "do you want to open project ?" questions. #5286

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

sdedic
Copy link
Member

@sdedic sdedic commented Jan 12, 2023

If the LSP client added a folder to a workspace, then opened a file, NBLS would ask a question "File XXX is part of project Foo, do you want to open ... ?". Since the containing folder was explicitly adeded the lsp client's user, this question is ... silly.

It was caused by NBLS did not receive/process didChangeWorkspaceFolders notification from the LSP client. On the startup, workspace folders were 'registered' as known and NBLS does not ask "project open question" for files beneath those folders - but when the folders change during NBLS run, the added folders were not 'registered' in the same way.

@sdedic sdedic added kind:bug Bug report or fix LSP [ci] enable Language Server Protocol tests VSCode Extension [ci] enable VSCode Extension tests labels Jan 12, 2023
@sdedic sdedic added this to the NB17 milestone Jan 12, 2023
@sdedic sdedic self-assigned this Jan 12, 2023
@MartinBalin
Copy link
Contributor

Please add also to VSNetBeans_1603 branch

return;
}
ProjectInformation pi = ProjectUtils.getInformation(projects[0]);
String n = pi.getDisplayName();
Copy link
Contributor

Choose a reason for hiding this comment

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

lines 1207 - 1213 look like they should belong to ProjectInformation class

Copy link
Member Author

Choose a reason for hiding this comment

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

lines 1207 - 1213 look like they should belong to ProjectInformation class

Rather to ProjectUtils; but yes, some "give-me-suitable-project-name-with-all-fallbacks' could be useful, I did this chain of null checks several times already. I'll address in a separate PR.

Copy link
Contributor

@dbalek dbalek left a comment

Choose a reason for hiding this comment

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

Looks fine.

@sdedic sdedic merged commit cac7e65 into apache:master Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix LSP [ci] enable Language Server Protocol tests VSCode Extension [ci] enable VSCode Extension tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants