4 Commits
Author SHA1 Message Date
Youcef Hanaia 34342a9d00 Chore: Replace subprocess.run with subprocess_run util function (#1754) 2026-07-25 20:56:08 +02:00
VoidChecksumandVoidChecksum d39d168523 fix: detect rust-analyzer from PATH without rustup (#1173)
* fix: check PATH for rust-analyzer before common locations, with functionality validation

Fixes #800 - rust-analyzer fails if rustup is not installed even when
rust-analyzer exists in PATH (e.g. NixOS, distro packages).

Changes:
- Move PATH check (shutil.which) before common location fallbacks
- Add _is_rust_analyzer_functional() to validate PATH-found binaries
  by running --version, catching broken rustup proxy symlinks
- Add tests for Nix PATH detection and broken proxy skip scenarios

* fix: make test_skip_broken_rustup_proxy_in_path work on Windows

The test used hardcoded Unix paths (/usr/bin/rust-analyzer) and
os.path.expanduser("~/.cargo/bin/rust-analyzer") which doesn't
include the .exe extension. On Windows, the production code builds
common paths using pathlib with "rust-analyzer.exe", so the mock
paths never matched, causing RuntimeError instead of finding the
cargo fallback.

Use platform-appropriate paths: on Windows, use .exe extension and
pathlib.Path.home() to match how the production code constructs paths.

---------

Co-authored-by: VoidChecksum <Admin@CyberNord>
2026-03-23 18:01:31 +01:00
Dominik Jain 6b87ffd758 Convert RustAnalyzer to use LanguageServerDependencyProviderSinglePath 2026-02-01 14:29:39 +01:00
Ketema Harris c807e98191 Enhance rust-analyzer detection by checking common paths
Includes tests that rely on mocks
2026-01-04 12:11:52 +01:00