Breaking change : easen up custom lspconfig setup
before we were using variables/fields to setup custom lspconfig but today I realized that we dont even need that, we can just modify default lspconfigs config
This commit is contained in:
parent
2b55f9bb78
commit
26fc9b5a6c
@ -23,11 +23,6 @@ M.plugins = {
|
|||||||
override = {},
|
override = {},
|
||||||
remove = {},
|
remove = {},
|
||||||
user = {},
|
user = {},
|
||||||
options = {
|
|
||||||
lspconfig = {
|
|
||||||
setup_lspconf = "", -- path of lspconfig file
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- check core.mappings for table structure
|
-- check core.mappings for table structure
|
||||||
|
@ -6,10 +6,13 @@ end
|
|||||||
|
|
||||||
require("base46").load_highlight "lsp"
|
require("base46").load_highlight "lsp"
|
||||||
require "nvchad_ui.lsp"
|
require "nvchad_ui.lsp"
|
||||||
|
require "plugins.configs.lsp_installer"
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
local utils = require "core.utils"
|
local utils = require "core.utils"
|
||||||
|
|
||||||
|
-- export on_attach & capabilities for custom lspconfigs
|
||||||
|
|
||||||
M.on_attach = function(client, bufnr)
|
M.on_attach = function(client, bufnr)
|
||||||
local vim_version = vim.version()
|
local vim_version = vim.version()
|
||||||
|
|
||||||
@ -31,9 +34,9 @@ M.on_attach = function(client, bufnr)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
|
||||||
capabilities.textDocument.completion.completionItem = {
|
M.capabilities.textDocument.completion.completionItem = {
|
||||||
documentationFormat = { "markdown", "plaintext" },
|
documentationFormat = { "markdown", "plaintext" },
|
||||||
snippetSupport = true,
|
snippetSupport = true,
|
||||||
preselectSupport = true,
|
preselectSupport = true,
|
||||||
@ -53,7 +56,7 @@ capabilities.textDocument.completion.completionItem = {
|
|||||||
|
|
||||||
lspconfig.sumneko_lua.setup {
|
lspconfig.sumneko_lua.setup {
|
||||||
on_attach = M.on_attach,
|
on_attach = M.on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = M.capabilities,
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
@ -72,11 +75,4 @@ lspconfig.sumneko_lua.setup {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- requires a file containing user's lspconfigs
|
|
||||||
local addlsp_confs = utils.load_config().plugins.options.lspconfig.setup_lspconf
|
|
||||||
|
|
||||||
if #addlsp_confs ~= 0 then
|
|
||||||
require(addlsp_confs).setup_lsp(M.on_attach, capabilities)
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -83,7 +83,6 @@ local plugins = {
|
|||||||
-- lsp stuff
|
-- lsp stuff
|
||||||
|
|
||||||
["williamboman/nvim-lsp-installer"] = {
|
["williamboman/nvim-lsp-installer"] = {
|
||||||
opt = true,
|
|
||||||
cmd = require("core.lazy_load").lsp_cmds,
|
cmd = require("core.lazy_load").lsp_cmds,
|
||||||
setup = function()
|
setup = function()
|
||||||
require("core.lazy_load").on_file_open "nvim-lsp-installer"
|
require("core.lazy_load").on_file_open "nvim-lsp-installer"
|
||||||
@ -94,7 +93,6 @@ local plugins = {
|
|||||||
after = "nvim-lsp-installer",
|
after = "nvim-lsp-installer",
|
||||||
module = "lspconfig",
|
module = "lspconfig",
|
||||||
config = function()
|
config = function()
|
||||||
require "plugins.configs.lsp_installer"
|
|
||||||
require "plugins.configs.lspconfig"
|
require "plugins.configs.lspconfig"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user