diff options
| author | Anirudh <anirudh.sundar@gmail.com> | 2025-04-02 19:12:14 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-02 06:42:14 -0700 |
| commit | c47fffd9660c482a80e6f1b9909ecebfc058203e (patch) | |
| tree | 59e209fdfed94911ef7bc838db87d10a89d39fef /lua/lspconfig | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-c47fffd9660c482a80e6f1b9909ecebfc058203e.tar nvim-lspconfig-c47fffd9660c482a80e6f1b9909ecebfc058203e.tar.gz nvim-lspconfig-c47fffd9660c482a80e6f1b9909ecebfc058203e.tar.bz2 nvim-lspconfig-c47fffd9660c482a80e6f1b9909ecebfc058203e.tar.lz nvim-lspconfig-c47fffd9660c482a80e6f1b9909ecebfc058203e.tar.xz nvim-lspconfig-c47fffd9660c482a80e6f1b9909ecebfc058203e.tar.zst nvim-lspconfig-c47fffd9660c482a80e6f1b9909ecebfc058203e.zip | |
fix(tblgen): find tablegen_compile_commands.yml #3649
The tblgen_lsp_server doesn't seem to load any specific compilation
database server and hence we need to explicitly specify the command-line
argument to pick the correct database path.
Diffstat (limited to 'lua/lspconfig')
| -rw-r--r-- | lua/lspconfig/configs/tblgen_lsp_server.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lua/lspconfig/configs/tblgen_lsp_server.lua b/lua/lspconfig/configs/tblgen_lsp_server.lua index ccb44bb6..ca0713af 100644 --- a/lua/lspconfig/configs/tblgen_lsp_server.lua +++ b/lua/lspconfig/configs/tblgen_lsp_server.lua @@ -1,8 +1,19 @@ local util = require 'lspconfig.util' +local function get_command() + local cmd = { 'tblgen-lsp-server' } + local files = vim.fs.find('tablegen_compile_commands.yml', { path = vim.fn.expand('%:p:h'), upward = true }) + if #files > 0 then + local file = files[1] + table.insert(cmd, '--tablegen-compilation-database=' .. vim.fs.dirname(file) .. '/tablegen_compile_commands.yml') + end + + return cmd +end + return { default_config = { - cmd = { 'tblgen-lsp-server' }, + cmd = get_command(), filetypes = { 'tablegen' }, root_dir = function(fname) return util.root_pattern 'tablegen_compile_commands.yml'(fname) |
