refactor(nvim): improve nvim-java setup
Some checks failed
Check Formatting of Files / Check-Formatting (push) Failing after 1m5s

This commit is contained in:
Price Hiller 2024-06-12 04:03:43 -05:00
parent 878642d009
commit 6f16a07a4e
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB

View File

@ -152,9 +152,6 @@ return {
"Decodetalkers/csharpls-extended-lsp.nvim", "Decodetalkers/csharpls-extended-lsp.nvim",
{ {
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
dependencies = {
"neovim/nvim-lspconfig",
},
opts = { opts = {
automatic_installation = true, automatic_installation = true,
@ -292,20 +289,36 @@ return {
}, },
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
config = function() config = function()
require("java").setup() require("mason-lspconfig").setup({
automatic_installation = true,
ensure_installed = {
"tsserver",
},
handlers = {
["jdtls"] = function()
require("java").setup({
notifications = {
dap = false,
},
})
end,
},
})
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
lspconfig.jdtls.setup({ lspconfig.jdtls.setup({
capabilities = lsp_capabilities, capabilities = lsp_capabilities,
on_attach = on_attach, on_attach = on_attach,
init_options = { -- HACK: Have to define this to make jdtls show hovers, etc.
extendedClientCapabilities = { init_options = {},
-- Have to disable this to make jdtls actually show hovers lol
clientHoverProvider = false,
},
},
settings = { settings = {
java = { java = {
completion = {
postfix = {
enabled = true,
},
},
inlayHints = { inlayHints = {
parameterNames = { parameterNames = {
enabled = "all", enabled = "all",