From 8c82f7cab48c8a3df6bcd43d628e4efe46fce979 Mon Sep 17 00:00:00 2001 From: Fabian Schmidt Date: Wed, 17 Jan 2024 15:10:36 +0100 Subject: [PATCH] replace rust-tools with rustaceanvim --- lazy-lock.json | 24 ++++++++--------- lua/plugins/lsp.lua | 64 +++++++++++++++++++++++++++++---------------- 2 files changed, 54 insertions(+), 34 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 3732de1..eb4a7c7 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -9,27 +9,27 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "dashboard-nvim": { "branch": "master", "commit": "63df28409d940f9cac0a925df09d3dc369db9841" }, - "fidget.nvim": { "branch": "main", "commit": "a4a7edfea37e557dbff5509ee374ffb57051bba9" }, - "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, + "fidget.nvim": { "branch": "main", "commit": "3a93300c076109d86c7ce35ec67a8034ae6ba9db" }, + "gitsigns.nvim": { "branch": "main", "commit": "4aaacbf5e5e2218fd05eb75703fe9e0f85335803" }, "kanagawa.nvim": { "branch": "master", "commit": "c19b9023842697ec92caf72cd3599f7dd7be4456" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, - "lspkind-nvim": { "branch": "master", "commit": "7f26cf5e27e2bd910ce0ea00c514da2bf97423b8" }, + "lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, "lunar.nvim": { "branch": "master", "commit": "08bbc93b96ad698d22fc2aa01805786bcedc34b9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" }, - "mason.nvim": { "branch": "main", "commit": "a09da6ac634926a299dd439da08bdb547a8ca011" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "3ba1b92b771f33256b4969d696b82c8ae7075364" }, + "mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" }, "nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" }, "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, - "nvim-dap": { "branch": "master", "commit": "f0dca670fa059eb89dda8869a6310c804241345c" }, - "nvim-dap-ui": { "branch": "master", "commit": "947660daced01c3eb673e3dc9527c988e42fe4cc" }, + "nvim-dap": { "branch": "master", "commit": "9adbfdca13afbe646d09a8d7a86d5d031fb9c5a5" }, + "nvim-dap-ui": { "branch": "master", "commit": "a6beb3a855b42faa1d0fee1081602257719c2c5e" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "d4542ac257d3c7ee4131350db6179ae6340ce40b" }, - "nvim-lspconfig": { "branch": "master", "commit": "ce0e625df61be77abe1340fbc9afe9ad39b31dd8" }, - "nvim-tree.lua": { "branch": "master", "commit": "f1b3e6a7eb92da492bd693257367d9256839ed3d" }, - "nvim-treesitter": { "branch": "master", "commit": "0da349ed303bea955942f409d29059cdb89dbe2c" }, - "nvim-web-devicons": { "branch": "master", "commit": "3e24abe1ae66532135cec911562f553fe247cb56" }, + "nvim-lspconfig": { "branch": "master", "commit": "7eed8b2150192e5ad05e1886fdf133493ddf2928" }, + "nvim-tree.lua": { "branch": "master", "commit": "f24afa2cef551122b8bd53bb2e4a7df42343ce2e" }, + "nvim-treesitter": { "branch": "master", "commit": "07c8c3d84f67b1530f636dcad31971f569a3df5f" }, + "nvim-web-devicons": { "branch": "master", "commit": "140edfcf25093e8b321d13e154cbce89ee868ca0" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, - "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, + "rustaceanvim": { "branch": "master", "commit": "819ae2d889cca667e7410341c48955043be100a0" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "vimwiki": { "branch": "dev", "commit": "0bb1b4945bb205a076a35b66174e5d66be8eaafe" } } \ No newline at end of file diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 5757553..633f1d7 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -8,6 +8,8 @@ local lsp_attach = function(client, buf) vim.api.nvim_buf_set_option(buf, "omnifunc", "v:lua.vim.lsp.omnifunc") vim.api.nvim_buf_set_option(buf, "tagfunc", "v:lua.vim.lsp.tagfunc") + vim.lsp.inlay_hint.enable(buf, true) + local bufopts = { noremap = true, silent = true, buffer = buf } vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) @@ -78,27 +80,6 @@ return { -- capabilities = capabilities, -- on_attach = lsp_attach --} - require("rust-tools").setup({ - server = { - capabilities = capabilities, - on_attach = lsp_attach, - standalone = false, - settings = { - ["rust-analyzer"] = { - rustfmt = { - extraArgs = { "+nightly" }, - }, - cargo = { - features = {} - } - } - } - }, - dap = { - adapter = require('rust-tools.dap').get_codelldb_adapter( - codelldb_path, liblldb_path) - } - }) lspconfig.bashls.setup { capabilities = capabilities, on_attach = lsp_attach @@ -130,7 +111,46 @@ return { }) end }, - { 'simrat39/rust-tools.nvim' }, + { + 'mrcjkb/rustaceanvim', + version = "^3", + ft = { "rust" }, + config = function() + vim.g.rustaceanvim = { + server = { + on_attach = lsp_attach, + settings = { + -- rust-analyzer language server configuration + ["rust-analyzer"] = { + rustfmt = { + extraArgs = { "+nightly" }, + }, + cargo = { + allFeatures = true, + loadOutDirsFromCheck = true, + runBuildScripts = true, + }, + -- Add clippy lints for Rust. + checkOnSave = { + allFeatures = true, + command = "clippy", + extraArgs = { "--no-deps" }, + }, + -- TODO this breaks diagnostics, look into what can be done + -- procMacro = { + -- enable = true, + -- ignored = { + -- ["async-trait"] = { "async_trait" }, + -- ["napi-derive"] = { "napi" }, + -- ["async-recursion"] = { "async_recursion" }, + -- }, + -- }, + }, + }, + } + } + end + }, { 'onsails/lspkind-nvim' }, -- pictograms replace (?) with lspsaga { 'j-hui/fidget.nvim',