Vscode-powershell: IntelliSense fails occasionally - again

Created on 6 Jun 2020  路  16Comments  路  Source: PowerShell/vscode-powershell

Issue Description

I am experiencing a problem with... IntelliSense failing.

1591449835-872343d1-59b3-436d-a112-c71c820037db1591449833798.zip

I feel a bit stupid filling this again but again got this issue. I am not sure if it's:

Or it's more about this:

But I still see hiccups that never recover. I deleted a lot of offending PowerShell modules, but since I have no clue about reasons it never recovering it's hard to say.

If you tell me what to look for, check I'm happy to do my own investigations.

Attached Logs

Follow the instructions in the README about
capturing and sending logs.

Environment Information

Visual Studio Code

| Name | Version |
| --- | --- |
| Operating System | Windows_NT x64 10.0.19041 |
| VSCode | 1.45.1|
| PowerShell Extension Version | 2020.6.0 |

PowerShell Information

|Name|Value|
|---|---|
|PSVersion|5.1.19041.1|
|PSEdition|Desktop|
|PSCompatibleVersions|1.0 2.0 3.0 4.0 5.0 5.1.19041.1|
|BuildVersion|10.0.19041.1|
|CLRVersion|4.0.30319.42000|
|WSManStackVersion|3.0|
|PSRemotingProtocolVersion|2.3|
|SerializationVersion|1.1.0.1|

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)

|Extension|Author|Version|
|---|---|---|
|bracket-pair-colorizer-2|CoenraadS|0.1.4|
|code-settings-sync|Shan|3.4.3|
|github-linker|gimenete|0.2.3|
|gitlens|eamodio|10.2.1|
|grammarly|znck|0.12.1|
|markdown-all-in-one|yzhang|3.0.0|
|material-icon-theme|PKief|4.1.0|
|powershell-preview|ms-vscode|2020.6.0|
|project-manager|alefragnani|11.0.1|
|vscode-markdownlint|DavidAnson|0.36.0|
|vscode-pull-request-github|GitHub|0.16.0|
|vscode-toggle-quotes|BriteSnow|0.3.2|
|vscode-wakatime|WakaTime|4.0.0|
|vscode-yaml|redhat|0.8.0|
|xml|DotJoshJohnson|2.5.0|

Area-IntelliSense Issue-Bug

Most helpful comment

I just want to add that for me, my problems happen on minutes/hourly basis. It's not occasional anymore. It may be related to my other issue https://github.com/PowerShell/vscode-powershell/issues/2908 but generally, it's pretty bad. I either stop using IntelliSense and try to pick things from memory or I restart session all the time. I can only imagine how it works for other people that never report issues thinking code just sucks.

All 16 comments

I found an instance in the logs of a completion request taking 35seconds (for future self, open the log file in vscode and do a regex search: \d\d\d\d\dms):

2020-06-06 15:27:34.289 +02:00 [VRB] Request 514 was abandoned due to content be modified
2020-06-06 15:27:34.289 +02:00 [DBG] Completion request canceled for file: file:///c:/Support/GitHub/Testimo/Private/SourcesDomain/GroupPolicyADM.ps1
2020-06-06 15:27:34.290 +02:00 [DBG] Finished: Routing Request (514) textDocument/completion in 35591ms
2020-06-06 15:27:34.290 +02:00 [VRB] Request 514 was cancelled
2020-06-06 15:27:34.290 +02:00 [DBG] Finished: Processing request textDocument/completion 514 in 35591ms

But I'm not sure if it was stuck in PowerShell or not. Either way, I think completion should be a cancellable action... I'm hoping PowerShell itself will handle it gracefully... so I think we should dupe this to https://github.com/PowerShell/PowerShellEditorServices/issues/1295

because I want a requirement if that work to support cancellation.

Let me discuss this in Triage tomorrow before I mark it.

Or \d{5,}ms. :-)

I can confirm that 2020.6.0 is better, but still falls over regularly. The extension logs show requests for completions just hanging until I give up after 20+ seconds (at which point they are "cancelled", which I believe is a lie in the current implementation). This is different than the behavior seen in earlier versions in that the extension itself isn't quite toast (in those cases I'd just see the log basically stop updating), but the user experience is still similar. I still have to kill the extension all the time to get it back into a working state.

I'll try to collect some useful logs later today.

Here's an interesting snippet from a couple minutes ago:

  • Does a command lookup for a function defined in the file I'm currently editing. That fails.
  • An exception with a very long async stack trace about concurrent access to the pipeline
  • A 52 second hang (request 8064) on a textDocument/definition call right after that, during which various extension features like folding were not working.

pses-excerpt.log

My log is pretty rotten with sequences like that. Also a fair number of these exceptions about entering nested pipelines.

other-exceptions.txt

Thanks for looking into that @mattpwhite! Looks like further motivation for https://github.com/PowerShell/PowerShellEditorServices/issues/1295

1596305359-91a018eb-cd5f-4159-a261-8ba50c0e8b2f1596305357826.zip

Another log. Basically after first cancelled event everything goes to hell. It can go to hell as quick as 5-20 minutes in.

The last years I have always moved to the ISE when writing more then 5 lines of code in PowerShell as IntelliSense is still not reliable at all. This week I am developing for Universal Dashboard and tried with VSCode as there is a plugin for UD. It is extremely painful. If the script gets a bit bigger, IntelliSense does not work at all. Closing the terminal does not solve the issue. It feels like in the old VBS times.

Another area is DSC. When writing configurations or interacting with DSC cmdlets, IntelliSense dies.

What data would help working on this?

We recently published an update to our preview extension which has addressed a number of issues, would you mind giving it a try and letting us know if you are still hitting this?

@raandree when you reference the script getting bigger, what size of script are you roughly seeing?

@SydneyhSmith, right after commenting on this issue I got the notification about the new version of the PowerShell Preview extension. It feels much better!

One issue is still there. IntelliSense works in the terminal but not in the code editor. I have created a screen recording of the behavior: https://1drv.ms/v/s!AuCqmYWYQ_kMnohF-j93qXWJsmtBXA?e=SLid98

Thanks @raandree for the screengrab that is super helpful! Noticed the red squigglies when you are expecting the completions---this may be due to the placement of the the cmd not being valid so we wouldnt expect completions to work there...what is the squiggly you are getting?
image

I am still seeing regularly seeing this in both latest (as of this message) stable and preview of PowerShell Integrated Console
image

This is expected:
image

Version: 1.49.2 (user setup)
Commit: e5e9e69aed6e1984f7499b7af85b3d05f9a6883a
Date: 2020-09-24T16:29:41.983Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041

I just want to add that for me, my problems happen on minutes/hourly basis. It's not occasional anymore. It may be related to my other issue https://github.com/PowerShell/vscode-powershell/issues/2908 but generally, it's pretty bad. I either stop using IntelliSense and try to pick things from memory or I restart session all the time. I can only imagine how it works for other people that never report issues thinking code just sucks.

@SydneyhSmith I'm still experiencing this issue pretty regularly. Do you need extra logs to analyse the issue or what's the reason the Needs: Attention flag was removed?

If there's a way I can help get to the root of this issue, I'd be more than willing to help.

Thanks @danstur this issue is actively being worked on--the reason the "Needs:Attention" was removed is because no immediate response was needed on the issue comment thread-- the fact that the issue is still open indicates it has not been resolved. Thanks!

In our team we have same problem so in case I can help, let me know!

Was this page helpful?
0 / 5 - 0 ratings