Skip to content

Ignore didOpen notifications for git schemed documents from VS Code #2090

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

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

andyleejordan
Copy link
Member

For some reason VS Code, in some repositories and configurations, will send us DidOpenTextDocument notifications for special documents with the git scheme (not file or untitled). It's probably some internal representation that VS Code is using to supply VCS information. Because we were specifically ignoring the URI in this handler these files were getting erroneously added to our workspace service's list of open files, which then caused duplicate references.

Fixes PowerShell/vscode-powershell#4784.

For some reason VS Code, in some repositories and configurations, will
send us `DidOpenTextDocument` notifications for special documents with
the `git` scheme (not `file` or `untitled`). It's probably some internal
representation that VS Code is using to supply VCS information. Because
we were specifically ignoring the URI in this handler these files were
getting erroneously added to our workspace service's list of open files,
which then caused duplicate references.
@silverqx
Copy link

This should solve the problem? Please let me know how I can test it or when there will be some preview release or something. Thx

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

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

LGTM!

@andyleejordan andyleejordan added this pull request to the merge queue Oct 18, 2023
Merged via the queue into main with commit b82b8b8 Oct 18, 2023
@andyleejordan andyleejordan deleted the andyleejordan/ignore-git-files branch October 18, 2023 22:01
@andyleejordan
Copy link
Member Author

andyleejordan commented Oct 19, 2023

This should solve the problem? Please let me know how I can test it or when there will be some preview release or something. Thx

@silverqx It should solve the problem based on how I was able to reproduce it. The fix will first be available in the next pre-release, so please try that out when it comes out and let us know!

@silverqx
Copy link

Ok thx I will wait for the new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

References are doubled the same filepath with .git extension
3 participants