Merge branch 'dev' into thesis
nvim: fix lsp installation dir variable fix lspconfig require formatting format lsp server list add rust_analyzer LSP
This commit is contained in:
commit
6547dfe599
@ -6,8 +6,7 @@
|
|||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local lsp_root_path = vim.fn.stdpath("data") .. "/lsp_servers/"
|
local clangd_binary = _G.lsp_root_dir .. "clangd/clangd/bin/clangd"
|
||||||
local clangd_binary = lsp_root_path .. "clangd/clangd/bin/clangd"
|
|
||||||
|
|
||||||
M.setup = function(opts)
|
M.setup = function(opts)
|
||||||
opts.settings = {
|
opts.settings = {
|
||||||
|
@ -58,7 +58,12 @@ end
|
|||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||||
|
|
||||||
local servers = { "clangd", "sumneko_lua", "texlab" }
|
local servers = {
|
||||||
|
"clangd",
|
||||||
|
"rust_analyzer",
|
||||||
|
"sumneko_lua",
|
||||||
|
"texlab",
|
||||||
|
}
|
||||||
|
|
||||||
mason.setup({
|
mason.setup({
|
||||||
ui = {
|
ui = {
|
||||||
@ -70,6 +75,8 @@ mason.setup({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
_G.lsp_root_dir = vim.fn.stdpath("data") .. "/mason/bin"
|
||||||
|
|
||||||
mason_lspconfig.setup({
|
mason_lspconfig.setup({
|
||||||
ensure_installed = servers,
|
ensure_installed = servers,
|
||||||
})
|
})
|
||||||
@ -81,7 +88,7 @@ for _, server in ipairs(servers) do
|
|||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
|
|
||||||
local plugin = string.format("%s.%s", "plugin.lsp", server)
|
local plugin = string.format("plugin.lsp.%s", server)
|
||||||
require(plugin).setup(opts)
|
require(plugin).setup(opts)
|
||||||
|
|
||||||
lspconfig[server].setup(opts)
|
lspconfig[server].setup(opts)
|
||||||
|
16
.config/nvim/lua/plugin/lsp/rust_analyzer.lua
Normal file
16
.config/nvim/lua/plugin/lsp/rust_analyzer.lua
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
-- Author : swytch
|
||||||
|
-- Created : Wednesday Nov. 30, 2022 16:35:43 CET
|
||||||
|
-- License : GPLv3
|
||||||
|
-- Description : neovim lsp config file for rust_analyzer
|
||||||
|
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
local rust_analayzer_binary = _G.lsp_root_dir .. "rust_analyzer/rust_analyzer"
|
||||||
|
|
||||||
|
M.setup = function(opts)
|
||||||
|
opts.settings = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
Reference in New Issue
Block a user