summaryrefslogtreecommitdiff
path: root/lua/lang/rust.lua
diff options
context:
space:
mode:
authorichigo-gyuunyuu <[email protected]>2021-07-21 01:03:15 +0530
committerGitHub <[email protected]>2021-07-21 00:03:15 +0430
commit0064b446a02be13dba0f16f084e073b347716710 (patch)
tree203f9907132b86c37733096bd139cf224b4dd1ad /lua/lang/rust.lua
parent9e640fa4d99beeec97292a00a51b335960aa2b0f (diff)
[Feature] Allow for custom path to a language server binary (#1043)
Diffstat (limited to 'lua/lang/rust.lua')
-rw-r--r--lua/lang/rust.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/lua/lang/rust.lua b/lua/lang/rust.lua
index ecdfa69d..e3d4ce47 100644
--- a/lua/lang/rust.lua
+++ b/lua/lang/rust.lua
@@ -19,6 +19,9 @@ M.config = function()
signs = true,
underline = true,
},
+ lsp = {
+ path = DATA_PATH .. "/lspinstall/rust/rust-analyzer",
+ },
}
end
@@ -118,14 +121,14 @@ M.lsp = function()
-- these override the defaults set by rust-tools.nvim
-- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
server = {
- cmd = { DATA_PATH .. "/lspinstall/rust/rust-analyzer" },
+ cmd = { O.lang.rust.lsp.path },
on_attach = require("lsp").common_on_attach,
}, -- rust-analyser options
}
require("rust-tools").setup(opts)
else
require("lspconfig").rust_analyzer.setup {
- cmd = { DATA_PATH .. "/lspinstall/rust/rust-analyzer" },
+ cmd = { O.lang.rust.lsp.path },
on_attach = require("lsp").common_on_attach,
filetypes = { "rust" },
root_dir = require("lspconfig.util").root_pattern("Cargo.toml", "rust-project.json"),