diff options
| author | Yura Taras <yura.taras@gmail.com> | 2023-09-11 08:20:20 +0000 |
|---|---|---|
| committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-09-30 12:08:11 +0200 |
| commit | 50fcf96ec5a6e7bfdcbbea4f905c33e85408f170 (patch) | |
| tree | c1da6b82eb85cd6a7a9ff9d88d1fbca97a49d267 /lua/lspconfig/server_configurations/rust_analyzer.lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-50fcf96ec5a6e7bfdcbbea4f905c33e85408f170.tar nvim-lspconfig-50fcf96ec5a6e7bfdcbbea4f905c33e85408f170.tar.gz nvim-lspconfig-50fcf96ec5a6e7bfdcbbea4f905c33e85408f170.tar.bz2 nvim-lspconfig-50fcf96ec5a6e7bfdcbbea4f905c33e85408f170.tar.lz nvim-lspconfig-50fcf96ec5a6e7bfdcbbea4f905c33e85408f170.tar.xz nvim-lspconfig-50fcf96ec5a6e7bfdcbbea4f905c33e85408f170.tar.zst nvim-lspconfig-50fcf96ec5a6e7bfdcbbea4f905c33e85408f170.zip | |
fix(rust_analyzer): check if file is library on Windows
Make #2645 to work on Windows
Diffstat (limited to 'lua/lspconfig/server_configurations/rust_analyzer.lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/rust_analyzer.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lua/lspconfig/server_configurations/rust_analyzer.lua b/lua/lspconfig/server_configurations/rust_analyzer.lua index 6ed471d2..656c459d 100644 --- a/lua/lspconfig/server_configurations/rust_analyzer.lua +++ b/lua/lspconfig/server_configurations/rust_analyzer.lua @@ -16,10 +16,11 @@ local function reload_workspace(bufnr) end local function is_library(fname) - local cargo_home = os.getenv 'CARGO_HOME' or util.path.join(vim.env.HOME, '.cargo') + local user_home = util.path.sanitize(vim.env.HOME) + local cargo_home = os.getenv 'CARGO_HOME' or util.path.join(user_home, '.cargo') local registry = util.path.join(cargo_home, 'registry', 'src') - local rustup_home = os.getenv 'RUSTUP_HOME' or util.path.join(vim.env.HOME, '.rustup') + local rustup_home = os.getenv 'RUSTUP_HOME' or util.path.join(user_home, '.rustup') local toolchains = util.path.join(rustup_home, 'toolchains') for _, item in ipairs { toolchains, registry } do |
