You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing a problem with Powershell Integrated console crashing when I save a file that is known to not have the proper formatting.
How to reproduce:
Create a PowerShell file in another text editor and set braces on the same line as the function name. Add two empty lines at the end of the file
Set "powershell.codeFormatting.openBraceOnSameLine": false, in vscode user setting
Set "editor.formatOnSave": true, "files.trimTrailingWhitespace": true, as well
open the PowerShell file in vscode and use the Command + S
Attached Logs
2018-09-13 10:45:29.992 [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. (Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index) ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, EventContext eventContext)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass6_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.DispatchMessage(Message messageToDispatch, MessageWriter messageWriter)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.ListenForMessages(CancellationToken cancellationToken)
at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)
at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, EventContext eventContext)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass6_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.DispatchMessage(Message messageToDispatch, MessageWriter messageWriter)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.ListenForMessages(CancellationToken cancellationToken)
at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---
2018-09-13 10:45:29.992 [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-13 10:45:30.010 [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-13 10:45:30.010 [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.
The text was updated successfully, but these errors were encountered:
System Details
$PSVersionTable
: 6.1.0-rc.1Issue Description
I am experiencing a problem with Powershell Integrated console crashing when I save a file that is known to not have the proper formatting.
How to reproduce:
"powershell.codeFormatting.openBraceOnSameLine": false,
in vscode user setting"editor.formatOnSave": true, "files.trimTrailingWhitespace": true,
as wellCommand + S
Attached Logs
The text was updated successfully, but these errors were encountered: