Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | crates/ide/src/doc_links.rs | 13 | ||||
| -rw-r--r-- | crates/ide/src/runnables.rs | 7 | ||||
| -rw-r--r-- | editors/code/package.json | 11 |
3 files changed, 23 insertions, 8 deletions
diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs index b4a7f2b918..339bb28180 100644 --- a/crates/ide/src/doc_links.rs +++ b/crates/ide/src/doc_links.rs @@ -107,7 +107,18 @@ pub(crate) fn remove_links(markdown: &str) -> String { out } -/// Retrieve a link to documentation for the given symbol. +// Feature: Open Docs +// +// Retrieve a link to documentation for the given symbol. +// +// The simplest way to use this feature is via the context menu. Right-click on +// the selected item. The context menu opens. Select **Open Docs**. +// +// |=== +// | Editor | Action Name +// +// | VS Code | **rust-analyzer: Open Docs** +// |=== pub(crate) fn external_docs( db: &RootDatabase, position: &FilePosition, diff --git a/crates/ide/src/runnables.rs b/crates/ide/src/runnables.rs index 5b35262aab..af53adee89 100644 --- a/crates/ide/src/runnables.rs +++ b/crates/ide/src/runnables.rs @@ -195,14 +195,13 @@ pub(crate) fn runnables(db: &RootDatabase, file_id: FileId) -> Vec<Runnable> { // // Provides a sneak peek of all tests where the current item is used. // -// The simplest way to use this feature is via the context menu: -// - Right-click on the selected item. The context menu opens. -// - Select **Peek related tests** +// The simplest way to use this feature is via the context menu. Right-click on +// the selected item. The context menu opens. Select **Peek Related Tests**. // // |=== // | Editor | Action Name // -// | VS Code | **rust-analyzer: Peek related tests** +// | VS Code | **rust-analyzer: Peek Related Tests** // |=== pub(crate) fn related_tests( db: &RootDatabase, diff --git a/editors/code/package.json b/editors/code/package.json index 42a23eb16f..631f31c17e 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -226,7 +226,7 @@ }, { "command": "rust-analyzer.openDocs", - "title": "Open docs under cursor", + "title": "Open Docs", "category": "rust-analyzer" }, { @@ -236,7 +236,7 @@ }, { "command": "rust-analyzer.peekTests", - "title": "Peek related tests", + "title": "Peek Related Tests", "category": "rust-analyzer" }, { @@ -1869,8 +1869,13 @@ "editor/context": [ { "command": "rust-analyzer.peekTests", - "when": "inRustProject", + "when": "inRustProject && editorTextFocus && editorLangId == rust", "group": "navigation@1000" + }, + { + "command": "rust-analyzer.openDocs", + "when": "inRustProject && editorTextFocus && editorLangId == rust", + "group": "navigation@1001" } ] }, |