vscode-powershell
vscode-powershell copied to clipboard
Text corrupted when formatting the code after a branch switch
Prerequisites
- [X] I have written a descriptive issue title.
- [X] I have searched all open and closed issues to ensure it has not already been reported.
- [X] I have read the troubleshooting guide.
- [X] I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
- [X] I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
- [X] If this is a security issue, I have read the security issue reporting guidance.
Summary
I am experiencing an issue with formatting. I expect the formatted code to only contain text from the current branch, but it intermittently contains code from the previous branch I was working on.
PowerShell Version
Name Value
---- -----
PSVersion 5.1.14409.1018
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1018
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Visual Studio Code Version
1.70.0
da76f93349a72022ca4670c1b84860304616aaa2
x64
Extension Version
[email protected]
Steps to Reproduce
Work on a relatively large file (couple of hundred lines in my experience). Switch to a different branch, with somewhat different code Format the code (in my case automatically on save) Find code from the first branch splatted in a random location on the new branch
Once this happens, the only way to fix it that I've found is to restart VSCode.
I suspect that the Language Server isn't being reset when we switch branches.
Visuals
No response
Logs
No response
Thanks @andrewducker sorry to hear you are hitting this issue...we will need to do more investigation.
I've been having the same issue for a while, but haven't found a consistent repro.
@andrewducker Do you work in a devcontainer? I do, so just wondering if it can be ruled out as a reason.
I'm not in a devcontainer.
This issue was closed automatically as repro info was indicated as needed, but there has been no activity in over a week. Please feel free to reopen with any available information!