I have been banging my head for days and I’ve run out of ideas to try. I want to set the rust-analyzer.server.extraEnv
configuration option (listed here).
I went as far as trying all possible combinations of setting this but still, when examining the environment of the spawned rust-analyzer process it does not have my environment variable:
lua << EOF
vim.lsp.set_log_level("debug")
require('lspconfig').rust_analyzer.setup({
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" },
settings = {
["rust_analyzer"] = {
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
},
},
["rust-analyzer"] = {
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
},
},
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
},
},
},
settings = {
["rust_analyzer"] = {
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
},
},
["rust-analyzer"] = {
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
},
},
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
},
},
["rust-analyzer"] = {
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
},
settings = {
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
},
["rust_analyzer"] = {
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
}
},
["rust-analyzer"] = {
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
}
},
}
},
["rust_analyzer"] = {
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
},
settings = {
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
},
["rust-analyzer"] = {
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
}
},
["rust_analyzer"] = {
["server.extraEnv"] = { FOO = "bar" },
server = {
extraEnv = { FOO = "bar" }
}
},
}
}
})
EOF
If someone can shed some light on how to pass that configuration option to rust-analyzer I would hugely appreciate it, thanks!