mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 00:25:47 +02:00
add: disable jdtls if nvim-jdtls active
This commit is contained in:
parent
524bfc707b
commit
e009cbb877
4 changed files with 25 additions and 16 deletions
|
@ -56,7 +56,7 @@
|
||||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "12b1a1e095d968887a17ef791c2edb78d7595d46" },
|
"rainbow-delimiters.nvim": { "branch": "master", "commit": "12b1a1e095d968887a17ef791c2edb78d7595d46" },
|
||||||
"rest.nvim": { "branch": "main", "commit": "91badd46c60df6bd9800c809056af2d80d33da4c" },
|
"rest.nvim": { "branch": "main", "commit": "91badd46c60df6bd9800c809056af2d80d33da4c" },
|
||||||
"smart-splits.nvim": { "branch": "master", "commit": "66fda3a601a5b4c679656f15eb6ddd613c8d3216" },
|
"smart-splits.nvim": { "branch": "master", "commit": "66fda3a601a5b4c679656f15eb6ddd613c8d3216" },
|
||||||
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
|
"symbols-outline.nvim": { "branch": "master", "commit": "964c5902243446124417a3a9e9454f5ef032cc36" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "7bd2f9b72f8449780b79bcf351534e2cd36ec43a" },
|
"telescope.nvim": { "branch": "master", "commit": "7bd2f9b72f8449780b79bcf351534e2cd36ec43a" },
|
||||||
"tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "9be4af5b1bc1f26a11206ed7ce8bf44312e7941a" },
|
"tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "9be4af5b1bc1f26a11206ed7ce8bf44312e7941a" },
|
||||||
"toggleterm.nvim": { "branch": "main", "commit": "cd55bf6aab3f88c259fa29ea86bbdcb1a325687d" },
|
"toggleterm.nvim": { "branch": "main", "commit": "cd55bf6aab3f88c259fa29ea86bbdcb1a325687d" },
|
||||||
|
|
|
@ -62,20 +62,22 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
opts = function()
|
opts = function(_, opts)
|
||||||
|
opts.skip_config = opts.skip_config or {}
|
||||||
|
opts.ensure_installed = opts.ensure_installed or {}
|
||||||
local servers = { "lua_ls" }
|
local servers = { "lua_ls" }
|
||||||
local mason_install = pcode.mason_ensure_installed or {}
|
local mason_install = pcode.mason_ensure_installed or {}
|
||||||
|
local unregis_lsp = pcode.unregister_lsp or {}
|
||||||
vim.list_extend(servers, mason_install)
|
vim.list_extend(servers, mason_install)
|
||||||
return {
|
vim.list_extend(opts.ensure_installed, servers)
|
||||||
ensure_installed = servers,
|
vim.list_extend(opts.skip_config, unregis_lsp)
|
||||||
automatic_installation = true,
|
opts.automatic_installation = true
|
||||||
}
|
return opts
|
||||||
end,
|
end,
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("mason-lspconfig").setup(opts)
|
require("mason-lspconfig").setup(opts)
|
||||||
|
|
||||||
local option = {}
|
local option = {}
|
||||||
local unregis_lsp = pcode.unregister_lsp or {}
|
|
||||||
require("mason-lspconfig").setup_handlers({
|
require("mason-lspconfig").setup_handlers({
|
||||||
function(server_name) -- default handler (optional)
|
function(server_name) -- default handler (optional)
|
||||||
local capabilities = require("user.lsp.handlers").capabilities
|
local capabilities = require("user.lsp.handlers").capabilities
|
||||||
|
@ -83,7 +85,7 @@ return {
|
||||||
capabilities.offsetEncoding = { "utf-16" }
|
capabilities.offsetEncoding = { "utf-16" }
|
||||||
end
|
end
|
||||||
local is_skip = false
|
local is_skip = false
|
||||||
local my_index = idxOf(unregis_lsp, server_name)
|
local my_index = idxOf(opts.skip_config, server_name)
|
||||||
if my_index ~= nil then
|
if my_index ~= nil then
|
||||||
is_skip = true
|
is_skip = true
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,6 +17,13 @@ end
|
||||||
|
|
||||||
if pcode.active_java_config.active then
|
if pcode.active_java_config.active then
|
||||||
M = {
|
M = {
|
||||||
|
{
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.skip_config = opts.skip_config or {}
|
||||||
|
vim.list_extend(opts.skip_config, { "jdtls" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"mfussenegger/nvim-jdtls",
|
"mfussenegger/nvim-jdtls",
|
||||||
ft = java_filetypes,
|
ft = java_filetypes,
|
||||||
|
@ -248,7 +255,7 @@ if pcode.active_java_config.active then
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"simrat39/symbols-outline.nvim",
|
"rockerBOO/symbols-outline.nvim",
|
||||||
cmd = "SymbolsOutline",
|
cmd = "SymbolsOutline",
|
||||||
config = function()
|
config = function()
|
||||||
require("symbols-outline").setup({
|
require("symbols-outline").setup({
|
||||||
|
|
|
@ -110,11 +110,11 @@ if pcode.active_cpp_config then
|
||||||
pcode.nvim_dap = true
|
pcode.nvim_dap = true
|
||||||
end
|
end
|
||||||
-- run if java config true
|
-- run if java config true
|
||||||
if pcode.active_java_config.active and pcode.active_java_config.use_nvim_jdtls then
|
-- if pcode.active_java_config.active and pcode.active_java_config.use_nvim_jdtls then
|
||||||
-- table.insert(pcode.treesitter_ensure_installed, "java")
|
-- table.insert(pcode.treesitter_ensure_installed, "java")
|
||||||
-- table.insert(pcode.mason_ensure_installed, "jdtls")
|
-- table.insert(pcode.mason_ensure_installed, "jdtls")
|
||||||
-- table.insert(pcode.null_ls_ensure_installed, "google_java_format")
|
-- table.insert(pcode.null_ls_ensure_installed, "google_java_format")
|
||||||
-- table.insert(pcode.dap_ensure_installed, "javadbg")
|
-- table.insert(pcode.dap_ensure_installed, "javadbg")
|
||||||
table.insert(pcode.unregister_lsp, "jdtls")
|
-- table.insert(pcode.unregister_lsp, "jdtls")
|
||||||
end
|
-- end
|
||||||
return {}
|
return {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue