add debugger support
This commit is contained in:
+14
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user