summaryrefslogtreecommitdiff
path: root/.config/nvim_old/lua/plugins/rust_analyzer.lua
blob: 914befe3b65bf5f58b7312a571d5263af4f06199 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
-- https://github.com/mrcjkb/rustaceanvim

return {
  {
    'mrcjkb/rustaceanvim',
    version = '^6', -- Recommended
    lazy = false, -- This plugin is already lazy
    config = function ()
      vim.g.rustaceanvim = {
        -- Plugin configuration
        tools = {
        },
        -- LSP configuration
        server = {
          default_settings = {
            -- rust-analyzer language server configuration
            -- https://rust-analyzer.github.io/book/configuration.html
            ['rust-analyzer'] = {
              checkOnSave = true,
              check = {
                enable = true,
                command = "clippy",
                features = "all",
              },
              completion = {
                autoimport = {
                  enable = false;
                }
              },
              files = {
                exclude = {
                  "build-dir/",
                  ".flatpak-builder",
                }
              }
              --settings = {
              --  cargo = { allFeatures = true },
              --  imports = { group = { enable = false } },
              --  completion = { postfix = { enable = false } },
              --  -- https://www.reddit.com/r/rust/comments/1e978l7/comment/led7ibp/
              --  -- checkOnSave = { command = "clippy" },
              --  checkOnSave = { command = false },

              --  diagnostics = { enable = true },
              --  rustfmt = { enable = true },
              --}
            },
          },
        },
        -- DAP configuration
        dap = {
        },
      }
    end
  },
}