Skip to content

When starting VSCode and opening a .ps1 file does not trigger a run of PSScriptAnalyzer automatically any more #1569

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
bergmeister opened this issue Oct 9, 2018 · 3 comments
Labels

Comments

@bergmeister
Copy link
Contributor

bergmeister commented Oct 9, 2018

System Details Output

### VSCode version: 1.28.0 431ef9da3cf88a... x64

### VSCode extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

### PSES version: 1.9.0.0

### PowerShell version:
Name                           Value
----                           -----
PSVersion                      5.1.14409.1012
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1012
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When opening VS Code (1.28 -latest RTM release with the latest RTM 1.9.0 of the extension), with a file foo.ps with the content gci then the user used to see the PSScriptAnalyzer analysis right away e.g. as a squiggle under gci. Since one of the last extension updates (I cannot remember when I noticed that it stopped working), this does not happen any more and one can trigger the run of PSSA only manually by starting to type.

@SeeminglyScience thinks it might be the line below since "that catch block used to just be return. Pretty sure that's the only analysis related change I made"
https://github.com/PowerShell/PowerShellEditorServices/blob/67af23203c0d7aac52a6c5655d7d7f1202e80dd0/src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs#L1505
Note that this does not happen in the combination of using code-insiders and the 2.0.0 preview of the extension. I suspect the culprit is rather the extension and not VSCode itself

Expected Behaviour

Show PSSA analysis after having opened a file in a new editor

Actual Behaviour

One needs to edit the file to eventually trigger a run of PSSA to see squiggles

Attached Logs

If needed I can supply them in case you cannot repro this issue.

@jagrock
Copy link

jagrock commented Oct 11, 2018

Also seen this and just generally latency with PSScriptAnalyzer. Sometimes, even after fixing an alias to the full expression it still shows in the problem window and has the squiggly line. Have to delete and retype or change one of the other parts of the line (sometimes a few times) to get PSScriptAnalyzer to update the problem.

@TylerLeonhardt
Copy link
Member

this is a pretty old issue and I can't repro:

image

I'll close this but let me know if you're still seeing this!

@necoras
Copy link

necoras commented Nov 16, 2020

I'm having this issue. I get no analysis, and I can't auto-format any files since that uses psscriptanalyzer by default.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Nov 16, 2020
@andyleejordan andyleejordan removed the Needs: Maintainer Attention Maintainer attention needed! label Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants