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

Roslyn Language Server Crashes When Accepting Suggestions from Blink Completion Plugin #62

Closed
Imlimp opened this issue Oct 10, 2024 · 4 comments

Comments

@Imlimp
Copy link

Imlimp commented Oct 10, 2024

Description:

I have been trying to switch from nvim-cmp to blink-cmp but have been experiencing issues with the Roslyn language server (LSP).

I'm encountering a problem where the Roslyn language server stops unexpectedly whenever I accept a suggestion from the Blink completion plugin. Other language servers (LSPs) work fine with Blink, so I'm unsure if the issue lies with Roslyn or Blink.

Initially, everything seems to work, but whenever I accept a suggestion from Blink, I receive the following notification:
Roslyn server stopped

Steps to Reproduce:

  1. Open a project in Neovim using blink-cmp.
  2. Begin typing to trigger auto-completion suggestions from Blink.
  3. Accept one of the suggested completions.

Expected Behavior:

  • The suggested completion should be inserted without any issues.
  • The Roslyn language server should continue running normally.

Actual Behavior:

  • Upon accepting a suggestion, a notification appears stating: Roslyn server stopped.
  • The language server crashes, and I have to restart it to continue working.

Logs

Here is the relevant excerpt from the :LspLog:

[ERROR][2024-10-10 09:41:16] ...lsp/handlers.lua:624 "[LanguageServerHost] System.InvalidOperationException: Unexpected null - file CompletionResolveHandler.cs line 92
   at Roslyn.Utilities.Contract.Fail(String message, Int32 lineNumber, String filePath) in /_/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.cs:line 157
   at Microsoft.CodeAnalysis.LanguageServer.Handler.CompletionResolveHandler.GetTextDocumentCacheEntry(CompletionItem request) in /_/src/LanguageServer/Protocol/Handler/Completion/CompletionResolveHandler.cs:line 92
   at Microsoft.CodeAnalysis.LanguageServer.Handler.RequestContextFactory.CreateRequestContextAsync[TRequestParam](IQueueItem`1 queueItem, IMethodHandler methodHandler, TRequestParam requestParam, CancellationToken cancellationToken) in /_/src/LanguageServer/Protocol/Handler/RequestContextFactory.cs:line 24
   at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem`1.CreateRequestContextAsync[TRequest](IMethodHandler handler, RequestHandlerMetadata requestHandlerMetadata, AbstractLanguageServer`1 languageServer, CancellationToken cancellationToken)
   at Microsoft.CommonLanguageServerProtocol.Framework.RequestExecutionQueue`1.ProcessQueueCoreAsync[TRequest,TResponse](IQueueItem`1 work, IMethodHandler handler, RequestHandlerMetadata metadata, ConcurrentDictionary`2 concurrentlyExecutingTasks, CancellationTokenSource currentWorkCts, CancellationToken cancellationToken) in /_/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/RequestExecutionQueue.cs:line 319
   at Microsoft.CommonLanguageServerProtocol.Framework.RequestExecutionQueue`1.InvokeProcessCoreAsync(IQueueItem`1 work, RequestHandlerMetadata metadata, IMethodHandler handler, MethodInfo methodInfo, ConcurrentDictionary`2 concurrentlyExecutingTasks, CancellationTokenSource currentWorkCts, CancellationToken cancellationToken) in /_/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/RequestExecutionQueue.cs:line 302
   at Microsoft.CommonLanguageServerProtocol.Framework.RequestExecutionQueue`1.ProcessQueueAsync() in /_/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/RequestExecutionQueue.cs:line 254"

Additional Information:

  • The issue does not occur when using other language servers with Blink.
  • Disabling Blink or switching back to nvim-cmp eliminates the issue, suggesting an interaction problem between Roslyn and Blink.
  • I've tried reinstalling both the Roslyn language server and the Blink completion plugin, but the problem persists.
@seblj
Copy link
Owner

seblj commented Oct 10, 2024

This is most definitely a server issue or blink-cmp issue. We can leave the issue open though, and I can see when I get some time to look a bit into this. There was something similar previously with nvim-cmp and built in completion, and that seemed to be a server issue that was "somewhat" fixed

@seblj
Copy link
Owner

seblj commented Oct 13, 2024

I tried to install blink myself, and I actually got an error immediately when starting to type. I tried to look a bit into it, but I have no idea why it is failing🤷‍♂️

However, I think it is best to try and open an issue over at blink to see if they understand what the problem might be. It shouldn't be something in this plugin at least since it seems to work perfectly with both nvim-cmp and the builtin lsp completion added in neovim nightly.

I am fine with leaving this open in case anyone else that is looking to switch to blink stumbles upon the same issue. Unfortunately, I personally will probably not spend much more time debugging this issue for now

@adriankarlen
Copy link

This issue is resolved in the latest release v0.4, so I am guessing this can be closed now :)

Blink issue for reference Saghen/blink.cmp#158

@seblj
Copy link
Owner

seblj commented Oct 24, 2024

Thanks for the update! Will close this now then :)

@seblj seblj closed this as completed Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants