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

[NETBEANS-5319] Always do save modified files when used through LSP. #2730

Merged
merged 1 commit into from
Feb 11, 2021

Conversation

entlicher
Copy link
Contributor

As described in NETBEANS-5319, when new files are added through LSP (e.g. in a VSCode extension), breakpoints do not work in these files at all.
If a file is modified, then breakpoints are submitted to wrong locations depending on the scope of the modification.

The reason is that NetBeans LSP backend is holding modified documents and VSCode updates files on disk at the same time. But breakpoints are resolved to disk locations that correspond to the sate before the files were modified. Until the files are saved through the NetBeans, breakpoints will resolve to wrong locations.

This fix allows to save modifications it got through the LSP protocol, which synchronizes the content and allows breakpoints to resolve as expected.

@entlicher entlicher added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) LSP [ci] enable Language Server Protocol tests labels Feb 4, 2021
@entlicher entlicher added this to the 12.3 milestone Feb 4, 2021
@entlicher
Copy link
Contributor Author

A very small change and in the LSP code only.

@neilcsmith-net neilcsmith-net changed the title Always do save modified files when used through LSP. [NETBEANS-5319] Always do save modified files when used through LSP. Feb 4, 2021
Copy link

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

Perfect, the VSCode & its editor shall be in charge managing the state of the workspace.

@geertjanw geertjanw merged commit 76317c1 into apache:delivery Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) LSP [ci] enable Language Server Protocol tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants