Update nvim lsp settings

main
Ensar Sarajčić 2025-01-24 10:45:00 +01:00
parent 0a7160878a
commit de58407231
3 changed files with 12 additions and 16 deletions

View File

@ -56,8 +56,8 @@ require("lint").linters_by_ft = {
python = { "flake8" }, python = { "flake8" },
kotlin = { "ktlint" }, kotlin = { "ktlint" },
clojure = { "clj_kondo" }, clojure = { "clj_kondo" },
c = { "clang_check" }, c = { "clangtidy" },
cpp = { "clang_check" }, cpp = { "clangtidy" },
lua = { "luacheck" }, lua = { "luacheck" },
gdscript = { "gdlint" }, gdscript = { "gdlint" },
} }

View File

@ -17,6 +17,7 @@ require("mason-lspconfig").setup()
local common_config = require("esensar.lsp.server_config") local common_config = require("esensar.lsp.server_config")
-- Language specific LSP config overrides -- Language specific LSP config overrides
local zig_loc = vim.api.nvim_exec2("!mise where zig", { output = true }).output
local configuration_overrides = { local configuration_overrides = {
gdscript = { gdscript = {
flags = { flags = {
@ -44,6 +45,12 @@ local configuration_overrides = {
}, },
}, },
}, },
zls = {
settings = {
zig_exe_path = zig_loc .. "/zig",
zig_lib_path = zig_loc .. "/lib",
},
},
} }
-- Lsp default language servers -- Lsp default language servers
@ -86,18 +93,8 @@ require("flutter-tools").setup({
}) })
-- Rust tools -- Rust tools
vim.g.rustaceanvim = { vim.g.rustaceanvim = vim.tbl_deep_extend("force", vim.g.rustaceanvim or {}, {
server = vim.tbl_extend("force", common_config, { server = vim.tbl_extend("force", common_config, {
capabilities = vim.tbl_extend("force", common_config.capabilities, {
-- TODO wait for nvim-cmp fix
textDocument = {
completion = {
completionItem = {
snippetSupport = false,
},
},
},
}),
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
common_config.on_attach(client, bufnr) common_config.on_attach(client, bufnr)
end, end,
@ -117,13 +114,12 @@ vim.g.rustaceanvim = {
enable = false, enable = false,
}, },
cargo = { cargo = {
loadOutDirsFromCheck = true,
features = "all", features = "all",
}, },
}, },
}, },
}), }),
} })
require("crates").setup({ require("crates").setup({
lsp = { lsp = {

View File

@ -160,7 +160,7 @@ require("luasnip").filetype_extend("java", { "javadoc", "java-tests" })
luasnip.add_snippets("rust", { luasnip.add_snippets("rust", {
s("tests", { s("tests", {
t({ "#[cfg(test)]", "mod tests {", " use super:*;", " " }), t({ "#[cfg(test)]", "mod tests {", " use super::*;", " " }),
i(0), i(0),
t({ "", "}" }), t({ "", "}" }),
}), }),