-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastrolsp.lua
More file actions
39 lines (39 loc) · 1.17 KB
/
Copy pathastrolsp.lua
File metadata and controls
39 lines (39 loc) · 1.17 KB
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
---@type LazySpec
return {
"AstroNvim/astrolsp",
---@type AstroLSPOpts
opts = {
---@diagnostic disable: missing-fields
config = {
-- python (pyright --> basedpyright)
basedpyright = {
before_init = function(_, c)
local pythonPath = vim.g.python3_host_prog
-- if virtual environment detected
if os.getenv "VIRTUAL_ENV" then pythonPath = vim.fn.exepath "python" end
-- safely set `pythonPath` in the `pyright` settings
if not c.settings then c.settings = {} end
if not c.settings.python then c.settings.python = {} end
c.settings.python.pythonPath = pythonPath
end,
},
-- rust --
rust_analyzer = {
settings = {
["rust-analyzer"] = {
cargo = {
extraEnv = { CARGO_PROFILE_RUST_ANALYZER_INHERITS = 'dev', },
extraArgs = { "--profile", "rust-analyzer", },
},
-- Add clippy lints for Rust
checkOnSave = {
allFeatures = true,
command = "clippy",
extraArgs = { "--no-deps" },
},
},
},
},
},
},
}