Skip to content

feature: for all config values that override commands, canonicalize the provided path #13405

Closed
@davidbarsky

Description

@davidbarsky

(The way that I came across this issue was a confluence of weird BigCo constraints, the use of a virtualized file system, and me acting as a de-facto vendor for Rust Analyzer. I don't expect most people to encounter this in the first place.)

I've noticed a small inconsistency when working with config values that override commands: namely, the config value provided for rust-analyzer.server.path will trim the leading ~ from the provided path, but the same will not occur for rust-analyzer.rustfmt.overrideCommand (I assume the holds for every other overridable command in Rust Analyzer, but I haven't tested those other commands yet) . This means that I can't point every instance of Rust Analyzer used at my employer at the appropriate rustfmt (or any other binary) inside of the monorepo, as providing the home directory-relative path to rustfmt results in a textDocument/formatting failed. Message: Failed to spawn error being shown.

If it's okay with y'all, I'd be happy to write a bit of code in the Rust Analyzer server itself to bring the existing behavior for rust-analyzer.server.path to all other config values that accept paths. I don't think it'll cause any issues for people who don't have weird setups like my employer does, but it'll certainly reduce my support burden. If nothing else, it might remove an inconsistency.

Alternatives Considered

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions