Skip to content

Commit

Permalink
feat!: Remove lsp-zero.nvim plugin, because it is unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
MysticalDevil committed Nov 12, 2023
1 parent f34d583 commit f0b2233
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 49 deletions.
35 changes: 9 additions & 26 deletions lua/devil/lsp/setup.lua
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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]
Expand Down Expand Up @@ -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,
},
})

Expand Down Expand Up @@ -130,5 +115,3 @@ require("devil.lsp.ui")
require("devil.lsp.attach")

util.enable_inlay_hints_autocmd()

lsp.setup()
23 changes: 0 additions & 23 deletions lua/devil/plugins/languages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit f0b2233

Please sign in to comment.