add debugger support

This commit is contained in:
2026-10-15 11:18:36 -09:00
parent f6115bc048
commit 24392b0e5b
3 changed files with 118 additions and 2 deletions
+14 -1
View File
@@ -126,7 +126,20 @@
(keymap :n "[d" (fn [] (vim.diagnostic.jump {:count -1 :float true})) opts)
(keymap :n "]d" (fn [] (vim.diagnostic.jump {:count 1 :float true})) opts)
(keymap :n "<leader>e" vim.diagnostic.open_float opts)
(keymap :n "<leader>F" vim.lsp.buf.format opts))})
(keymap :n "<leader>F" vim.lsp.buf.format opts)
(let [client (vim.lsp.get_client_by_id ev.data.client_id)]
(when (and client (client.supports_method "textDocument/references"))
(pcall vim.cmd "anoremenu PopUp.Show\\ References <Cmd>lua vim.lsp.buf.references()<CR>"))))})
;; Remove "Show References" from the context menu once no attached client supports it
(autocmd "LspDetach"
{:callback (fn []
(var has-references false)
(each [_ client (ipairs (vim.lsp.get_clients))]
(when (client.supports_method "textDocument/references")
(set has-references true)))
(when (not has-references)
(pcall vim.cmd "aunmenu PopUp.Show\\ References")))})
;; LSP commands (lspconfig-style)
(local usercmd vim.api.nvim_create_user_command)