vscode-powershell: Intellisense not working properly

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

Intellisense is no longer working consistently. cmdlets that have not been used earlier within the workspace will not tab-complete, or provide any information.

This is very similar to #179. As suggested in #179, I have uploaded the editorservices.log

I have disable, uninstalled, and re-installed the PowerShell extension. I have rebooted VSCode many times, and have rebooted my machine as well. No change.

PowerShell Version

PS 7.2.5> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Microsoft Windows 10.0.19044
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

PS 7.2.5> code --version 
1.68.1
30d9c6cd9483b2cc586687151bcbcd635f373630
x64

Extension Version

PS 7.2.5> code --list-extensions --show-versions | Select-String powershell

ms-vscode.powershell@2022.6.1
ms-vscode.powershell-preview@2022.6.3

Steps to Reproduce

Typing get-pro will not autocomplete to any cmdlet. Instead it inserts a tab. The same happens with new-obj. Pressing ctrl+space yields no results.

However, Get-PSCallstack, which has been used earlier in the .ps1, and elsewhere in the workspace, autocompletes fine.

Visuals

VSCode-GetPSCallStack VSCode-GetProcess VSCode-NewObject

Logs

EditorServices.log

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I started in on my settings.json file, and commented out everything to see if the issue was still present. It was not. slowly uncommented sections till the problem re-emerged. Then narrowed it down to the setting editor.suggest.showfunctions, which was set to false. set it to true, and the uncommented the reset of my settings, and… no issue.

So this is not an issue with the powershell extension, just an issue with me. Don’t ever remember setting this preference, but regardless, intellisense is back for me. I will go ahead and close this issue.

@Pxtl the only thing in PSES which uses that is the shell integrations script, can you try disabling it via terminal.integrated.shellIntegration.enabled?

Yes, I tried that and it has resolved the issue, thanks. I don’t love it as a workaround but since I don’t recall ever noticing any impressive integration on the integrated powershell console, I doubt I’ll miss it. I tend to use an external powershell console anyways unless I’m running in the debugger. Hopefully the VSCode team resolves the issue properly… or Microsoft force-updates everybody to PSCore so I no longer have to support PS5.1 machines. But I suppose the PS Core team finds it easier to develop a language when they don’t have actual users.

@Pxtl the only thing in PSES which uses that is the shell integrations script, can you try disabling it via terminal.integrated.shellIntegration.enabled?

Woah, good catch @tmknight! Yes, we recently fixed the initialization sequence so that non-VS Code clients would work again, and in doing so now directly execute essentially cd <that string>. Thing is, it seemed like we wouldn’t need to test that it exists, since the client checks too…but you found the edge case where the client is happy and the server is not. We’ll get it fixed! Thank you for checking.