Skip to content

Open local external docs through remote VS Code authorities - #23119

Open
M-Nabeegh wants to merge 1 commit into
rust-lang:masterfrom
M-Nabeegh:codex/rust-analyzer-wsl-docs
Open

Open local external docs through remote VS Code authorities#23119
M-Nabeegh wants to merge 1 commit into
rust-lang:masterfrom
M-Nabeegh:codex/rust-analyzer-wsl-docs

Conversation

@M-Nabeegh

@M-Nabeegh M-Nabeegh commented Aug 11, 2026

Copy link
Copy Markdown

Fixes #23057

What changed

Translate local documentation links returned by rust-analyzer for remote editors into host-openable links. WSL authorities use the host's file://///wsl.localhost/<distro>/... UNC form so local HTML docs open in the default browser; other remote authorities use vscode-remote:// links with a :1:1 file position so VS Code opens the document instead of treating it as a folder. Local, web, and already-remote links keep their existing behavior.

Why

The VS Code extension host can receive a local documentation path from the remote language server, but opening that file:// URI targets the wrong side of the connection. A remote protocol URL without a file position is also interpreted as a folder by VS Code.

Validation

  • npm run format:check
  • npm run lint
  • npm run typecheck
  • npm test (VS Code 1.93.0 with a short user-data directory)
  • Added unit coverage for WSL UNC conversion, SSH authorities, encoded paths, query strings, fragments, file positions, and unchanged URI forms.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 11, 2026
@M-Nabeegh
M-Nabeegh force-pushed the codex/rust-analyzer-wsl-docs branch from 08f0f3b to b28aaf5 Compare August 11, 2026 10:10
@M-Nabeegh
M-Nabeegh force-pushed the codex/rust-analyzer-wsl-docs branch from b28aaf5 to 10ef92d Compare August 11, 2026 10:22
@ChayimFriedman2

Copy link
Copy Markdown
Contributor

Did you use AI for this? Please note that our AI policy:

  • Requires disclosure.
  • Requires understanding the code to the level you could write it yourself.
  • Does not allow using AI to write GitHub comments and PR descriptions.

@M-Nabeegh

Copy link
Copy Markdown
Author

Hi! I’m a 4t year CS student, and my professor asked us to make an open-source contribution sooo I’m still learning the contribution process. I did use AI assistance while working on this PR, and I apologize for not disclosing that earlier. I understand the code and the changes I submitted, and I’ll make sure to follow the project’s AI policy properly going forward. Thank you for pointing this out and for your understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

externalDocs doesn't open local docs on WSL

3 participants