PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code

Home Page:https://marketplace.visualstudio.com/items/ms-vscode.PowerShell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Language Server Becomes Unresponsive After Opening Command Explorer

andria-dev opened this issue · comments

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

Recording.2024-05-17.234022.mp4

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.