PowerShell / PowerShell/vscode-powershell

Linter gets stuck in strange state, saving removes lots of code

Open
#5,221 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-PSReadLine Issue-Bug
Dominant language
TypeScript
Stars
1.9k
Forks
547
PR merge metrics
No merged PRs in 30d

Description

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

This is a strange one. It happens sometimes, randomly. Now I got it on tape. 🎥

So the linter will get stuck in some strange state, complaining about an error that is not there.

I then do CTRL + S, and a lot of stuff gets stripped. CTRL + Z to get it back. Did this twice, the second time the linter seemed to "catch up", and the problem went away.

https://github.com/user-attachments/assets/6fa9dd53-3202-4b61-972f-4f15f43e1f0c

PowerShell Version
7.5.2 x64 on Windows 11 24H2 x64
Visual Studio Code Version
1.101.1
18e3a1ec544e6907be1e944a94c496e302073435
x64
Extension Version
ms-vscode.powershell@2025.0.0
Steps to Reproduce

Don't know how to reliably reproduce.

Visuals

No response

Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked recording and the reported versions of PowerShell, Visual Studio Code, and the extension. Investigate the linter and save behavior in the extension, but note that the report provides no file, test, log, or reliable reproduction steps. Done means reproducing the stuck linter state and preventing save from stripping code.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, typescript, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.