add python and rust to lsp

This commit is contained in:
serxoz 2022-08-02 18:37:31 +02:00
parent 3365e5139b
commit 9a52377e2d
4 changed files with 15 additions and 2 deletions

View File

@ -6,5 +6,9 @@ In order to install nvchad pluggins and custom ones you must follow:
- <ESC>:q - <ESC>:q
- exec nvim - exec nvim
- <ESC>:PackerSync - <ESC>:PackerSync
- <ESC>:q - <ESC>:MasonInstallAll
- now it must work fine - now it must work fine
## Add language to LSP
- Add lang server in "custom/plugins/lspconfig.lua" file.
- Add lang server to Mason custom override in "custom/override.lua" to install with ":MasonInstallAll"

View File

@ -5,6 +5,7 @@ local override = require "custom.override"
M.plugins = { M.plugins = {
override = { override = {
["nvim-treesitter/nvim-treesitter"] = override.treesitter, ["nvim-treesitter/nvim-treesitter"] = override.treesitter,
["williamboman/mason.nvim"] = override.mason,
}, },
user = require "custom.plugins", user = require "custom.plugins",
} }

View File

@ -17,4 +17,12 @@ M.treesitter = {
}, },
} }
M.mason = {
ensure_installed = {
"gopls",
"pyright",
"rust-analyzer",
}
}
return M return M

View File

@ -3,7 +3,7 @@ local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig" local lspconfig = require "lspconfig"
local servers = { "html", "cssls", "clangd", "gopls"} local servers = { "html", "cssls", "clangd", "gopls", "pyright", "rust-analyzer"}
for _, lsp in ipairs(servers) do for _, lsp in ipairs(servers) do
lspconfig[lsp].setup { lspconfig[lsp].setup {