diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-12-24 13:47:09 -0500 |
|---|---|---|
| committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-12-24 13:47:09 -0500 |
| commit | 8a2f89d27e3d96f87185a0805f0c58a6e583c9a8 (patch) | |
| tree | bc007d7cf69ea996edfa4c52b4d4c28205e5ef1f | |
| parent | 468619b642ee40ff233f341199002ce5f3034bb3 (diff) | |
| download | home-8a2f89d27e3d96f87185a0805f0c58a6e583c9a8.tar.gz | |
tblgen_lsp_server: fix compile db detection
| -rw-r--r-- | modules/neovim/nvim/lua/config/lsp/tblgen_lsp_server.lua | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/neovim/nvim/lua/config/lsp/tblgen_lsp_server.lua b/modules/neovim/nvim/lua/config/lsp/tblgen_lsp_server.lua index 536ab79..9e7b650 100644 --- a/modules/neovim/nvim/lua/config/lsp/tblgen_lsp_server.lua +++ b/modules/neovim/nvim/lua/config/lsp/tblgen_lsp_server.lua @@ -1,5 +1,19 @@ +local function get_command() + local cmd = { ((vim.env.LLVM_DIR and (vim.env.LLVM_DIR .. "/bin/")) or "") .. "tblgen-lsp-server" } + local files = vim.fs.find( + { "tablegen_compile_commands.yml", "build/tablegen_compile_commands.yml" }, + { path = vim.fn.expand("%:p:h"), upward = true, type = "file" } + ) + if #files > 0 then + local file = files[1] + table.insert(cmd, "--tablegen-compilation-database=" .. file) + end + + return cmd +end + return { - cmd = { ((vim.env.LLVM_DIR and (vim.env.LLVM_DIR .. "/bin/")) or "") .. "tblgen-lsp-server" }, + cmd = get_command(), filetypes = { 'tablegen' }, - root_markers = { '.git' } + root_markers = { 'tablegen_compile_commands.yml', '.git' } } |