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
EditorServices Crash - System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
#1521
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.
I am experiencing a problem with... crashing. I was splitting one large file into multiple smaller ones. As in 1 big file had like 5 functions and I was creating new file, renaming it to functionname.ps1, pasting, saving and repeating this until one large file become 1 function per file. Finally last file was renamed to last function name.
Attached Logs
Follow the instructions in the README
about capturing and sending logs.
2018-09-10 14:18:01.513 [VERBOSE] C:\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs: In method 'ReadMessage', line 123:
Received Event 'textDocument/didChange'
2018-09-10 14:18:01.513 [VERBOSE] C:\PowerShellEditorServices\src\PowerShellEditorServices\Workspace\Workspace.cs: In method 'ResolveFilePath', line 378:
Resolved path: c:\Users\pklys\OneDrive - Evotec\Support\GitHub\PSSharedGoods\Public\Add-ToArray.ps1
2018-09-10 14:18:01.518 [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. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
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>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.Tasks.Task.Execute()
--- 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.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
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>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.Tasks.Task.Execute()<---
2018-09-10 14:18:01.518 [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.
The text was updated successfully, but these errors were encountered:
PrzemyslawKlys
changed the title
EditorServices Crash
EditorServices Crash - System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Sep 10, 2018
System Details
$PSVersionTable
:Issue Description
I am experiencing a problem with... crashing. I was splitting one large file into multiple smaller ones. As in 1 big file had like 5 functions and I was creating new file, renaming it to functionname.ps1, pasting, saving and repeating this until one large file become 1 function per file. Finally last file was renamed to last function name.
Attached Logs
Follow the instructions in the README
about capturing and sending logs.
The text was updated successfully, but these errors were encountered: