Skip to content

Command Explorer never loads for Powershell ver. 7. It does load with 5.1 X64 #2949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
doyoucompute opened this issue Sep 14, 2020 · 4 comments

Comments

@doyoucompute
Copy link

System Details

System Details Output

### VSCode version: 1.48.2 a0479759d6e9ea56afa657e454193f72aef85bd0 x64

### VSCode extensions:
[email protected]
[email protected]


### PSES version: 2.2.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.17763.1007
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.1007
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

I am experiencing a problem with the powershell command explorer window. It never loads when I'm running powershell 7.0 as the PoSH version - but it will eventually load when 5.1 x64 is loaded. Intellisense will also stop working when I try to refresh the command explorer.

Expected Behaviour

Command explorer should load available commands.

Actual Behaviour

It never does.

Attached Logs

Follow the instructions in the troubleshooting docs
LOGZIP.zip

about capturing and sending logs.

@ghost ghost added the Needs: Triage Maintainer attention needed! label Sep 14, 2020
@corbob
Copy link
Contributor

corbob commented Sep 14, 2020

Intellisense will also stop working when I try to refresh the command explorer.

This would likely be due to refreshing the explorer needs to pass off to PSES which is also what intellisense uses. So while the explorer is refreshing we can't get intellisense information.

As for why it's not working on pwsh 7.0, I don't have the issue, and am currently on mobile so I can't look through the log. I'll take a look in a few hours when I'm back at a computer and see if it provides any hints.

@corbob
Copy link
Contributor

corbob commented Sep 14, 2020

🤔 I'm not seeing any blatant errors that appear related to the Command Explorer in the logs, but in the EditorServices.log for 1600114796 There's some errors that appear related to log parsing, and then there's this:

2020-09-14 16:20:52.650 -04:00 [DBG] Finding descriptor for powerShell/getCommand
2020-09-14 16:20:52.650 -04:00 [DBG] Queueing "Serial":powerShell/getCommand:7 request for processing
2020-09-14 16:20:53.074 -04:00 [DBG] Finding descriptor for powerShell/getCommand
2020-09-14 16:20:53.075 -04:00 [DBG] Queueing "Serial":powerShell/getCommand:8 request for processing
2020-09-14 16:20:53.297 -04:00 [DBG] Finding descriptor for powerShell/getCommand
2020-09-14 16:20:53.299 -04:00 [DBG] Queueing "Serial":powerShell/getCommand:9 request for processing
2020-09-14 16:20:53.479 -04:00 [DBG] Finding descriptor for powerShell/getCommand
2020-09-14 16:20:53.480 -04:00 [DBG] Queueing "Serial":powerShell/getCommand:10 request for processing
2020-09-14 16:20:53.687 -04:00 [DBG] Finding descriptor for powerShell/getCommand
2020-09-14 16:20:53.687 -04:00 [DBG] Queueing "Serial":powerShell/getCommand:11 request for processing
2020-09-14 16:20:53.887 -04:00 [DBG] Finding descriptor for powerShell/getCommand
2020-09-14 16:20:53.887 -04:00 [DBG] Queueing "Serial":powerShell/getCommand:12 request for processing
2020-09-14 16:20:54.089 -04:00 [DBG] Finding descriptor for powerShell/getCommand
2020-09-14 16:20:54.090 -04:00 [DBG] Queueing "Serial":powerShell/getCommand:13 request for processing
2020-09-14 16:20:54.303 -04:00 [DBG] Finding descriptor for powerShell/getCommand
2020-09-14 16:20:54.303 -04:00 [DBG] Queueing "Serial":powerShell/getCommand:14 request for processing
2020-09-14 16:20:54.505 -04:00 [DBG] Finding descriptor for powerShell/getCommand
2020-09-14 16:20:54.505 -04:00 [DBG] Queueing "Serial":powerShell/getCommand:15 request for processing
2020-09-14 16:20:54.711 -04:00 [DBG] Finding descriptor for powerShell/getCommand
2020-09-14 16:20:54.711 -04:00 [DBG] Queueing "Serial":powerShell/getCommand:16 request for processing
2020-09-14 16:21:03.778 -04:00 [VRB] Response value was System.Collections.Generic.List`1[[Microsoft.PowerShell.EditorServices.Handlers.PSCommandMessage, Microsoft.PowerShell.EditorServices, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null]]
2020-09-14 16:21:03.778 -04:00 [DBG] Finished: Routing Request (6) powerShell/getCommand in 11806ms
2020-09-14 16:21:03.779 -04:00 [DBG] Finished: Processing request powerShell/getCommand 6 in 11806ms
2020-09-14 16:21:03.779 -04:00 [DBG] Starting: Processing request powerShell/getCommand 7
2020-09-14 16:21:03.779 -04:00 [DBG] Starting: Routing Request (7) powerShell/getCommand
2020-09-14 16:21:03.779 -04:00 [VRB] Converting params for Request (7) powerShell/getCommand to Microsoft.PowerShell.EditorServices.Handlers.GetCommandParams
2020-09-14 16:21:03.780 -04:00 [VRB] Attempting to execute command(s):

    Microsoft.PowerShell.Core\Get-Command -CommandType System.String[]
    Microsoft.PowerShell.Utility\Sort-Object -Property Name

2020-09-14 16:21:03.780 -04:00 [VRB] Session state changed --

    Old state: Ready
    New state: Running
    Result: NotFinished
2020-09-14 16:21:04.060 -04:00 [VRB] Session state changed --

    Old state: Running
    New state: Ready
    Result: Completed

Which looks like you tried to refresh the Command Explorer window ~10 times in rapid succession. But then about 5 of them complete before the file ends abruptly.

The part I don't see in the PowerShell 5 folder, but do see there is these failures:

2020-09-14 16:20:47.608 -04:00 [VRB] Attempting to execute command(s):

    $HOME/.vscode[-insiders]/extensions/ms-vscode.powershell-<version>/logs/
    Out-Default

2020-09-14 16:20:47.608 -04:00 [VRB] Session state changed --

    Old state: Ready
    New state: Running
    Result: NotFinished
2020-09-14 16:20:47.609 -04:00 [VRB] Session state changed --

    Old state: Running
    New state: Ready
    Result: Failed
2020-09-14 16:20:47.609 -04:00 [ERR] Execution of the following command(s) completed with errors:

    $HOME/.vscode[-insiders]/extensions/ms-vscode.powershell-<version>/logs/
    Out-Default


2020-09-14 16:20:47.614 -04:00 [WRN] Runtime exception occurred while executing command:

System.Management.Automation.ParseException: At line:1 char:7
+ $HOME/.vscode[-insiders]/extensions/ms-vscode.powershell-<version>/lo …
+       ~
You must provide a value expression following the '/' operator.

At line:1 char:7
+ $HOME/.vscode[-insiders]/extensions/ms-vscode.powershell-<version>/lo …
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token '.vscode[-insiders]/extensions/ms-vscode.powershell-<version>/logs/' in expression or statement.
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings)
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.<>c__DisplayClass89_0`1.<ExecuteCommandAsync>b__0() in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 778
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 778
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 823

@corbob
Copy link
Contributor

corbob commented Sep 14, 2020

One thing I notice while testing this, there used to be a "running" indicator in the status bar that spun when PSES was executing something. That indicator no longer seems to be there, and the Command Explorer is taking 10 - 15 seconds to execute the first time it runs. This makes it appear that nothing is happening, and the 10+ seconds feels a lot longer than when I initially implemented it (Although it could just be perceptions and it's always been that long)

@doyoucompute
Copy link
Author

Thanks for investigating corbob. It does load after 20 seconds or so on some other machines - it's just something funky with my primary workstation I suppose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants