From de58407231965248eed21014aa83e7c356d90b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Fri, 24 Jan 2025 10:45:00 +0100 Subject: [PATCH] Update nvim lsp settings --- .../nvim/lua/esensar/lsp/diagnostic.lua | 4 ++-- .../config/nvim/lua/esensar/lsp/servers.lua | 22 ++++++++----------- symlinks/config/nvim/plugin/snippets.lua | 2 +- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/symlinks/config/nvim/lua/esensar/lsp/diagnostic.lua b/symlinks/config/nvim/lua/esensar/lsp/diagnostic.lua index afb13da..02f5897 100644 --- a/symlinks/config/nvim/lua/esensar/lsp/diagnostic.lua +++ b/symlinks/config/nvim/lua/esensar/lsp/diagnostic.lua @@ -56,8 +56,8 @@ require("lint").linters_by_ft = { python = { "flake8" }, kotlin = { "ktlint" }, clojure = { "clj_kondo" }, - c = { "clang_check" }, - cpp = { "clang_check" }, + c = { "clangtidy" }, + cpp = { "clangtidy" }, lua = { "luacheck" }, gdscript = { "gdlint" }, } diff --git a/symlinks/config/nvim/lua/esensar/lsp/servers.lua b/symlinks/config/nvim/lua/esensar/lsp/servers.lua index ddee006..98f6f0f 100644 --- a/symlinks/config/nvim/lua/esensar/lsp/servers.lua +++ b/symlinks/config/nvim/lua/esensar/lsp/servers.lua @@ -17,6 +17,7 @@ require("mason-lspconfig").setup() local common_config = require("esensar.lsp.server_config") -- Language specific LSP config overrides +local zig_loc = vim.api.nvim_exec2("!mise where zig", { output = true }).output local configuration_overrides = { gdscript = { 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 @@ -86,18 +93,8 @@ require("flutter-tools").setup({ }) -- Rust tools -vim.g.rustaceanvim = { +vim.g.rustaceanvim = vim.tbl_deep_extend("force", vim.g.rustaceanvim or {}, { 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) common_config.on_attach(client, bufnr) end, @@ -117,13 +114,12 @@ vim.g.rustaceanvim = { enable = false, }, cargo = { - loadOutDirsFromCheck = true, features = "all", }, }, }, }), -} +}) require("crates").setup({ lsp = { diff --git a/symlinks/config/nvim/plugin/snippets.lua b/symlinks/config/nvim/plugin/snippets.lua index 6eafc00..f190cca 100644 --- a/symlinks/config/nvim/plugin/snippets.lua +++ b/symlinks/config/nvim/plugin/snippets.lua @@ -160,7 +160,7 @@ require("luasnip").filetype_extend("java", { "javadoc", "java-tests" }) luasnip.add_snippets("rust", { s("tests", { - t({ "#[cfg(test)]", "mod tests {", " use super:*;", " " }), + t({ "#[cfg(test)]", "mod tests {", " use super::*;", " " }), i(0), t({ "", "}" }), }),