Skip to content

Instantly share code, notes, and snippets.

@victorwoo
Last active September 3, 2018 08:15
Show Gist options
  • Save victorwoo/445a54c2d2e39fdefabfc10f5246c793 to your computer and use it in GitHub Desktop.
Save victorwoo/445a54c2d2e39fdefabfc10f5246c793 to your computer and use it in GitHub Desktop.
Visual Studio Code PowerShell Extension crashes when IntelliSense about to pop out on passing param to custom function
2018-09-03 16:00:00.038 [NORMAL] C:\PowerShellEditorServices\src\PowerShellEditorServices.Host\EditorServicesHost.cs: In method 'StartLogging', line 160:
PowerShell Editor Services Host v1.8.4.0 starting (pid 5533)...
Host application details:
Name: Visual Studio Code Host
ProfileId: Microsoft.VSCode
Version: 1.8.4
2018-09-03 16:00:00.055 [NORMAL] C:\PowerShellEditorServices\src\PowerShellEditorServices.Host\EditorServicesHost.cs: In method 'StartLanguageService', line 194:
Language service started, type = NamedPipe, endpoint = PSES_0d142770-0322-4d3d-b65d-f2fb4854be0c
2018-09-03 16:00:00.060 [NORMAL] C:\PowerShellEditorServices\src\PowerShellEditorServices.Host\EditorServicesHost.cs: In method 'StartDebugService', line 266:
Debug service started, type = NamedPipe, endpoint = PSES_463f0afd-c965-4f18-a22c-bdcaf379ce6e
2018-09-03 16:00:01.013 [NORMAL] C:\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: In method 'Initialize', line 220:
PowerShell runtime version: 6.0.4, edition: Core
2018-09-03 16:00:01.385 [ERROR] C:\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: In method 'ExecuteCommand', line 564:
Execution of the following command(s) completed with errors:
Import-Module /Users/vichamp/.vscode/extensions/ms-vscode.powershell-1.8.4/modules/PowerShellEditorServices/bin/Core/..\..\Commands/PowerShellEditorServices.Commands.psd1
2018-09-03 16:00:01.425 [NORMAL] C:\PowerShellEditorServices\src\PowerShellEditorServices.VSCode\ComponentRegistration.cs: In method 'Register', line 36:
PowerShell Editor Services VS Code module loaded.
2018-09-03 16:00:02.566 [ERROR] C:\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\ProtocolEndpoint.cs: In method 'OnListenTaskCompleted', line 391:
ProtocolEndpoint message loop terminated due to unhandled exception:
System.AggregateException: One or more errors occurred. (Length cannot be less than zero.
Parameter name: length) ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at System.Uri.CreateHostStringHelper(String str, UInt16 idx, UInt16 end, Flags& flags, String& scopeId)
at System.Uri.CreateHostString()
at System.Uri.EnsureHostString(Boolean allowDnsOptimization)
at System.Uri.GetComponentsHelper(UriComponents uriComponents, UriFormat uriFormat)
at System.Uri.GetComponents(UriComponents components, UriFormat format)
at System.Uri.get_AbsoluteUri()
at Microsoft.PowerShell.EditorServices.CodeLenses.ReferencesCodeLensProvider.<ResolveCodeLensAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.CodeLenses.CodeLensFeature.<HandleCodeLensResolveRequest>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.<ListenForMessages>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at System.Uri.CreateHostStringHelper(String str, UInt16 idx, UInt16 end, Flags& flags, String& scopeId)
at System.Uri.CreateHostString()
at System.Uri.EnsureHostString(Boolean allowDnsOptimization)
at System.Uri.GetComponentsHelper(UriComponents uriComponents, UriFormat uriFormat)
at System.Uri.GetComponents(UriComponents components, UriFormat format)
at System.Uri.get_AbsoluteUri()
at Microsoft.PowerShell.EditorServices.CodeLenses.ReferencesCodeLensProvider.<ResolveCodeLensAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.CodeLenses.CodeLensFeature.<HandleCodeLensResolveRequest>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.<ListenForMessages>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---
2018-09-03 16:00:02.566 [ERROR] C:\PowerShellEditorServices\src\PowerShellEditorServices.Host\EditorServicesHost.cs: In method 'ProtocolEndpoint_UnhandledException', line 435:
PowerShell Editor Services is terminating due to an unhandled exception, see previous logs for details.
2018-09-03 16:00:02.597 [ERROR] C:\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: In method 'PopRunspace', line 1969:
Caller attempted to pop a runspace when no runspaces are on the stack.
2018-09-03 16:00:02.597 [ERROR] C:\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: In method 'PopRunspace', line 1969:
Caller attempted to pop a runspace when no runspaces are on the stack.
function mytest {
}
mytest
# PowerShell extension for Visual Studio Code crashes when InteliSense about to parse `mytest` custom function.
# Versions:
#
# - Visual Studio Code - 1.26.1
# - PowerShell Extension for Visual Studio Code - v1.8.4
# - PowerShell - v6.0.4 for MAC
# - OS - macOS High Sierra 10.13.6
9/3/2018 3:59:58 PM [NORMAL] - Path specified by 'powerShellExePath' setting - '' - not found, reverting to default PowerShell path.
9/3/2018 3:59:58 PM [NORMAL] - Language server starting --
9/3/2018 3:59:58 PM [NORMAL] - exe: /usr/local/bin/pwsh
9/3/2018 3:59:58 PM [NORMAL] - args: /Users/vichamp/.vscode/extensions/ms-vscode.powershell-1.8.4/modules/PowerShellEditorServices/Start-EditorServices.ps1 -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.8.4'-AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath '/Users/vichamp/.vscode/extensions/ms-vscode.powershell-1.8.4/modules'-EnableConsoleRepl -LogLevel 'Normal' -LogPath '/Users/vichamp/.vscode/extensions/ms-vscode.powershell-1.8.4/logs/1535961598-8515e06b-fb09-4e85-9dda-460706e6b2891535959645359/EditorServices.log' -SessionDetailsPath '/Users/vichamp/.vscode/extensions/ms-vscode.powershell-1.8.4/sessions/PSES-VSCode-5098-938986' -FeatureFlags @()
9/3/2018 3:59:59 PM [NORMAL] - powershell.exe started, pid: 5533
9/3/2018 4:00:00 PM [NORMAL] - Language server started.
9/3/2018 4:00:00 PM [NORMAL] - {"languageServiceTransport":"NamedPipe","languageServicePipeName":"/var/folders/mj/gkks06r56ll81f_pr7t42lzm0000gn/T/CoreFxPipe_PSES_0d142770-0322-4d3d-b65d-f2fb4854be0c","debugServicePipeName":"/var/folders/mj/gkks06r56ll81f_pr7t42lzm0000gn/T/CoreFxPipe_PSES_463f0afd-c965-4f18-a22c-bdcaf379ce6e","status":"started","debugServiceTransport":"NamedPipe"}
9/3/2018 4:00:00 PM [NORMAL] - Connecting to language service on pipe /var/folders/mj/gkks06r56ll81f_pr7t42lzm0000gn/T/CoreFxPipe_PSES_0d142770-0322-4d3d-b65d-f2fb4854be0c...
9/3/2018 4:00:00 PM [NORMAL] - Language service connected.
9/3/2018 4:00:02 PM [NORMAL] - powershell.exe terminated or terminal UI was closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment