{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/vscode-powershell/issues/1521","repository_url":"https://api.github.com/repos/PowerShell/vscode-powershell","labels_url":"https://api.github.com/repos/PowerShell/vscode-powershell/issues/1521/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/vscode-powershell/issues/1521/comments","events_url":"https://api.github.com/repos/PowerShell/vscode-powershell/issues/1521/events","html_url":"https://github.com/PowerShell/vscode-powershell/issues/1521","id":358598806,"node_id":"MDU6SXNzdWUzNTg1OTg4MDY=","number":1521,"title":"EditorServices Crash -  System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.","user":{"login":"PrzemyslawKlys","id":15063294,"node_id":"MDQ6VXNlcjE1MDYzMjk0","avatar_url":"https://avatars1.githubusercontent.com/u/15063294?v=4","gravatar_id":"","url":"https://api.github.com/users/PrzemyslawKlys","html_url":"https://github.com/PrzemyslawKlys","followers_url":"https://api.github.com/users/PrzemyslawKlys/followers","following_url":"https://api.github.com/users/PrzemyslawKlys/following{/other_user}","gists_url":"https://api.github.com/users/PrzemyslawKlys/gists{/gist_id}","starred_url":"https://api.github.com/users/PrzemyslawKlys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrzemyslawKlys/subscriptions","organizations_url":"https://api.github.com/users/PrzemyslawKlys/orgs","repos_url":"https://api.github.com/users/PrzemyslawKlys/repos","events_url":"https://api.github.com/users/PrzemyslawKlys/events{/privacy}","received_events_url":"https://api.github.com/users/PrzemyslawKlys/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-10T12:22:49Z","updated_at":"2018-09-10T18:30:56Z","closed_at":"2018-09-10T18:30:56Z","author_association":"NONE","body":"### System Details\r\n\r\n- Operating system name and version: Windows 10 insiders\r\n- VS Code version: 1.27.1\r\n- PowerShell extension version: 1.84\r\n- Output from `$PSVersionTable`:\r\n\r\n```\r\nS C:\\Users\\pklys\\OneDrive - Evotec\\Support\\GitHub\\PSSharedGoods> code -v\r\n1.27.1\r\n5944e81f3c46a3938a82c701f96d7a59b074cfdc\r\nx64\r\nopenssl config failed: error:02001003:system library:fopen:No such process\r\nPS C:\\Users\\pklys\\OneDrive - Evotec\\Support\\GitHub\\PSSharedGoods> $pseditor.EditorServicesVersion\r\nPS C:\\Users\\pklys\\OneDrive - Evotec\\Support\\GitHub\\PSSharedGoods> code --list-extensions --show-versions\r\n[createInstance] extensionManagementService depends on downloadService which is NOT registered.\r\naaron-bond.better-comments@1.2.9\r\nabusaidm.html-snippets@0.2.1\r\nAlanWalk.markdown-toc@1.5.6\r\nalefragnani.Bookmarks@9.0.3\r\nazemoh.one-monokai@0.3.7\r\nban.spellright@2.5.32\r\nbatisteo.vscode-django@0.17.0\r\nbierner.markdown-preview-github-styles@0.1.3\r\ndaiyy.quick-html-previewer@0.3.0\r\nDavidAnson.vscode-markdownlint@0.20.0\r\nDavidWang.ini-for-vscode@0.0.4\r\ndonjayamanne.githistory@0.4.2\r\ndonjayamanne.jupyter@1.1.4\r\ndonjayamanne.python-extension-pack@1.4.0\r\nDotJoshJohnson.xml@2.3.2\r\neamodio.gitlens@8.5.6\r\nemilast.LogFileHighlighter@2.4.1\r\nemmanuelbeziat.vscode-great-icons@2.1.41\r\nEquinusocio.vsc-material-theme@2.4.2\r\nfelixfbecker.php-debug@1.12.5\r\nformulahendry.code-runner@0.9.4\r\ngerane.Theme-dimmed-monokai@0.0.2\r\ngharveymn.nightswitch@1.1.0\r\nGrapeCity.gc-excelviewer@2.1.26\r\nhdg.live-html-previewer@0.3.0\r\nhnw.vscode-auto-open-markdown-preview@0.0.4\r\nHookyQR.beautify@1.4.3\r\nIBM.output-colorizer@0.1.2\r\nikappas.phpcs@1.0.5\r\nionutvmi.reg@0.0.2\r\nJerryHong.autofilename@0.1.3\r\njoaompinto.asciidoctor-vscode@0.15.1\r\njohnpapa.winteriscoming@0.7.1\r\nKelvin.vscode-sshfs@1.9.2\r\nkisstkondoros.vscode-codemetrics@1.17.1\r\nKnisterPeter.vscode-github@0.30.0\r\nmagicstack.MagicPython@1.0.12\r\nmariorodeghiero.vue-theme@1.1.0\r\nmechatroner.rainbow-csv@0.5.0\r\nmkloubert.vs-deploy@14.0.0\r\nmkloubert.vscode-remote-workspace@0.32.1\r\nms-mssql.mssql@1.4.0\r\nms-python.python@2018.8.0\r\nms-vscode.csharp@1.15.2\r\nms-vscode.PowerShell@1.8.4\r\nms-vsliveshare.vsliveshare@0.3.623\r\nms-vsts.team@1.136.0\r\nquicktype.quicktype@12.0.42\r\nredhat.java@0.30.0\r\nrobertohuertasm.vscode-icons@7.26.0\r\nShan.code-settings-sync@3.1.2\r\nstkb.rewrap@1.9.1\r\nstreetsidesoftware.code-spell-checker@1.6.10\r\nstreetsidesoftware.code-spell-checker-polish@1.0.0\r\nTomasHubelbauer.zip-file-system@1.0.0\r\nvangware.dark-plus-material@1.3.2\r\nVisualStudioExptTeam.vscodeintellicode@1.0.3\r\nvscjava.vscode-java-debug@0.12.2\r\nvscjava.vscode-java-pack@0.3.0\r\nvscjava.vscode-java-test@0.8.0\r\nvscjava.vscode-maven@0.10.0\r\nWakaTime.vscode-wakatime@1.2.3\r\nwayou.vscode-todo-highlight@1.0.4\r\nwhizkydee.material-palenight-theme@1.9.3\r\nwholroyd.jinja@0.0.8\r\nxaver.clang-format@1.6.2\r\nyzhang.markdown-all-in-one@1.6.0\r\nzhuangtongfa.Material-theme@2.16.3\r\nZignd.html-css-class-completion@1.11.0\r\nopenssl config failed: error:02001003:system library:fopen:No such process\r\nPS C:\\Users\\pklys\\OneDrive - Evotec\\Support\\GitHub\\PSSharedGoods> $PSVersionTable\r\n\r\nName                           Value\r\n----                           -----\r\nPSVersion                      5.1.17754.1\r\nPSEdition                      Desktop\r\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}\r\nBuildVersion                   10.0.17754.1\r\nCLRVersion                     4.0.30319.42000\r\nWSManStackVersion              3.0\r\nPSRemotingProtocolVersion      2.3\r\nSerializationVersion           1.1.0.1\r\n```\r\n\r\n### Issue Description\r\n\r\nI 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. \r\n \r\n### Attached Logs\r\n\r\nFollow the instructions in the [README](https://github.com/PowerShell/vscode-powershell#reporting-problems)\r\nabout capturing and sending logs.\r\n\r\n```\r\n2018-09-10 14:18:01.513 [VERBOSE] C:\\PowerShellEditorServices\\src\\PowerShellEditorServices.Protocol\\MessageProtocol\\MessageReader.cs: In method 'ReadMessage', line 123:\r\n    Received Event 'textDocument/didChange'\r\n\r\n2018-09-10 14:18:01.513 [VERBOSE] C:\\PowerShellEditorServices\\src\\PowerShellEditorServices\\Workspace\\Workspace.cs: In method 'ResolveFilePath', line 378:\r\n    Resolved path: c:\\Users\\pklys\\OneDrive - Evotec\\Support\\GitHub\\PSSharedGoods\\Public\\Add-ToArray.ps1\r\n\r\n2018-09-10 14:18:01.518 [ERROR] C:\\PowerShellEditorServices\\src\\PowerShellEditorServices.Protocol\\MessageProtocol\\ProtocolEndpoint.cs: In method 'OnListenTaskCompleted', line 391:\r\n    ProtocolEndpoint message loop terminated due to unhandled exception:\r\n    \r\n    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.\r\n    Parameter name: index\r\n       at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)\r\n       at System.Collections.Generic.List`1.get_Item(Int32 index)\r\n       at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)\r\n       at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, EventContext eventContext)\r\n       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass6_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)\r\n       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__7.MoveNext()\r\n    --- End of stack trace from previous location where exception was thrown ---\r\n       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.<ListenForMessages>d__36.MoveNext()\r\n    --- End of stack trace from previous location where exception was thrown ---\r\n       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n       at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger)\r\n       at System.Threading.Tasks.Task.Execute()\r\n       --- End of inner exception stack trace ---\r\n    ---> (Inner Exception #0) System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.\r\n    Parameter name: index\r\n       at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)\r\n       at System.Collections.Generic.List`1.get_Item(Int32 index)\r\n       at Microsoft.PowerShell.EditorServices.ScriptFile.ApplyChange(FileChange fileChange)\r\n       at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidChangeTextDocumentNotification(DidChangeTextDocumentParams textChangeParams, EventContext eventContext)\r\n       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass6_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)\r\n       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__7.MoveNext()\r\n    --- End of stack trace from previous location where exception was thrown ---\r\n       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.<ListenForMessages>d__36.MoveNext()\r\n    --- End of stack trace from previous location where exception was thrown ---\r\n       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n       at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger)\r\n       at System.Threading.Tasks.Task.Execute()<---\r\n    \r\n\r\n2018-09-10 14:18:01.518 [ERROR] C:\\PowerShellEditorServices\\src\\PowerShellEditorServices.Host\\EditorServicesHost.cs: In method 'ProtocolEndpoint_UnhandledException', line 435:\r\n    PowerShell Editor Services is terminating due to an unhandled exception, see previous logs for details.\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/PowerShell/vscode-powershell/issues/comments/420014459","html_url":"https://github.com/PowerShell/vscode-powershell/issues/1521#issuecomment-420014459","issue_url":"https://api.github.com/repos/PowerShell/vscode-powershell/issues/1521","id":420014459,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDAxNDQ1OQ==","user":{"login":"rjmholt","id":7009879,"node_id":"MDQ6VXNlcjcwMDk4Nzk=","avatar_url":"https://avatars1.githubusercontent.com/u/7009879?v=4","gravatar_id":"","url":"https://api.github.com/users/rjmholt","html_url":"https://github.com/rjmholt","followers_url":"https://api.github.com/users/rjmholt/followers","following_url":"https://api.github.com/users/rjmholt/following{/other_user}","gists_url":"https://api.github.com/users/rjmholt/gists{/gist_id}","starred_url":"https://api.github.com/users/rjmholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjmholt/subscriptions","organizations_url":"https://api.github.com/users/rjmholt/orgs","repos_url":"https://api.github.com/users/rjmholt/repos","events_url":"https://api.github.com/users/rjmholt/events{/privacy}","received_events_url":"https://api.github.com/users/rjmholt/received_events","type":"User","site_admin":false},"created_at":"2018-09-10T18:30:56Z","updated_at":"2018-09-10T18:30:56Z","author_association":"COLLABORATOR","body":"Duplicate of https://github.com/PowerShell/PowerShellEditorServices/issues/739"}}
{"actor":{"display_login":"rjmholt"}}