rust/crates
bors f5401f6206 Auto merge of #14175 - jmviz:openDocs-context-menu, r=lnicola
add openDocs command to context menu in VS Code extension

This adds the `openDocs` command to the VS Code context menu. I believe there are probably many user who are unaware of this command existing in the rust analyzer extension, and that this should enhance the discoverability of the command. Additionally, even if people are aware of this capability, it's helpful to have this in the context menu anyway; for example, one might forget the name of the command, or the keybinding they have assigned to it. I think that opening docs is a common enough action to warrant the extra line added to the context menu.

This makes a few other small changes as well. There are two minor style changes to increase style consistency. First, it changes the titles of the two commands that the rust analyzer extension will contribute to the context menu to title case. All standard VS Code commands that appear in the context menu are in title case. Second, it shortens the title of the `openDocs` command from `Open docs under cursor` to `Open Docs`. The implicit assumption in the standard VS Code context menu command titles is that the action applies to the symbol under the cursor: `Go to Definition`, `Find All References`, etc. Note that since these are changes to the command titles, rather than the command names themselves, these changes will not break any users' existing keybindings for these commands.

Second, this adds further restrictions to the `where` clauses of the two commands that the rust analyzer extension will contribute to the context menu, so that the two commands will appear in the context menu only when in a Rust project **and** within a Rust file. Say you have a Python or bash script inside your Rust project. Having these commands appear in the context menu when you right click a symbol in such a non-Rust file is extraneous and potentially confusing.

![demonstration](https://user-images.githubusercontent.com/6609145/219976062-b46ab21b-5753-48f5-a1da-562566cae71c.gif)
2023-02-24 06:55:02 +00:00
..
base-db ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
cfg ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
flycheck ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
hir internal: Enable smallvec's union feature 2023-02-14 17:01:01 +01:00
hir-def Simplify 2023-02-15 13:38:42 +01:00
hir-expand internal: Enable smallvec's union feature 2023-02-14 17:01:01 +01:00
hir-ty Slim down GenericArgs by one usize once more 2023-02-14 17:41:16 +01:00
ide add to manual 2023-02-20 11:38:33 -05:00
ide-assists Conditionally add snippet marker. 2023-02-16 10:50:27 +13:00
ide-completion internal: Make CompletionItem more POD-like 2023-02-16 09:29:55 +01:00
ide-db Auto merge of #14128 - Veykril:parser, r=Veykril 2023-02-14 12:59:39 +00:00
ide-diagnostics ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
ide-ssr ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
intern ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
limit ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
mbe internal: Enable smallvec's union feature 2023-02-14 17:01:01 +01:00
parser Recover better for more delimited sequences 2023-02-14 13:52:15 +01:00
paths ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
proc-macro-api Cargo fmt 2023-02-14 14:45:05 -05:00
proc-macro-srv ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
proc-macro-srv-cli ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
proc-macro-test ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
profile ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
project-model ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
rust-analyzer Try to improve the rustfmt.overrideCommand docs 2023-02-21 12:43:22 +02:00
sourcegen ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
stdx Fix a pair of typos 2023-02-15 14:11:11 +02:00
syntax fix: Bring back hovering call parens for return type info 2023-02-15 18:58:59 +01:00
test-utils ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
text-edit ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
toolchain ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
tt ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
vfs ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
vfs-notify ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00