Use mason.nvim instead of nvim-lsp-installer

main
Ensar Sarajčić 2022-07-25 12:20:54 +02:00
parent d133c1ca97
commit 7cebbda967
3 changed files with 8 additions and 4 deletions

View File

@ -77,7 +77,8 @@ return require("packer").startup({
-- LSP
use("neovim/nvim-lspconfig") -- Easy LSP Config
use("williamboman/nvim-lsp-installer") -- Easy LSP install
use("williamboman/mason.nvim") -- Easy tool install
use("williamboman/mason-lspconfig.nvim") -- Lspconfig support for mason
use("hrsh7th/cmp-nvim-lsp") -- LSP source for cmp
use("hrsh7th/cmp-buffer") -- Buffer source for nvim-cmp
use("hrsh7th/cmp-path") -- Path source for nvim-cmp

View File

@ -23,12 +23,14 @@ local function is_in_config_home(bufname)
end
function M.setup()
local _, installed_jdtls = require("nvim-lsp-installer.servers").get_server("jdtls")
local installed_jdtls = {
settings = require("mason-registry.jdtls"):get_lsp_settings_schema():or_else({ properties = {} }).properties,
}
require("jdtls").setup_dap({ hotcoredeplace = "auto" })
require("jdtls.setup").add_commands()
local config = vim.tbl_extend("force", installed_jdtls["_default_options"], {
local config = vim.tbl_extend("force", installed_jdtls, {
flags = {
allow_incremental_sync = true,
},

View File

@ -3,7 +3,8 @@
-------------------------------------------------------------------------------
local lspconfig = require("lspconfig")
require("nvim-lsp-installer").setup({})
require("mason").setup()
require("mason-lspconfig").setup()
local common_config = require("esensar.lsp.server_config")
-- Language specific LSP config overrides