1
0
Fork 0

nvim: add rust support

This commit is contained in:
tastytea 2023-08-06 18:07:36 +02:00
parent d176f91ffd
commit d9cebc34f3
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 23 additions and 2 deletions

View File

@ -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,
-- },
}
}
},
})

View File

@ -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()