feat(java): no pattern in LspAttach autocmd

This commit is contained in:
aqav 2023-08-15 11:10:15 +08:00
parent cc3dfa496e
commit 69f5a30af8

View file

@ -110,8 +110,10 @@ return {
-- https://github.com/mfussenegger/nvim-jdtls#nvim-dap-configuration
-- https://neovim.io/doc/user/lsp.html#LspAttach
vim.api.nvim_create_autocmd("LspAttach", {
pattern = "*.java",
callback = function(args)
-- only after the jdtls client is attached
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client.name == "jdtls" then
require("which-key").register({
["<leader>cx"] = { name = "+extract" },
["<leader>cxv"] = { require("jdtls").extract_variable_all, "Extract Variable" },
@ -147,6 +149,7 @@ return {
}, { mode = "n", buffer = args.buf })
end
end
end
end,
})
end,