Skip to content

Syntax checker not detecting change of files. #4003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
6 tasks done
jhoneill opened this issue May 27, 2022 · 11 comments
Closed
6 tasks done

Syntax checker not detecting change of files. #4003

jhoneill opened this issue May 27, 2022 · 11 comments
Labels
Issue-Bug A bug to squash. Resolution-Duplicate Will close automatically.

Comments

@jhoneill
Copy link

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

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

@jhoneill jhoneill added the Issue-Bug A bug to squash. label May 27, 2022
@ghost ghost added the Needs: Triage Maintainer attention needed! label May 27, 2022
@jhoneill
Copy link
Author

Postscript - this also seems to impact folding. If the file has changed in the middle folding tries to fold were the old file should have folded.

@SydneyhSmith
Copy link
Collaborator

@jhoneill thanks for the issue report...if you edit the open file at all in VSCode, does this problem go away?

@SydneyhSmith SydneyhSmith added Needs: Repro Info 🤔 and removed Needs: Triage Maintainer attention needed! labels Jun 2, 2022
@jhoneill
Copy link
Author

jhoneill commented Jun 2, 2022

No - not quite.
I opened the file in notepad and vscode.
I made a couple of breaking edits an extra } at the end and unused variable , saved & closed, in Code, and then saved from notepad to back out out the changes.
If I add and delete spaces at the end, it stops complaining about the extra } but nothing seems to get rid of the complaint about the unused variable, and folding is off by one line as if the extra variable line is still there.

image

@jhoneill
Copy link
Author

jhoneill commented Jun 2, 2022

And if I close and re-open the file it adds an extra instance of the erroneous message each time
image

@andyleejordan
Copy link
Member

@jhoneill the latter is sadly known: #3252

@ghost
Copy link

ghost commented Jun 11, 2022

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!

@ghost ghost closed this as completed Jun 11, 2022
@jhoneill
Copy link
Author

@SydneyhSmith the bot shouldn't have closed this - do you need any more repro info ?

@SydneyhSmith
Copy link
Collaborator

Thanks, reopening

@SydneyhSmith SydneyhSmith reopened this Jun 13, 2022
@SydneyhSmith SydneyhSmith added Needs: Maintainer Attention Maintainer attention needed! and removed Needs: Repro Info 🤔 labels Jun 13, 2022
@SydneyhSmith
Copy link
Collaborator

Thanks @jhoneill we discussed today and we believe fixing #3252 will resolve both issues, so we will link the issues and mark this as a duplicate for now...thanks!

@SydneyhSmith SydneyhSmith added Resolution-Duplicate Will close automatically. and removed Needs: Maintainer Attention Maintainer attention needed! labels Jun 13, 2022
@jhoneill
Copy link
Author

@SydneyhSmith If both get fixed together that will be great.

@ghost
Copy link

ghost commented Jun 14, 2022

This issue has been marked as duplicate and has not had any activity in a day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed Jun 14, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash. Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

3 participants