Open andria-dev opened 5 months ago
I see same issue. Command Explorer never populates. When I run code.exe as different user, on same computer, Command Explorer and Intellisense work as expected.
After removing the Environment variable “Path” element, pointing to a folder containing PowerShell scripts, the Command Explorer and Intellisense worked as expected.
Additional information: See: Script Content Triggers unhandled Newtonsoft.Json.JsonSerializationException #2165
The root cause appears to be caused by the actual script code I included in my PowerShell script as outlined in the above issue. Rewriting the code fixes the issue.
win 11, Powershell 7.4.3, vscode 1.9.0, powershell extension 2024.2.2.
Prerequisites
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
Visual Studio Code Version
Extension Version
Steps to Reproduce
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.