Skip to content

Syntax checker not detecting change of files.  #4003

@jhoneill

Description

@jhoneill

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all 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

I can not see this as an issue and I think it is the extension but it may be VS code itself (if so I'll close this and and open there).

I'm working with some scripts which generate other PowerShell scripts, so the process goes

  • Edit generator or Edit instructions in VSCode
  • Run the generator script from the PowerShell integrated console
  • Edit the resulting code

What I'm finding is the error highlighting is marking thing in the text as errors which were in a previous version. What seems to cause this is the change made to the file outside VS code, as if there is a copy cached, which is still used when the updated file is opened.

PowerShell Version

Name                           Value�[0m
----                           -----�[0m
PSVersion                      7.2.4
PSEdition                      Core
GitCommitId                    7.2.4
OS                             Microsoft Windows 10.0.19042
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

1.67.2
c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
x64

Extension Version

ms-vscode.powershell@2022.5.1

Steps to Reproduce

  1. Add extra lines containing a syntax error to an otherwise valid file. Problems should be displayed correctly
  2. Close it, and edit it outside VS Code to remove the error
  3. Reopen in VSCode and note the problems show before are still show. (see Visuals below)

Visuals

image

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions