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

Compile errors on removed files are still listed in "Problems" after a rebuild #730

Closed
tomasaschan opened this issue Mar 6, 2018 · 6 comments
Labels
enhancement Accepted suggestions that makes existing features better up for grabs Good first issues

Comments

@tomasaschan
Copy link

Steps to reproduce:

  1. Create a new F# project, e.g. with dotnet new classlib -lang f# and open the project folder in VS Code.

  2. Introduce a compile error in the generated Library.fs file, e.g. by adding let x = without finishing the statement. (optionally build the project with dotnet build to see it fail).

  3. Look in the "problems" pane of VS Code (Ctrl + Shift + M). The error introduced above is correctly listed.

  4. Delete the Library.fs file and remove its reference from the project file.

  5. Rebuild the project. It now succeeds, but the compile error from before is still listed in the problems panel.

The incorrectly listed error disappears upon reloading the window, but it would be even smoother if I didn't have to do that :)

@Krzysztof-Cieslak Krzysztof-Cieslak added enhancement Accepted suggestions that makes existing features better up for grabs Good first issues labels Mar 7, 2018
@tomasaschan
Copy link
Author

I just realized this might not be Ionide's fault - I just had the same behavior happen on a Dockerfile. (Of course, it might just be that the Docker extension has the same bug...)

@Krzysztof-Cieslak
Copy link
Member

I do kinda feel it should be handled in VSCode... but it may be by-design, and we definitely can work around that - file watcher looking for deleted event, and removing errors from diagnostic collections would do a trick.

@vbfox
Copy link
Contributor

vbfox commented Mar 15, 2018

https://microsoft.github.io/language-server-protocol/specification#textDocument_publishDiagnostics

Diagnostics are “owned” by the server so it is the server’s responsibility to clear them if necessary. The following rule is used for VS Code servers that generate diagnostics:

&

When a file changes it is the server’s responsibility to re-compute diagnostics and push them to the client. If the computed set is empty it has to push the empty array to clear former diagnostics. Newly pushed diagnostics always replace previously pushed diagnostics. There is no merging that happens on the client side.

So I suspect that VS Code answer to that is : Nop, handle it in your extensions / LSP servers :)

@Krzysztof-Cieslak
Copy link
Member

Fair enough

@tomasaschan
Copy link
Author

tomasaschan commented Mar 16, 2018

@vbfox Thanks for the reference; I'll go ahead and file a bug report with the Docker extension too :)

For reference: microsoft/vscode-docker#237

@MangelMaxime
Copy link
Contributor

I would like to work on this issue.

MangelMaxime pushed a commit to MangelMaxime/ionide-vscode-fsharp that referenced this issue May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Accepted suggestions that makes existing features better up for grabs Good first issues
Development

No branches or pull requests

4 participants