diff options
| author | Matthew Wilding <mbwilding@gmail.com> | 2025-12-24 00:33:14 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-23 11:33:14 -0500 |
| commit | 8973916a3d015d65a8c4614e141f4270a713cf33 (patch) | |
| tree | 0c41ca527c45e2b54a8e9e0f0505c7c3ce824d62 /lsp | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-8973916a3d015d65a8c4614e141f4270a713cf33.tar nvim-lspconfig-8973916a3d015d65a8c4614e141f4270a713cf33.tar.gz nvim-lspconfig-8973916a3d015d65a8c4614e141f4270a713cf33.tar.bz2 nvim-lspconfig-8973916a3d015d65a8c4614e141f4270a713cf33.tar.lz nvim-lspconfig-8973916a3d015d65a8c4614e141f4270a713cf33.tar.xz nvim-lspconfig-8973916a3d015d65a8c4614e141f4270a713cf33.tar.zst nvim-lspconfig-8973916a3d015d65a8c4614e141f4270a713cf33.zip | |
fix(roslyn_ls): guess root_dir for decompiled code #4257
Try to guess the root_dir by getting the lsp client from the previous buffer.
Diffstat (limited to 'lsp')
| -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, |
