Closed
PowerShell/PowerShellEditorServices
#1241Closed
Copy link
Labels
Description
System Details
### VSCode version: 1.43.1 fe22a9645b44368865c0ba92e2fb881ff1afce94 x64
### VSCode extensions:
andyyaldoo.vscode-json@1.5.0
ms-azure-devops.azure-pipelines@1.165.1
ms-azuretools.vscode-azurefunctions@0.21.0
ms-dotnettools.csharp@1.21.15
ms-mssql.mssql@1.9.0
ms-vscode-remote.remote-containers@0.106.0
ms-vscode-remote.remote-ssh@0.50.0
ms-vscode-remote.remote-ssh-edit@0.50.0
ms-vscode-remote.remote-wsl@0.42.4
ms-vscode-remote.vscode-remote-extensionpack@0.20.0
ms-vscode.azure-account@0.8.8
ms-vscode.powershell@2020.3.0
ms-vscode.powershell-preview@2020.3.0
### PSES version: 2.1.0.0
### PowerShell version:
Name Value
---- -----
PSVersion 7.0.0
PSEdition Core
GitCommitId 7.0.0
OS Microsoft Windows 10.0.18362
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Issue Description
When the default file type is PowerShell, and something else (e.g. JSON) is pasted into a new Window many syntax errors are detected and shown in the problem window

However if the document type changed to JSON or Plain Text the errors are not removed
Even if the file is closed the errors remain
Expected Behaviour
PowerShell syntax errors should only appear while the file is present and believed to be a PowerShell file.


Activity
TylerLeonhardt commentedon Mar 20, 2020
If you made a single file edit, do the Problems go away? Like, add a single space in the file.
jhoneill commentedon Mar 20, 2020
no, sadly
TylerLeonhardt commentedon Mar 20, 2020
If you add another syntax error (like a random extra
}or something) do you get additional Problems showing up?jhoneill commentedon Mar 20, 2020
No, once the type is changed to plain text, the errors are frozen. No new ones get added , but the old ones remain.
TylerLeonhardt commentedon Mar 23, 2020
It seems like other extensions have this issue as well... I just reproed with the C# extension:
Plain text file, C# warning:

James O'Neill (@jhoneill) since I'm also seeing this with C# it's going to be an issue on VS Code itself:
https://github.com/Microsoft/vscode
Can you open an issue there?
jhoneill commentedon Mar 24, 2020
microsoft/vscode#93271 basic said it's the responsibility of the extensions...
TylerLeonhardt commentedon Mar 24, 2020
PR out for this.