diff --git a/lua/devil/lsp/setup.lua b/lua/devil/lsp/setup.lua index 8c15f84..0938252 100644 --- a/lua/devil/lsp/setup.lua +++ b/lua/devil/lsp/setup.lua @@ -1,10 +1,3 @@ -local status, lsp_zero = pcall(require, "lsp-zero") -if not status then - vim.notify("lsp-zero.nvim not found", "error") - return -end - -local lsp = lsp_zero.preset({}) local mason = require("mason") local lspconfig = require("lspconfig") local mason_lspconfig = require("mason-lspconfig") @@ -13,21 +6,6 @@ local util = require("devil.lsp.util") --------------------------------------- Configures ------------------------------------------------ -lsp.on_attach(function(_, bufnr) - lsp.default_keymaps({ buffer = bufnr }) -end) - -lsp_zero.set_server_config({ - capabilities = { - textDocument = { - foldingRange = { - dynamicRegistration = false, - lineFoldingOnly = true, - }, - }, - }, -}) - local function arr_extend(origin_arr, added_arr) for i = #added_arr, 1, -1 do origin_arr[#origin_arr + 1] = added_arr[i] @@ -76,11 +54,18 @@ mason.setup({ }, }) +local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities() +local default_setup = function(server) + lspconfig[server].setup({ + capabilities = lsp_capabilities, + }) +end + mason_lspconfig.setup({ ensure_installed = {}, handlers = { - lsp_zero.default_setup, - jdtls = lsp_zero.noop, + default_setup, + jdtls = function() end, }, }) @@ -130,5 +115,3 @@ require("devil.lsp.ui") require("devil.lsp.attach") util.enable_inlay_hints_autocmd() - -lsp.setup() diff --git a/lua/devil/plugins/languages.lua b/lua/devil/plugins/languages.lua index a0e8c4d..59f3459 100644 --- a/lua/devil/plugins/languages.lua +++ b/lua/devil/plugins/languages.lua @@ -6,29 +6,6 @@ return { -- Quickstart configs for Nvim LSP { "neovim/nvim-lspconfig", proiority = 1000 }, - -- lsp-zero.nvim - -- A starting point to setup some lsp related features in neovim. - { - "VonHeikemen/lsp-zero.nvim", - branch = "v3.x", - dependencies = { - -- LSP Support - { "neovim/nvim-lspconfig" }, -- Required - { -- Optional - "williamboman/mason.nvim", - build = function() - vim.cmd("MasonUpdate") - end, - }, - { "williamboman/mason-lspconfig.nvim" }, -- Optional - - -- Autocompletion - { "hrsh7th/nvim-cmp" }, -- Required - { "hrsh7th/cmp-nvim-lsp" }, -- Required - { "L3MON4D3/LuaSnip" }, -- Required - }, - }, - -- mason.nvim -- Portable package manager for Neovim {