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

PublishDiagnostics Notification and File Deletions #463

Closed
cdietrich opened this issue Apr 25, 2018 · 7 comments
Closed

PublishDiagnostics Notification and File Deletions #463

cdietrich opened this issue Apr 25, 2018 · 7 comments
Labels
info-needed Issue requires more information from poster

Comments

@cdietrich
Copy link

cdietrich commented Apr 25, 2018

if the client deletes a file is the server then required to send a empty PublishDiagnostics Notification to clear the issues? at least vscode does not seem to clear the issues for deleted resources.

@cdietrich
Copy link
Author

cdietrich commented Apr 25, 2018

bildschirmfoto 2018-04-25 um 13 12 19

sample from vscode after deleting c.mydsl (server receives did change watched files and removed the file from its structure but did not send an empty notification.

=> Bug in vscode or should the server have sent an empty notification for the deleted file

@rcjsuen
Copy link
Contributor

rcjsuen commented Apr 25, 2018

According to the specification...

Diagnostics are “owned” by the server so it is the server’s responsibility to clear them if necessary.

This has been brought up in other VS Code extensions in the past. See microsoft/vscode-docker#237 and ionide/ionide-vscode-fsharp#730.

Although it does seem to me like clients should just wipe these things out themselves. Especially in the case where the client initiated the deletion (and you didn't popup an external terminal and called rm Errors.java yourself externally).

What does everyone else think?

@cdietrich
Copy link
Author

no i used the normal delete file context menu in vscode.

@mickaelistria how does lsp4e treat this situation? at least in eclipse you cannot show resource markers for files that are not there anymore

@mickaelistria
Copy link

For LSP4E and Eclipse IDE in general, it's just impossible by design of the marker API to create or keep a marker for a file that doesn't exist, so removing a file does remove automatically all markers.
This behavior is deep in the roots of markers in Eclipse Platform, and even if server sends different signals, it's not something we can implement a-la VSCode. The closest thing for LSP4E to replicate a similar behavior would be to placed diagnostics for deleted files as markers on the closest parent folder, but I don't think it'd be a good thing as no-one complains about it in LSP4E while 3 people already complained about VSCode appraoch.
I believe the issue you report is more specific to VSCode allowing such inconsistent state of markers, not something that's a bug in LSP.

@cdietrich
Copy link
Author

no i mean it the other way round: what happens if in lsp4e the server reports issues for files that do no exist: does it give a framework error in lsp4e

@mickaelistria
Copy link

mickaelistria commented Apr 26, 2018 via email

@dbaeumer
Copy link
Member

To make things consistent in all cases we decided to make the creator of markers responsible for their deletions. Since the marker were created my the server he owns them and needs to wipe them.

Unless I see a compelling case to change this I opt to close this issue. The current design is easy to communicate since it has no exceptions.

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Apr 26, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants