Skip to content

New command #7612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Zenthae opened this issue Feb 9, 2021 · 10 comments
Closed

New command #7612

Zenthae opened this issue Feb 9, 2021 · 10 comments
Labels
A-doc-comments doc string related issues A-vscode vscode plugin issues C-feature Category: feature request S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@Zenthae
Copy link

Zenthae commented Feb 9, 2021

Feature :
Adding a command to open cargo doc

Why :
Lazy people (me) love to do less, so i'd like to know if it's possible to add a command so that i just have to crtl+shift+p > open doc
and it'll start the doc on the web. (execute cargo doc --open in a new terminal under the hood)

@lnicola
Copy link
Member

lnicola commented Feb 9, 2021

Isn't this already available?

@Zenthae
Copy link
Author

Zenthae commented Feb 9, 2021

their is only a open the doc under cursor but not that handy, at least that what i feel

@lnicola
Copy link
Member

lnicola commented Feb 9, 2021

Yes, and it works for both std items and external creates. Do you want one that opens the current crate docs? Current module? Item?

@Zenthae
Copy link
Author

Zenthae commented Feb 9, 2021

it depends on published docs, so it's not up to date when you use git versions

@Zenthae
Copy link
Author

Zenthae commented Feb 10, 2021

i'm trying to implement it myself, so i can make a pull request later, but i don't understand how to start the development mode of the extension,
i've read this https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev#launching-rust-analyzer but it doesn't help very much, so far i'm using the Run Installed Extension launch configuration from launch.json. it does start a new vscode session with only rust-analyzer enabled. (little warning btw: [email protected]: The engine "vscode" appears to be invalid.)
but then here come the issue, how i'm supposed to test the extension since it doesn't activate by itself, 'cause of the following

...
"activationEvents": [
        "onLanguage:rust",
        "onCommand:rust-analyzer.analyzerStatus",
        "onCommand:rust-analyzer.memoryUsage",
        "onCommand:rust-analyzer.reloadWorkspace",
        "workspaceContains:**/Cargo.toml"
    ],
...

but the new editor start with an empty file.

So what i'd like to know is, i'm starting the développement mode right, and if it is, how i'm supposed to test what i change since i can't activate the extension in dev mode.

@lnicola
Copy link
Member

lnicola commented Feb 20, 2021

The extension should activate once you open a Rust project. I'm not sure if you need to do anything else to set up debugging.

@lnicola lnicola added A-vscode vscode plugin issues S-unactionable Issue requires feedback, design decisions or is blocked on other work labels Feb 20, 2021
@andrewbanchich
Copy link
Contributor

@lnicola I'm looking for something like this myself. The current open-external-docs only opens the docs.rs based on a URL scheme. However, it doesn't work with crates not published to docs.rs. It would be extremely useful for it to compile local, private crate doc sites.

@Veykril Veykril added A-doc-comments doc string related issues C-feature Category: feature request labels Feb 2, 2023
@zacps
Copy link
Contributor

zacps commented Jul 25, 2023

@andrewbanchich It should work with private sites as long as the crate correctly sets the html_root_url

@EliasHolzmann
Copy link
Contributor

I'm not sure I understand the exact feature requested here, but if this is about adding a new command that opens local documentation instead of the web documentation: This is available via the old command since a few weeks ago, see #15728. This issue can therefore be closed, I believe.

@Veykril
Copy link
Member

Veykril commented Nov 10, 2023

Indeed, if the local docs have been built, the command will open the local ones instead now, falling back to the web docs.

@Veykril Veykril closed this as completed Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-doc-comments doc string related issues A-vscode vscode plugin issues C-feature Category: feature request S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

6 participants