Move file to the misc workspace when it is deleted, if it is open #8759
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1823464
We have file watchers, because we care about projects and things, and LSP has
didOpenanddidClosebecause LSP cares about documents. Sometimes these two things don't agree :)We were removing all of our knowledge of a document when the file is deleted, which makes sense at first glance, but there is no rule in LSP that says a file that is open has to exist in the physical realm. This change makes us move an open file to our Misc Files workspace, instead of forgetting about it, if its open.
Matches Roslyn behaviour here: https://github.com/dotnet/roslyn/blob/1119057b76330c6ec80b2a8c04c7fb4973d48773/src/Features/LanguageServer/Protocol/Workspaces/LspWorkspaceManager.cs#L251-L257