Improve loading of java specific features (only for java, not always)
This commit is contained in:
parent
63e94c5a3d
commit
dbc7997ee9
@ -66,41 +66,6 @@ return {
|
|||||||
opts.desc = "Restart LSP"
|
opts.desc = "Restart LSP"
|
||||||
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts)
|
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts)
|
||||||
|
|
||||||
-- Keybinds for testing, refactoring, java specific
|
|
||||||
opts.desc = "Java profiling"
|
|
||||||
keymap.set("n", "<leader>jp", ":JavaProfile<CR>", opts)
|
|
||||||
|
|
||||||
opts.desc = "Java Refactor: Extract Variable (create variable from cursor)"
|
|
||||||
keymap.set("n", "<leader>jev", ":JavaExtractVariable<CR>", opts)
|
|
||||||
|
|
||||||
opts.desc = "Java Refactor: Extract Variable all occurrences (create variable from cursor)"
|
|
||||||
keymap.set("n", "<leader>jea", ":JavaExtractVariableAllOccurrence<CR>", opts)
|
|
||||||
|
|
||||||
opts.desc = "Java Refactor: Extract Const (create const from cursor)"
|
|
||||||
keymap.set("n", "<leader>jec", ":JavaExtractConst<CR>", opts)
|
|
||||||
|
|
||||||
opts.desc = "Java Refactor: Extract Method (create method from cursor)"
|
|
||||||
keymap.set("n", "<leader>jev", ":JavaExtractMethod<CR>", opts)
|
|
||||||
|
|
||||||
opts.desc = "Java Refactor: Extract Field (create field from cursor)"
|
|
||||||
keymap.set("n", "<leader>jev", ":JavaExtractField<CR>", opts)
|
|
||||||
|
|
||||||
-- Java testing, Debugging
|
|
||||||
opts.desc = "Java Testing: Run test class in buffer"
|
|
||||||
keymap.set("n", "<leader>jtc", ":JavaTestRunCurrentClass<CR>", opts)
|
|
||||||
|
|
||||||
opts.desc = "Java Testing: Debug test class in buffer"
|
|
||||||
keymap.set("n", "<leader>jdc", ":JavaTestDebugCurrentClass<CR>", opts)
|
|
||||||
|
|
||||||
opts.desc = "Java Testing: Run current method in buffer"
|
|
||||||
keymap.set("n", "<leader>jtm", ":JavaTestRunCurrentMethod<CR>", opts)
|
|
||||||
|
|
||||||
opts.desc = "Java Testing: Debug current method in buffer"
|
|
||||||
keymap.set("n", "<leader>jdm", ":JavaTestDebugCurrentMethod<CR>", opts)
|
|
||||||
|
|
||||||
opts.desc = "Java Testing: View last report"
|
|
||||||
keymap.set("n", "<leader>jtv", ":JavaTestViewLastReport<CR>", opts)
|
|
||||||
|
|
||||||
vim.opt.signcolumn = "yes" -- reserve space for diagnostics
|
vim.opt.signcolumn = "yes" -- reserve space for diagnostics
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -167,9 +132,47 @@ return {
|
|||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local java_on_attach = function(client, bufnr)
|
||||||
|
opts.buffer = bufnr
|
||||||
|
-- Keybinds for testing, refactoring, java specific
|
||||||
|
opts.desc = "Java profiling"
|
||||||
|
keymap.set("n", "<leader>jp", ":JavaProfile<CR>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Java Refactor: Extract Variable (create variable from cursor)"
|
||||||
|
keymap.set("n", "<leader>jev", ":JavaExtractVariable<CR>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Java Refactor: Extract Variable all occurrences (create variable from cursor)"
|
||||||
|
keymap.set("n", "<leader>jea", ":JavaExtractVariableAllOccurrence<CR>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Java Refactor: Extract Const (create const from cursor)"
|
||||||
|
keymap.set("n", "<leader>jec", ":JavaExtractConst<CR>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Java Refactor: Extract Method (create method from cursor)"
|
||||||
|
keymap.set("n", "<leader>jev", ":JavaExtractMethod<CR>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Java Refactor: Extract Field (create field from cursor)"
|
||||||
|
keymap.set("n", "<leader>jev", ":JavaExtractField<CR>", opts)
|
||||||
|
|
||||||
|
-- Java testing, Debugging
|
||||||
|
opts.desc = "Java Testing: Run test class in buffer"
|
||||||
|
keymap.set("n", "<leader>jtc", ":JavaTestRunCurrentClass<CR>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Java Testing: Debug test class in buffer"
|
||||||
|
keymap.set("n", "<leader>jdc", ":JavaTestDebugCurrentClass<CR>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Java Testing: Run current method in buffer"
|
||||||
|
keymap.set("n", "<leader>jtm", ":JavaTestRunCurrentMethod<CR>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Java Testing: Debug current method in buffer"
|
||||||
|
keymap.set("n", "<leader>jdm", ":JavaTestDebugCurrentMethod<CR>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Java Testing: View last report"
|
||||||
|
keymap.set("n", "<leader>jtv", ":JavaTestViewLastReport<CR>", opts)
|
||||||
|
end
|
||||||
|
|
||||||
lspconfig.jdtls.setup({
|
lspconfig.jdtls.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = java_on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.texlab.setup{
|
lspconfig.texlab.setup{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user