diff options
| -rw-r--r-- | lsp/roslyn_ls.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lsp/roslyn_ls.lua b/lsp/roslyn_ls.lua index 0cc7a7a2..6bc9cad1 100644 --- a/lsp/roslyn_ls.lua +++ b/lsp/roslyn_ls.lua @@ -160,9 +160,14 @@ return { cb(root_dir) end else - local existing_client = vim.lsp.get_clients({ name = 'roslyn_ls' })[1] - if existing_client and existing_client.config.root_dir then - cb(existing_client.config.root_dir) + -- Decompiled code (example: "/tmp/MetadataAsSource/f2bfba/DecompilationMetadataAsSourceFileProvider/d5782a/Console.cs") + local prev_buf = vim.fn.bufnr('#') + local client = vim.lsp.get_clients({ + name = 'roslyn_ls', + bufnr = prev_buf ~= 1 and prev_buf or nil, + })[1] + if client then + cb(client.config.root_dir) end end end, |
