PowerShell / PowerShell/vscode-powershell

Language Server Becomes Unresponsive After Opening Command Explorer

Open
#4,992 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Command Explorer Issue-Bug Up for Grabs
Dominant language
TypeScript
Stars
1.9k
Forks
547
PR merge metrics
No merged PRs in 30d

Description

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

PowerShell intellisense works until I open the command explorer once. The command explorer never populates, and I have to close the command explorer and restart the PowerShell session to get intellisense working again.

PowerShell Version
PS> $PSVersionTable; $Host                                                                                                                                                                                             

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Name             : Visual Studio Code Host
Version          : 2024.2.2
InstanceId       : 99850762-31fb-4299-8d83-da801db98e37
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace
Visual Studio Code Version
PS> code --version                                                                                                                                                                                                     
1.89.1
dc96b837cf6bb4af9
x64
Extension Version
PS> code --list-extensions --show-versions | sls powershell                                                                                                                                                            

ms-vscode.powershell@2024.2.2
Steps to Reproduce
  1. Open a folder as a workspace.
  2. Create a PowerShell script.
  3. Type in the first half of a command.
  4. See intellisense working (or press Ctrl + Space to trigger it).
  5. Open PowerShell Command Explorer.
  6. Click on the end of the command you were just typing.
  7. Press Ctrl + Space to trigger intellisense.
  8. See indefinite "Loading..." status.
Visuals

https://github.com/PowerShell/vscode-powershell/assets/19195374/1a661185-ee5b-42fa-8a61-4f2572ea86e4

Logs
PowerShell Editor Services Client logs just after opening Command Explorer

[Trace - 11:17:18 PM] Sending request 'powerShell/getCommand - (15)'.
[Trace - 11:17:18 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Finding descriptors for powerShell/getCommand | Method='powerShell/getCommand'"
}


OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Finding descriptors for powerShell/getCommand | Method='powerShell/getCommand'
[Trace - 11:17:18 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "OmniSharp.Extensions.JsonRpc.ProcessScheduler: Queueing Serial:powerShell/getCommand:15 request for processing | Type='Serial' Name='powerShell/getCommand:15'"
}


OmniSharp.Extensions.JsonRpc.ProcessScheduler: Queueing Serial:powerShell/getCommand:15 request for processing | Type='Serial' Name='powerShell/getCommand:15'
[Trace - 11:17:18 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Starting: Processing request powerShell/getCommand 15 | Method='powerShell/getCommand' ResponseId='15'"
}


OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Starting: Processing request powerShell/getCommand 15 | Method='powerShell/getCommand' ResponseId='15'
[Trace - 11:17:18 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Starting: Routing Request (15) powerShell/getCommand | Id='15' Method='powerShell/getCommand'"
}


OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Starting: Routing Request (15) powerShell/getCommand | Id='15' Method='powerShell/getCommand'
[Trace - 11:17:18 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Converting params for Request (15) powerShell/getCommand to Microsoft.PowerShell.EditorServices.Handlers.GetCommandParams | Id='15' Method='powerShell/getCommand' Type='Microsoft.PowerShell.EditorServices.Handlers.GetCommandParams'"
}


OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Converting params for Request (15) powerShell/getCommand to Microsoft.PowerShell.EditorServices.Handlers.GetCommandParams | Id='15' Method='powerShell/getCommand' Type='Microsoft.PowerShell.EditorServices.Handlers.GetCommandParams'
[Trace - 11:17:18 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Converting params for Notification powerShell/getCommand to Microsoft.PowerShell.EditorServices.Handlers.GetCommandParams | Method='powerShell/getCommand' Type='Microsoft.PowerShell.EditorServices.Handlers.GetCommandParams'"
}


OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Converting params for Notification powerShell/getCommand to Microsoft.PowerShell.EditorServices.Handlers.GetCommandParams | Method='powerShell/getCommand' Type='Microsoft.PowerShell.EditorServices.Handlers.GetCommandParams'
[Trace - 11:17:18 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Response value was System.Collections.Generic.List`1[[Microsoft.PowerShell.EditorServices.Handlers.PSCommandMessage, Microsoft.PowerShell.EditorServices, Version=3.20.1.0, Culture=neutral, PublicKeyToken=null]] | Type='System.Collections.Generic.List`1[[Microsoft.PowerShell.EditorServices.Handlers.PSCommandMessage, Microsoft.PowerShell.EditorServices, Version=3.20.1.0, Culture=neutral, PublicKeyToken=null]]'"
}


OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Response value was System.Collections.Generic.List`1[[Microsoft.PowerShell.EditorServices.Handlers.PSCommandMessage, Microsoft.PowerShell.EditorServices, Version=3.20.1.0, Culture=neutral, PublicKeyToken=null]] | Type='System.Collections.Generic.List`1[[Microsoft.PowerShell.EditorServices.Handlers.PSCommandMessage, Microsoft.PowerShell.EditorServices, Version=3.20.1.0, Culture=neutral, PublicKeyToken=null]]'
[Trace - 11:17:18 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Finished: Routing Request (15) powerShell/getCommand in 382ms | Id='15' Method='powerShell/getCommand' ElapsedMilliseconds='382'"
}


OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Finished: Routing Request (15) powerShell/getCommand in 382ms | Id='15' Method='powerShell/getCommand' ElapsedMilliseconds='382'
[Trace - 11:17:18 PM] Received notification 'window/logMessage'.
Params: {
    "type": 4,
    "message": "OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Finished: Processing request powerShell/getCommand 15 in 382ms | Method='powerShell/getCommand' ResponseId='15' ElapsedMilliseconds='382'"
}


OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Finished: Processing request powerShell/getCommand 15 in 382ms | Method='powerShell/getCommand' ResponseId='15' ElapsedMilliseconds='382'

It will then send a textDocument/completion message when I do Ctrl + Space, but it will never receive any response, even after several minutes of waiting.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with PowerShell Command Explorer, then inspect the powerShell/getCommand and textDocument/completion request paths shown in the logs. Compare language-server behavior before and after opening the explorer; done means the explorer populates and completion receives a response without restarting the PowerShell session.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, typescript, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.