Setup LSP for java, python

* pyright
* nvim-java repo
This commit is contained in:
Le Viet Dat 2024-05-14 17:29:36 +07:00
parent 037c895f51
commit 947d81189d
1 changed files with 42 additions and 1 deletions

View File

@ -170,6 +170,47 @@ require('lazy').setup({
}, },
}, },
{
'nvim-java/nvim-java',
dependencies = {
'nvim-java/lua-async-await',
'nvim-java/nvim-java-refactor',
'nvim-java/nvim-java-core',
'nvim-java/nvim-java-test',
'nvim-java/nvim-java-dap',
'MunifTanjim/nui.nvim',
'neovim/nvim-lspconfig',
'mfussenegger/nvim-dap',
{
'williamboman/mason.nvim',
opts = {
registries = {
'github:nvim-java/mason-registry',
'github:mason-org/mason-registry',
},
},
},
},
config = function()
require('java').setup {}
require('lspconfig').jdtls.setup {
settings = {
java = {
configuration = {
runtimes = {
{
name = 'OpenJDK-Temurin-17',
path = '/opt/jdk-17.0.11+9',
default = true,
},
},
},
},
},
}
end,
},
-- NOTE: Plugins can also be configured to run Lua code when they are loaded. -- NOTE: Plugins can also be configured to run Lua code when they are loaded.
-- --
-- This is often very useful to both group configuration, as well as handle -- This is often very useful to both group configuration, as well as handle
@ -473,7 +514,7 @@ require('lazy').setup({
local servers = { local servers = {
-- clangd = {}, -- clangd = {},
-- gopls = {}, -- gopls = {},
-- pyright = {}, pyright = {},
-- rust_analyzer = {}, -- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
-- --