diff --git a/.config/nvim/lua/my/lsp.lua b/.config/nvim/lua/my/lsp.lua index 5aa1a11..c13f078 100644 --- a/.config/nvim/lua/my/lsp.lua +++ b/.config/nvim/lua/my/lsp.lua @@ -113,7 +113,6 @@ local simple_ls = { ['vscode-html-language-server'] = 'html', ['vscode-css-language-server'] = 'cssls', ['vscode-json-language-server'] = 'jsonls', - ['rust-analyzer'] = 'rust_analyzer', ['gopls'] = 'gopls', ['cmake-language-server'] = 'cmake', ['yaml-language-server'] = 'yamlls', @@ -134,7 +133,7 @@ if vim.fn.executable('clangd') > 0 then cmd = { 'clangd', '--compile-commands-dir=build', - '--clang-tidy', -- needs >=clangd-9 + '--clang-tidy', -- needs >=clangd-9 '--ranking-model=decision_forest' -- needs >=clangd-12 }, init_options = { clangdFileStatus = true }, @@ -243,3 +242,21 @@ end require('lsp-format').setup({ sync = true -- seems to be needed to not interfere with Neogit }) + +local rt = require("rust-tools") +rt.setup({ + server = { + on_attach = on_attach, + capabilities = capabilities, + settings = { + ["rust-analyzer"] = { + -- checkOnSave = { + -- command = "clippy", + -- }, + -- diagnostics = { + -- enable = true, + -- }, + } + } + }, +}) diff --git a/.config/nvim/lua/my/plugins.lua b/.config/nvim/lua/my/plugins.lua index 7858829..7aba93a 100644 --- a/.config/nvim/lua/my/plugins.lua +++ b/.config/nvim/lua/my/plugins.lua @@ -105,6 +105,10 @@ require('packer').startup({ } use { 'https://github.com/ray-x/lsp_signature.nvim' } use { 'https://github.com/p00f/clangd_extensions.nvim' } + use { + 'https://github.com/simrat39/rust-tools.nvim', + requires = { 'neovim/nvim-lspconfig' } + } -- tools local nerdfont_installed = require('my.functions').nerdfont_installed()