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

Do not remove documents if they are not files #7607

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

ryzngard
Copy link
Contributor

Fixes AB#2261836

When the preview changes window closes, it issues a document closed for a document being tracked but with a URI of 'vscode-bulkeditpreview-editor'. This is a valid notification for closing a document but it should not be removed because that will cause the content to be lost making the client and server out of sync for what it thinks the csharp/html code is

@ryzngard ryzngard requested a review from a team as a code owner September 26, 2024 21:10
@ryzngard
Copy link
Contributor Author

@dibarbet could you take a look? I'm not sure if schema checking is the best way to do this or if there are schemes I might be missing

// Out of workspace files should be removed once they're closed
this.removeDocument(uri);
// Documents that are files should be removed if they are outside the workspace folder
if (uri.scheme === 'file') {
Copy link
Member

Choose a reason for hiding this comment

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

it depends - do you need to close non file documents? Other non-file documents that I know of

  1. Documents just created, but not saved
  2. Diff window files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Diff window files should also not cause us to remove. It looks like we don't track documents that are just created but not saved.

@ryzngard ryzngard closed this Sep 26, 2024
@ryzngard ryzngard reopened this Sep 26, 2024
@ryzngard
Copy link
Contributor Author

@dotnet-policy-service rerun

@ryzngard ryzngard enabled auto-merge (squash) September 26, 2024 23:07
@ryzngard ryzngard merged commit 148c19f into dotnet:main Sep 26, 2024
16 checks passed
@ryzngard ryzngard deleted the fix_preview_changes_bug branch September 27, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants