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

[LSP] Failed to handle request textDocument/didChange #1505

Closed
luizribeiro opened this issue May 24, 2019 · 7 comments
Closed

[LSP] Failed to handle request textDocument/didChange #1505

luizribeiro opened this issue May 24, 2019 · 7 comments
Labels

Comments

@luizribeiro
Copy link

I'm getting System.InvalidOperationException: Service not initialized exceptions on the textDocument/didChange request. The same thing happens for the textDocument/didSave request.

The full stack trace looks like:

Failed to handle request textDocument/didChange - System.InvalidOperationException: Service not initialized.
  at OmniSharp.Cake.Services.CakeScriptService.Generate (Cake.Scripting.Abstractions.Models.FileChange fileChange) [0x0000f] in <77588f8cbed248559ee259dbaf27a112>:0 
  at OmniSh
arp.Cake.Services.RequestHandlers.Buffer.UpdateBufferHandler.Handle (OmniSharp.Models.UpdateBuffer.UpdateBufferRequest request) [0x0016f] in <77588f8cbed248559ee259dbaf27a112>:0 
  at OmniSharp.LanguageServerProtocol.Handlers.TextDocumentSyncHandler.Handle (OmniSharp.Extensions.LanguageServer.Protocol.Models.DidSaveTextDocumentParams notification, System.Thread
ing.CancellationToken cancellationToken) [0x000c4] in <64c75d0755f24d1c8d512732bdce880e>:0 
  at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2[TRequest,TResponse].Handle (TRequest request, System.Threading.CancellationToken cancellationToken, OmniSharp.Extensions.Embedded.MediatR.RequestHandlerDelegate`1[TResponse] next) [0x000e1
] in <cdcdd2bceac34772b5fb2962192e6b77>:0 
  at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.RouteNotification (OmniSharp.Extensions.JsonRpc.IHandlerDescriptor descriptor, OmniSharp.Extensions.JsonRpc.Server.Notification notification) [0x0023d] in <cdcdd2bceac34772b5fb2962192e6b77>:0

It's a bit unexpected that this is coming from CakeScriptService. I do not use Cake and the contents of the omnisharp.json file on my project's root are:

{
  "dotnet": {
    "enabled": true,
    "enablePackageRestore": false
  }
}

It looks like CakeScriptService is being used for my .cs files for some reason? If I remove ExportProjectSystem(ProjectSystemNames.CakeProjectSystem) from CakeProjectSystem I can get past this error.

Any idea if this is a problem with my client, with omnisharp's LSP or with my own project?

@filipw filipw added the lsp label Jun 4, 2019
@sebasmonia
Copy link

@luizribeiro how do you remove CakeScriptService and does it make the didChange return something meaningful?

Sorry not familiar with Cake at all.

@bjorkstromm
Copy link
Member

@luizribeiro what client are you using? I'm currently unable to reproduce with VSCode when running OmniSharp-Roslyn on LSP mode.

@bjorkstromm
Copy link
Member

This was caused by an issue in the LSP libs here OmniSharp/csharp-language-server-protocol#156 will be fixed via #1562

@luizribeiro
Copy link
Author

Sorry for the delayed reply here.

I am using ale on vim. I have been working on an ale linter that will use omnisharp-roslyn.

All I did to disable CakeScriptService was comment out ExportProjectSystem like I mentioned above.

@mholo65, I believe you are correct here. I will try again once #1562 is merged.

@sebasmonia
Copy link

Followed the step to disable CakeScriptService, and I see no exception. But don't get completion either.

@sebasmonia
Copy link

This can be closed after the latest release.

@bjorkstromm
Copy link
Member

Fixed by #1562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants