Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lsp): reuse client when viewing git dependencies #374

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lua/rustaceanvim/cargo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ local function get_mb_active_client_root(file_name)
---@diagnostic disable-next-line: missing-parameter
local cargo_home = compat.uv.os_getenv('CARGO_HOME') or joinpath(vim.env.HOME, '.cargo')
local registry = joinpath(cargo_home, 'registry', 'src')
local checkouts = joinpath(cargo_home, 'git', 'checkouts')

---@diagnostic disable-next-line: missing-parameter
local rustup_home = compat.uv.os_getenv('RUSTUP_HOME') or joinpath(vim.env.HOME, '.rustup')
local toolchains = joinpath(rustup_home, 'toolchains')

for _, item in ipairs { toolchains, registry } do
for _, item in ipairs { toolchains, registry, checkouts } do
item = os.normalize_path_on_windows(item)
if file_name:sub(1, #item) == item then
local clients = rust_analyzer.get_active_rustaceanvim_clients()
Expand Down
Loading