From 00108a669ebde2c05c6bb510b74dfb8cee26627e Mon Sep 17 00:00:00 2001 From: arookieofc <2128194521@qq.com> Date: Sat, 31 Oct 2026 03:07:12 +0800 Subject: [PATCH] fix(tools): find global .NET tools such as fsautocomplete (#497) Global .NET tools install to `~/.dotnet/tools`, which the tool search did not look at, so an fsautocomplete installed the way its hint suggests was reported as missing unless that directory was on `PATH`. The directory is now searched after `PATH` and before the system directories. Co-authored-by: a-rookie-of-C-language <186315048+a-rookie-of-C-language@users.noreply.github.com> --- crates/ide-core/src/tool_path.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ide-core/src/tool_path.rs b/crates/ide-core/src/tool_path.rs index 6abe16a4..14760d56 100644 --- a/crates/ide-core/src/tool_path.rs +++ b/crates/ide-core/src/tool_path.rs @@ -80,6 +80,8 @@ const USER_DIRS: &[&str] = &[ ".cargo/bin", ".local/bin", "go/bin", + // `dotnet tool install --global` puts fsautocomplete, csharp-ls and friends here. + ".dotnet/tools", ".bun/bin", ".deno/bin", ".npm-global/bin", @@ -170,6 +172,8 @@ mod tests { let at = |d: &str| dirs.iter().position(|p| p == Path::new(d)).unwrap(); assert_eq!(dirs[..3], [PathBuf::from("/usr/bin"), "/opt/tools".into(), "/home/me/.asdf/shims".into()]); assert!(at("/home/me/.npm-global/bin") < at("/home/me/.pyenv/shims")); + // Global .NET tools (fsautocomplete, csharp-ls) install here, off PATH. + assert!(at("/home/me/.dotnet/tools") < at("/usr/local/bin")); assert!(at("/home/me/.local/share/mise/shims") < at("/usr/local/bin")); assert!(dirs.iter().all(|d| d.is_absolute())); let unique: HashSet<&PathBuf> = dirs.iter().collect();