Skip to content

externalDocs doesn't open local docs on WSL #23057

Description

@rctlmk

Every time I try to open external docs on WSL, if the locally built docs are available, nothing happens. It's been like this for quite a while.

rust-analyzer version: rust-analyzer version: 0.3.2997-standalone [/home/m/.vscode-server/extensions/rust-lang.rust-analyzer-0.3.2997-linux-x64/server/rust-analyzer]

rustc version: rustc 1.97.1 (8bab26f4f 2026-07-14)

editor or extension: VSCode

code snippet to reproduce: Open a WSL project and try to open external docs for something from the standard library and for something else

/// A struct
struct Foo;

fn main() -> anyhow::Result<()> {
    let _a: i32 = 0;
    let _foo = Foo;

    Ok(())
}

LSP logs for i32:
(Please notice that the web link is for nightly, not stable)

Received response 'experimental/externalDocs - (466)' in 0ms.
Result: {
    "web": "https://doc.rust-lang.org/nightly/core/primitive.i32.html",
    "local": "file:///home/m/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html/core/primitive.i32.html"
}

LSP logs for Foo:

Received response 'experimental/externalDocs - (468)' in 0ms.
Result: {
    "web": "https://docs.rs/stuff/0.1.0/stuff/struct.Foo.html",
    "local": "file:///home/m/source/other/stuff/target/doc/stuff/struct.Foo.html"
}

LSP logs for anyhow::Result:

Received response 'experimental/externalDocs - (470)' in 1ms.
Result: {
    "web": "https://docs.rs/anyhow/1.0.104/anyhow/type.Result.html",
    "local": "file:///home/m/source/other/stuff/target/doc/anyhow/type.Result.html"
}

The docs for i32 don't open at all. The docs for anyhow::Result and Foo open in my default browser, but after running cargo doc it tries to open the "local" version, and nothing happens. Links like file://///wsl.localhost/Debian/home/m/source/stuff/target/doc/stuff/struct.Foo.html or file://///wsl.localhost/Debian/home/m/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html/core/primitive.i32.html do open in my browser as they should.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-idegeneral IDE featuresC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions