From 005ea997badc2cd9d0f01939f754386a99be6e84 Mon Sep 17 00:00:00 2001 From: Amanda Graven Date: Thu, 22 Feb 2024 20:51:05 +0100 Subject: [PATCH] Add rustaceanvim --- init.lua | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 56cd268..0c0855f 100644 --- a/init.lua +++ b/init.lua @@ -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},