Add rustaceanvim

This commit is contained in:
Amanda Graven 2024-02-22 20:51:05 +01:00
parent 5eaef52367
commit 005ea997ba

View file

@ -258,7 +258,7 @@ end
-- Bootstrap plugin system
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
@ -518,7 +518,6 @@ require('lazy').setup({
},
})
end},
-- TODO rustacean-vim
{'mfussenegger/nvim-jdtls', dependencies = {'neovim/nvim-lspconfig'}, config = function()
au('FileType', {
pattern = 'java',
@ -578,12 +577,46 @@ require('lazy').setup({
end
})
end},
{'mrcjkb/rustaceanvim', config = function ()
vim.g.rustaceanvim = {
server = {
default_settings = {
['rust-analyzer'] = {
cargo = {
-- Load OUT_DIR when running check on save, needed for proc macros
loadOutDirsFromCheck = true,
},
checkOnSave = true,
-- Error checking settings
check = {
-- Use clippy for error checking
command = "clippy",
-- Also run checks for tests
allTargets = true,
},
diagnostics = {
-- Disable diagnostics with false positives
disabled = {'unresolved-import'},
},
procMacro = {
-- Enable proc macro support
enable = true,
},
rustfmt = {
extraArgs = { '+nightly' }
},
},
}
},
}
end},
{'pmizio/typescript-tools.nvim', opts = {
settings = {
tsserve_file_preferences = {
quotePreference = 'single'
},
tsserver_plugins = (function ()
if fn.has('nvim-0.10') == 0 then return end
if vim.system({'npm', 'list', '-g', '@styled/typescript-styled-plugin'}):wait().code == 0 then
return {'@styled/typescript-styled-plugin'}
else
@ -715,7 +748,7 @@ require('lazy').setup({
executable = {
--command = mason_path('codelldb') .. '/extension/adapter/codelldb',
--args = {'--liblldb', mason_path('codelldb') .. '/extension/lldb/lib/liblldb.so', '--port', '${port}'},
command = 'lldb',
command = 'codelldb',
args = {'--port', '${port}'},
},
}
@ -1074,11 +1107,12 @@ require('lazy').setup({
require'telescope'.load_extension('dap')
require'telescope'.load_extension('undo')
end},
{'nvim-neotest/neotest', dependencies = {'rcasia/neotest-java', 'nvim-neotest/neotest-vim-test'}, config = function()
{'nvim-neotest/neotest', dependencies = {'rcasia/neotest-java', 'nvim-neotest/neotest-vim-test', 'rouge8/neotest-rust'}, config = function()
require'neotest'.setup {
adapters = {
require'neotest-java' {},
require'neotest-vim-test' {},
require'neotest-rust' {},
}
}
end},