-
Notifications
You must be signed in to change notification settings - Fork 520
Description
20210315 1615856510-81b75b36-ddce-47dd-b292-72c53676f7601615855631823.zip
20210315 VSCode PowerShell syntax highlighting 'messed up' by changing file under VSCode
Issue Description
I am experiencing a problem with syntax highlighting when a .ps1 changes underneath VSCode.
Similarly, some changes cause PSScriptAnalyzer issues (e.g. "missing }" warnings that I could not make sense of)
Repro Steps
- open VSCode - open output folder of my VS2019 project
- open SDF-UefiFlash.ps1 using VSCode's Explorer
- observe syntax highlighting (it is correct at this point)
- close SDF-UefiFlash.ps1 in VSCode but keep the folder open
- while keeping VSCode open, open VS2019 and open the solution that contains SDF-UefiFlash.ps1 in addition to a .NET class library used by the .ps1 script
- In VS2019, make a change to SDF-UefiFlash.ps1 - this file being modified here is checked into git. The change I made was to add a .PARAMETER definition to the synopsis at the top of the file.
- rebuild all in VS2019 - this copies the newly changed version of SDF-UefiFlash.ps1 to the output folder that VSCode has open
- re-open SDF-UefiFlash.ps1 in VSCode
Expected Behaviour
The syntax highlighting works when I open a .ps1 in VSCode even if I have used VS2019 to update the file and published it to the folder VSCode has opened by 'rebuilding all' in VS2019.
Actual Behaviour
If I "rebuild all" in VS2019 while VSCode has the output folder open, when I open the .ps1 (which is copied to the output folder by the VS2019 rebuild all), the syntax highlighting is "messed up" - presumably because VSCode has some information about the syntax highlighting cached.
Attached Logs
Follow the instructions in the README about
capturing and sending logs.
Environment Information
Visual Studio Code
| Name | Version |
|---|---|
| Operating System | Windows_NT x64 10.0.19042 |
| VSCode | 1.54.3 |
| PowerShell Extension Version | 2021年2月2日 |
PowerShell Information
| Name | Value |
|---|---|
| PSVersion | 7.1.3 |
| PSEdition | Core |
| GitCommitId | 7.1.3 |
| OS | Microsoft Windows 10.0.19042 |
| Platform | Win32NT |
| PSCompatibleVersions | 1.0 2.0 3.0 4.0 5.0 5.1.10032.0 6.0.0 6.1.0 6.2.0 7.0.0 7.1.3 |
| PSRemotingProtocolVersion | 2.3 |
| SerializationVersion | 1.1.0.1 |
| WSManStackVersion | 3.0 |
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
| Extension | Author | Version |
|---|---|---|
| cpptools | ms-vscode | 1.2.2 |
| jupyter | ms-toolsai | 20213619093157 |
| powershell | ms-vscode | 2021年2月2日 |
| python | ms-python | 20212636928669 |