aboutsummaryrefslogtreecommitdiffstats
path: root/lua/pi/lsp/servers/rust_analyzer.lua
blob: 8999ef8ac76fd66227b8f832c00ae29323e1bd31 (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
local lsp_attach = require "pi.lsp.attach"
local lsp_flags = require "pi.lsp.flags"

return function(ops)
  return vim.tbl_extend("force", {
      on_attach = lsp_attach,
      flags = lsp_flags,
      settings = {
        ["rust-analyzer"] = {
          checkOnSave = {
            allFeatures = true,
            overrideCommand = {
              "cargo",
              "clippy",
              "--workspace",
              "--message-format=json",
              "--all-targets",
              "--all-features",
            },
          },
        },
      },
    }, ops)
end