mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 08:35:48 +02:00
qa: jdtls linux test
This commit is contained in:
parent
54657657a3
commit
94ff8e53a9
3 changed files with 14 additions and 25 deletions
|
@ -62,22 +62,20 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
opts = function(_, opts)
|
opts = function()
|
||||||
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)
|
||||||
vim.list_extend(opts.ensure_installed, servers)
|
return {
|
||||||
vim.list_extend(opts.skip_config, unregis_lsp)
|
ensure_installed = servers,
|
||||||
opts.automatic_installation = true
|
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
|
||||||
|
@ -85,7 +83,7 @@ return {
|
||||||
capabilities.offsetEncoding = { "utf-16" }
|
capabilities.offsetEncoding = { "utf-16" }
|
||||||
end
|
end
|
||||||
local is_skip = false
|
local is_skip = false
|
||||||
local my_index = idxOf(opts.skip_config, server_name)
|
local my_index = idxOf(unregis_lsp, server_name)
|
||||||
if my_index ~= nil then
|
if my_index ~= nil then
|
||||||
is_skip = true
|
is_skip = true
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,15 +17,6 @@ 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 {}
|
|
||||||
if pcode.active_java_config.use_nvim_jdtls or false then
|
|
||||||
vim.list_extend(opts.skip_config, { "jdtls" })
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"mfussenegger/nvim-jdtls",
|
"mfussenegger/nvim-jdtls",
|
||||||
ft = java_filetypes,
|
ft = java_filetypes,
|
||||||
|
|
|
@ -110,11 +110,11 @@ end
|
||||||
-- 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