Skip to content

References are doubled the same filepath with .git extension #4784

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

Closed
5 of 6 tasks
silverqx opened this issue Oct 14, 2023 · 15 comments · Fixed by PowerShell/PowerShellEditorServices#2090
Closed
5 of 6 tasks
Assignees

Comments

@silverqx
Copy link

silverqx commented Oct 14, 2023

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

All references are doubled, they have the same path but with the .git extension. The project must be a GIT project, must contain .git/ folder.

PowerShell Version

λ $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.8
PSEdition                      Core
GitCommitId                    7.3.8
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

λ code --version

1.83.1
f1b07bd25dfad64b0167beb15359ae573aecd2cc
x64

Extension Version

λ code --list-extensions --show-versions | Select-String powershell

[email protected]

Steps to Reproduce

Create the pwsh function that has more than 0 references and the file is inside a git repository.

Visuals

references_doubled

Logs

No response

@silverqx silverqx added the Issue-Bug A bug to squash. label Oct 14, 2023
@andyleejordan
Copy link
Member

Does this .git file exist on the file system?

@silverqx
Copy link
Author

Of course that no why would I have all the files doubled with .git extension. 🙂

@andyleejordan
Copy link
Member

Well, I can't repro it. Can you tell me what other extensions you have installed? Does it repro when you run an VS Code instance with only the PowerShell Extension?

@silverqx
Copy link
Author

I try it and let know, I need to find a little time for it but I do it, I have a lot of extensions installed and will have to disable them one by one to find out. GitHub actions or similar extension could cause this, will see.

@silverqx
Copy link
Author

I can reproduce it on a clean vscode profile (I moved ~/.AppData/Roaming/code and ~/.vscode to .bak).

To reproduce it you must open the folder that is also a GIT repository, must contain .git folder.

@silverqx
Copy link
Author

If it's not a git repository it works well.

@andyleejordan
Copy link
Member

Sorry, do you mean you're opening the .git folder itself? I definitely tested this in a Git repository and am not seeing this behavior. Do you see this with references in files provided by other extensions (like can you repro this in a C# or a Python file)?

@andyleejordan
Copy link
Member

Well, I can repro it very specifically in your project https://github.com/silverqx/TinyORM/tree/main/tools/private

@andyleejordan
Copy link
Member

andyleejordan commented Oct 17, 2023

It would appear that in some instances VS Code hands us "Git" documents (like where DocumentUri starts with git:/ similar to real files with file:/). I want to know when and why it does this, because I've never seen it before but sure do see it in your repo. At least the fix is to filter those out...working on it.

@silverqx
Copy link
Author

It would appear that in some instances VS Code hands us "Git" documents (like where DocumentUri starts with git:/ similar to real files with file:/).

Hmm

I want to know when and why it does this, because I've never seen it before but sure do see it in your repo.

I absolutely don't know too and I'm also confused about why is this happening.

At least the fix is to filter those out...working on it.

Great that is a good idea, I tried to find how to filter them out but I was not successful.

@silverqx
Copy link
Author

I have also another problem with these references, it doesn't directly depend to this issue but I ask here and will not create another issue.

Is there any vscode setting how I can tell the PowerShell extension to exclude some folders?

Eg. look at this, it's from my dotfiles, the problem is that my dotfiles also contain the vscode profile in the git repo:

references_1

There are 5 references in total, 2 in the pms.ps1 script and 3 in the pmu.ps1, but the PowerShell extension of course counts references from all the .ps1 files in the current project. What can I do about this?

@andyleejordan
Copy link
Member

I have also another problem with these references, it doesn't directly depend to this issue but I ask here and will not create another issue.

Is there any vscode setting how I can tell the PowerShell extension to exclude some folders?

Eg. look at this, it's from my dotfiles, the problem is that my dotfiles also contain the vscode profile in the git repo:

references_1

There are 5 references in total, 2 in the pms.ps1 script and 3 in the pmu.ps1, but the PowerShell extension of course counts references from all the .ps1 files in the current project. What can I do about this?

Hi, can you please open a separate issue for this. I think we respect the default search ignore settings in VS Code but want to double-check that with my team, which will happen when we triage new and open issues. Thanks!

@silverqx
Copy link
Author

silverqx commented Oct 19, 2023

Thx, for fixing this @andyleejordan

@andyleejordan
Copy link
Member

You're very welcome! I hope that's a complete fix, that is, that there isn't anything else sending git files over to the server. But I didn't see when debugging! Still don't know exactly why VS Code is sending didOpen notifications for files that we (the users) definitely didn't open.

@silverqx
Copy link
Author

From my experience is best to ask the author, if you know which code is responsible for that then look to git blame or GitHub history, find the author's name, create an issue, and ask why, an author will know it right away, maybe it's a bug.

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