nvim: add rust support
This commit is contained in:
parent
d176f91ffd
commit
d9cebc34f3
@ -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,
|
||||
-- },
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user