SeeminglyScience / EditorServicesCommandSuite

Collection of editor commands for use in PowerShell Editor Services.
Other
151 stars 13 forks source link

Splatting command broken due to Omnisharp? #54

Closed bergmeister closed 4 years ago

bergmeister commented 4 years ago

Using EditorServicesCommandSuite 1.0.0-beta1 with PowerShell 7.1-preview, and RTM version of VS-Code and the Powershell extension, Placing the cursor on a line like e.g. $runtime = Get-AzDataFactoryV2IntegrationRuntime -DataFactoryName (Get-AzDataFactoryV2 -ResourceGroupName $resourceGroupName).DataFactoryName -ResourceGroupName $resourceGroupName Then importing the editor suite as:

Import-Module EditorServicesCommandSuite
Import-EditorCommand -Module EditorServicesCommandSuite

Then having the cursor at the end of the line that I want to splat and select the editor command to splat (any of the 3 options). It fails with this error:

Line |
 337 |        $__cmdletization_objectModelWrapper.ProcessRecord($__cmdletizat …
     |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "ProcessRecord" with "1" argument(s): "Method not found: 'Void OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentEdit.set_Edits(OmniSharp.Extensions.LanguageniSharp.Extensions.LanguageServer.Protocol.Models.Container`1<OmniSharp.Extensions.LanguageServer.Protocol.Models.TextEdit>)'."
ParentContainsErrorRecordException:

Somehow the Omnisharp extension seems to have its fingers in it

SeeminglyScience commented 4 years ago

Yeah both PSES and this module use omnisharp's LSP library. That lib had a binary breaking change recently (see OmniSharp/csharp-language-server-protocol#231) which is causing this error.

I just need to recompile and throw up another release. Aiming to get it out today or tomorrow. Thanks for reporting!

bergmeister commented 4 years ago

Awesome, thanks for the support. Unfortunately, it seems every time I have a splatting job and try to use your editor suite, someone has broken you :-( Maybe if you could mention the version of the PS extension and Omisharp, I could pin them in a VSOnline server.

SeeminglyScience commented 4 years ago

Yeah it's been a rough go here lately. Most of that was PSES completely changing it's architecture every couple week or so though 😉

Should be mostly stable these days, with this particular issue being a very unfortunately timed one off.

Maybe if you could mention the version of the PS extension and Omisharp, I could pin them in a VSOnline server.

Ah good idea. vscode-powershell v2020.3.0 (the previous stable as of today) is the last stable that works with ESCS preview1

Jawz84 commented 4 years ago

Great work @bergmeister and @SeeminglyScience! I came looking if this had already been filed, as I ran into this too today, and I saw it mentioned on Twitter too (https://twitter.com/alexandair/status/1252983807067725825?s=20), but you were already right on it ❤️

SeeminglyScience commented 4 years ago

Fixed with v1.0.0-beta2, thank you to everyone for reporting!

Jawz84 commented 4 years ago

I can confirm the fix of this error. Thanks!

bergmeister commented 4 years ago

@SeeminglyScience Awesome. Thanks, it works again (using PS 7.1) :-)