Closed JustBarnt closed 4 weeks ago
@Saghen I really appreciate the quick turn around, but the LSP is still crashing with the same error.
I included some information I probably should have included to begin with so my apologies.
rustup default
nightly-x86_64-pc-windows-msvc (default)
nvim --version
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info
Blink.cmp setup
{
"saghen/blink.cmp",
lazy = false,
dev = true,
build = "cargo build --release",
---@module "blink.cmp"
---@type blink.cmp.Config
opts = {
sources = {
providers = {
{ "blink.cmp.sources.lsp", name = "LSP" },
{ "blink.cmp.sources.snippets", name = "Snippets", score_offset = -1 },
{
"blink.cmp.sources.path",
name = "Path",
score_offset = 3,
opts = { get_cwd = vim.uv.cwd },
},
{
"blink.cmp.sources.buffer",
name = "Buffer",
keyword_length = 3,
fallback_for = { "LSP" }, -- PENDING https://github.com/Saghen/blink.cmp/issues/122
},
},
},
highlight = { use_nvim_cmp_as_default = true },
fuzzy = {
prebuiltBinaries = {
download = false,
forceVersion = "v0.3.*",
},
},
keymap = {
show = "<C-space>",
hide = "<C-e>",
accept = "<C-y>",
select_prev = { "<C-j>" },
select_next = { "<C-k>" },
show_documentation = "<C-space>",
hide_documentation = "<C-space>",
scroll_documentation_up = "<Up>",
scroll_documentation_down = "<Down>",
snippet_forward = "<Tab>",
snippet_backward = "<S-Tab>",
},
nerd_font_variant = "mono",
windows = {
autocomplete = {
border = "none",
highlight = "Normal:CmpPmenu,CursorLine:CmpSel,Search:None,FloatBorder:CmpBorder",
selection = "preselect",
draw = "reversed",
cycle = { from_top = false },
},
documentation = {
border = "none",
winhighlight = "Normal:CmpDoc,FloatBorder:CmpDocBorder",
auto_show = true,
auto_show_delay_ms = 250,
},
},
},
}
[ERROR][2024-10-21 09:22:51] ...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 38
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"
There must be a ghost in my system, the crash disappeared and reappeared again :smile: Latest commit should fix it
@Saghen Hmmm. It still keeps crashing for me. Are you using Windows or Unix? I can't think of a reason why it would make a difference
I'm gonna grab a fresh clone of kickstart real quick as well. I wonder if there is something in LazyVim's distro as well that could be causing an issue
NixOS with roslyn-ls
package on version 4.12.0-3.24470.4
@Saghen Hmm. Okay gotcha. Then there may be an OS issue there which would intrigue me, or what I'm hoping the issue is- Is it is related to LazyVim since I know folke does some wizarding magic in his Distro. I'll get back after I've tried this in kickstart. Hopefully with good news saying its something in LazyVim and not something related to Windows.
@Saghen I'm back with good news! It appears to definitely be something within LazyVim. Using a kickstart and just moving installing blink and roslyn.nvim it works just fine! So this is definitely fixed on your end! Ill have to do some investigating to see if I can find where it happens in LazyVim and make an issue over there! Thanks for working and fixing this super quick!
My pleasure :) You might want to look into the capabilities sent to the LSP, particularly around itemDefaults
. Perhaps LazyVim changes those. For ref: #13
@Saghen Yea that was my thought. I know folke quite a few overrides for quite a few LSP related items so it wouldn't surprise me. Thanks again!
I am using the Roslyn lsp plugin from https://github.com/seblj/roslyn.nvim
And once the completion window comes up for
blink.cmp
it immediately crashes the lsp with the following error message.I have confirmed this doesn't happen within the
nvim-cmp
plugin.There may be an issue with how
blink.cmp
sends a completion request over.