Initial Commit
This commit is contained in:
commit
b268e041e9
34 files changed
+1502
No files matched your search
@@ -0,0 +1,101 @@
|
||||
local on_attach = require("nvchad.configs.lspconfig").on_attach
|
||||
local on_init = require("nvchad.configs.lspconfig").on_init
|
||||
local capabilities = require("nvchad.configs.lspconfig").capabilities
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- list of all servers configured.
|
||||
lspconfig.servers = {
|
||||
"ansiblels",
|
||||
"lua_ls",
|
||||
"clangd",
|
||||
-- "gopls",
|
||||
-- "hls",
|
||||
"ols",
|
||||
"pyright",
|
||||
}
|
||||
|
||||
-- list of servers configured with default config.
|
||||
local default_servers = {
|
||||
"ols",
|
||||
"pyright",
|
||||
}
|
||||
|
||||
-- lsps with default config
|
||||
for _, lsp in ipairs(default_servers) do
|
||||
lspconfig[lsp].setup({
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end
|
||||
|
||||
lspconfig.clangd.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentRangeFormattingProvider = false
|
||||
on_attach(client, bufnr)
|
||||
end,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- lspconfig.gopls.setup({
|
||||
-- on_attach = function(client, bufnr)
|
||||
-- client.server_capabilities.documentFormattingProvider = false
|
||||
-- client.server_capabilities.documentRangeFormattingProvider = false
|
||||
-- on_attach(client, bufnr)
|
||||
-- end,
|
||||
-- on_init = on_init,
|
||||
-- capabilities = capabilities,
|
||||
-- cmd = { "gopls" },
|
||||
-- filetypes = { "go", "gomod", "gotmpl", "gowork" },
|
||||
-- root_dir = lspconfig.util.root_pattern("go.work", "go.mod", ".git"),
|
||||
-- settings = {
|
||||
-- gopls = {
|
||||
-- analyses = {
|
||||
-- unusedparams = true,
|
||||
-- },
|
||||
-- completeUnimported = true,
|
||||
-- usePlaceholders = true,
|
||||
-- staticcheck = true,
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
|
||||
-- lspconfig.hls.setup({
|
||||
-- on_attach = function(client, bufnr)
|
||||
-- client.server_capabilities.documentFormattingProvider = false
|
||||
-- client.server_capabilities.documentRangeFormattingProvider = false
|
||||
-- on_attach(client, bufnr)
|
||||
-- end,
|
||||
--
|
||||
-- on_init = on_init,
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
|
||||
lspconfig.lua_ls.setup({
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
enable = false, -- Disable all diagnostics from lua_ls
|
||||
-- globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
vim.fn.expand("$VIMRUNTIME/lua"),
|
||||
vim.fn.expand("$VIMRUNTIME/lua/vim/lsp"),
|
||||
vim.fn.stdpath("data") .. "/lazy/ui/nvchad_types",
|
||||
vim.fn.stdpath("data") .. "/lazy/lazy.nvim/lua/lazy",
|
||||
"${3rd}/love2d/library",
|
||||
},
|
||||
maxPreload = 100000,
|
||||
preloadFileSize = 10000,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user