Skip to content
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.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load PowerShellEditorServices with lspconfig (nvim) #1663

Closed
rudesome opened this issue Jan 13, 2022 · 3 comments · Fixed by #1669
Closed

Failed to load PowerShellEditorServices with lspconfig (nvim) #1663

rudesome opened this issue Jan 13, 2022 · 3 comments · Fixed by #1669
Labels

Comments

@rudesome
Copy link

Followed the instructions on: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#powershell_es
I only set the bundle_path, installed powershell from: https://aur.archlinux.org/packages/powershell/ and downloaded and unzipped the latest PowerShellEditorServices (3.1.0) in my home directory.

I get the error:

[START][2022-01-13 10:58:50] LSP logging initiated
[ERROR][2022-01-13 10:58:59] ...lsp/handlers.lua:404    "OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Failed to handle request textDocument/completion 5 - System.ArgumentOutOfRangeException: Value is not between 1 and 0 (Parameter 'lineNumber')\nActual value was 1.\n   at Microsoft.PowerShell.EditorServices.Utility.Validate.IsWithinRange(String parameterName, Int32 valueToCheck, Int32 lowerLimit, Int32 upperLimit) in D:\\a\\1\\s\\src\\PowerShellEditorServices\\Utility\\Validate.cs:line 46\n   at Microsoft.PowerShell.EditorServices.Services.TextDocument.ScriptFile.GetOffsetAtPosition(Int32 lineNumber, Int32 columnNumber) in D:\\a\\1\\s\\src\\PowerShellEditorServices\\Services\\TextDocument\\ScriptFile.cs:line 414\n   at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.GetCompletionsInFileAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber) in D:\\a\\1\\s\\src\\PowerShellEditorServices\\Services\\TextDocument\\Handlers\\CompletionHandler.cs:line 161\n   at Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler.Handle(CompletionParams request, CancellationToken cancellationToken) in D:\\a\\1\\s\\src\\PowerShellEditorServices\\Services\\TextDocument\\Handlers\\CompletionHandler.cs:line 72\n   at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)\n   at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)\n   at MediatR.Pipeline.RequestPreProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)\n   at MediatR.Pipeline.RequestPostProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)\n   at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)\n   at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)\n   at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)\n   at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)\n   at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.<RouteRequest>g__InnerRoute|7_0(IServiceScopeFactory serviceScopeFactory, Request request, TDescriptor descriptor, Object params, CancellationToken token, ILogger logger)\n   at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.RouteRequest(IRequestDescriptor`1 descriptors, Request request, CancellationToken token)\n   at OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker.<>c__DisplayClass10_0.<<RouteRequest>b__5>d.MoveNext() | Method='textDocument/completion' RequestId='5'"
[ERROR][2022-01-13 11:00:14] .../vim/lsp/rpc.lua:420    "rpc"   "pwsh"  "stderr"        "Exception encountered starting EditorServices. Exception logged in D:\\a\\1\\s\\src\\PowerShellEditorServices.Hosting\\Commands\\StartEditorServicesCommand.cs on line 252 in EndProcessing:\nSystem.Threading.ThreadStateException: Thread has not been started.\n   at System.Threading.Thread.Join(Int32 millisecondsTimeout)\n   at System.Threading.Thread.Join()\n   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.TriggerShutdown() in D:\\a\\1\\s\\src\\PowerShellEditorServices\\Services\\PowerShell\\Host\\PsesInternalHost.cs:line 247\n   at Microsoft.PowerShell.EditorServices.Server.PsesLanguageServer.WaitForShutdown() in D:\\a\\1\\s\\src\\PowerShellEditorServices\\Server\\PsesLanguageServer.cs:line 164\n   at Microsoft.PowerShell.EditorServices.Hosting.EditorServicesRunner.CreateEditorServicesAndRunUntilShutdown() in D:\\a\\1\\s\\src\\PowerShellEditorServices.Hosting\\Internal\\EditorServicesRunner.cs:line 188\n   at Microsoft.PowerShell.EditorServices.Commands.StartEditorServicesCommand.EndProcessing() in D:\\a\\1\\s\\src\\PowerShellEditorServices.Hosting\\Commands\\StartEditorServicesCommand.cs:line 247\n"

in lspinfo it show as active/attached:
lsp_powershell_es

full command is:
pwsh -NoLogo -NoProfile -Command ~/PowerShellEditorServices/PowerShellEditorServices/Start-EditorServices.ps1 -BundledModulesPath ~/PowerShellEditorServices -LogPath ~/.cache/nvim/powershell_es.log -SessionDetailsPath ~/.cache/nvim/powershell_es.session.json -FeatureFlags @() -AdditionalModules @() -HostName nvim -HostProfileId 0 -HostVersion 1.0.0 -Stdio -LogLevel Normal

any ideas what this is and how to solve it?

@ghost ghost added the Needs: Triage Maintainer attention needed! label Jan 13, 2022
@StevenBucher98 StevenBucher98 added Issue-Bug A bug to squash. Area-Language Server and removed Needs: Triage Maintainer attention needed! labels Jan 18, 2022
@ghost ghost added the Status: In PR label Jan 19, 2022
@andyleejordan
Copy link
Member

Well that's an off-by-one error to be sure, but I don't know why nothing else has hit it yet.

@andyleejordan
Copy link
Member

FYI @rudesome I've added an end-to-end regression test for Vim with PSES: #1874

@ghost
Copy link

ghost commented Aug 6, 2022

Thank you for your comment, but please note that this issue has been closed for over a week. For better visibility, consider opening a new issue with a link to this instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants