From 91ff47ef6ac55f66ca57a2b1ee2eae62f50213f2 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 1 Mar 2021 11:07:15 +0100 Subject: [PATCH] Update vscode README with a small features list --- crates/ide/src/references.rs | 9 +++++++++ crates/ide/src/references/rename.rs | 9 +++++++++ editors/code/README.md | 28 ++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index 5d0449e5673..fef70533d3d 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs @@ -39,6 +39,15 @@ pub struct Declaration { pub access: Option, } +// Feature: Find All References +// +// Shows all references of the item at the cursor location +// +// |=== +// | Editor | Shortcut +// +// | VS Code | kbd:[Shift+Alt+F12] +// |=== pub(crate) fn find_all_refs( sema: &Semantics, position: FilePosition, diff --git a/crates/ide/src/references/rename.rs b/crates/ide/src/references/rename.rs index 175ddd759ca..22ddeeae3cf 100644 --- a/crates/ide/src/references/rename.rs +++ b/crates/ide/src/references/rename.rs @@ -59,6 +59,15 @@ pub(crate) fn prepare_rename( Ok(RangeInfo::new(range, ())) } +// Feature: Rename +// +// Renames the item below the cursor and all of its references +// +// |=== +// | Editor | Shortcut +// +// | VS Code | kbd:[F2] +// |=== pub(crate) fn rename( db: &RootDatabase, position: FilePosition, diff --git a/editors/code/README.md b/editors/code/README.md index 336695d9ffc..e7d7a06f0e3 100644 --- a/editors/code/README.md +++ b/editors/code/README.md @@ -2,4 +2,32 @@ Provides support for rust-analyzer: novel LSP server for the Rust programming language. + +Features: + +* [code completion], [imports insertion] +* [go to definition], [implementation], [type definition] +* [find all references], [workspace symbol search], [rename] +* [types and documentation on hover] +* [inlay hints] +* [semantic syntax highlighting] +* a lot of [assist(code actions)] +* apply suggestions from errors +* ... and many more, checkout the [manual] to see them all + +[code completion]: https://rust-analyzer.github.io/manual.html#magic-completions +[imports insertion]: https://rust-analyzer.github.io/manual.html#auto-import +[go to definition]: https://rust-analyzer.github.io/manual.html#go-to-definition +[implementation]: https://rust-analyzer.github.io/manual.html#go-to-implementation +[type definition]: https://rust-analyzer.github.io/manual.html#go-to-type-definition +[find all references]: https://rust-analyzer.github.io/manual.html#find-all-references +[workspace symbol search]: https://rust-analyzer.github.io/manual.html#workspace-symbol +[rename]: https://rust-analyzer.github.io/manual.html#rename +[types and documentation on hover]: https://rust-analyzer.github.io/manual.html#hover +[inlay hints]: https://rust-analyzer.github.io/manual.html#inlay-hints +[semantic syntax highlighting]: https://rust-analyzer.github.io/manual.html#semantic-syntax-highlighting +[assist(code actions)]: https://rust-analyzer.github.io/manual.html#assists-code-actions + +[manual]: https://rust-analyzer.github.io/manual.html + See https://rust-analyzer.github.io/ for more information.