Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions generated_features.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=== Expand Macro Recursively
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/expand_macro.rs#L17[expand_macro.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/expand_macro.rs#L17[expand_macro.rs]

Shows the full macro expansion of the macro at current cursor.

Expand All @@ -11,7 +11,7 @@ Shows the full macro expansion of the macro at current cursor.


=== Extend Selection
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/extend_selection.rs#L15[extend_selection.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/extend_selection.rs#L15[extend_selection.rs]

Extends the current selection to the encompassing syntactic construct
(expression, statement, item, module, etc). It works with multiple cursors.
Expand All @@ -24,7 +24,7 @@ Extends the current selection to the encompassing syntactic construct


=== File Structure
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/file_structure.rs#L17[file_structure.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/file_structure.rs#L17[file_structure.rs]

Provides a tree of the symbols defined in the file. Can be used to

Expand All @@ -40,7 +40,7 @@ Provides a tree of the symbols defined in the file. Can be used to


=== Go to Definition
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/goto_definition.rs#L18[goto_definition.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_definition.rs#L18[goto_definition.rs]

Navigates to the definition of an identifier.

Expand All @@ -52,7 +52,7 @@ Navigates to the definition of an identifier.


=== Go to Implementation
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/goto_implementation.rs#L7[goto_implementation.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_implementation.rs#L7[goto_implementation.rs]

Navigates to the impl block of structs, enums or traits. Also implemented as a code lens.

Expand All @@ -64,7 +64,7 @@ Navigates to the impl block of structs, enums or traits. Also implemented as a c


=== Go to Type Definition
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/goto_type_definition.rs#L6[goto_type_definition.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_type_definition.rs#L6[goto_type_definition.rs]

Navigates to the type of an identifier.

Expand All @@ -76,14 +76,14 @@ Navigates to the type of an identifier.


=== Hover
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/hover.rs#L73[hover.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/hover.rs#L73[hover.rs]

Shows additional information, like type of an expression or documentation for definition when "focusing" code.
Focusing is usually hovering with a mouse, but can also be triggered with a shortcut.


=== Inlay Hints
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/inlay_hints.rs#L42[inlay_hints.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/inlay_hints.rs#L41[inlay_hints.rs]

rust-analyzer shows additional information inline with the source code.
Editors usually render this using read-only virtual text snippets interspersed with code.
Expand All @@ -106,7 +106,7 @@ https://github.com/rust-analyzer/rust-analyzer/issues/1623[1], https://github.co


=== Join Lines
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/join_lines.rs#L12[join_lines.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/join_lines.rs#L12[join_lines.rs]

Join selected lines into one, smartly fixing up whitespace, trailing commas, and braces.

Expand All @@ -118,7 +118,7 @@ Join selected lines into one, smartly fixing up whitespace, trailing commas, and


=== Magic Completions
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/completion.rs#L39[completion.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/completion.rs#L39[completion.rs]

In addition to usual reference completion, rust-analyzer provides some ✨magic✨
completions as well:
Expand Down Expand Up @@ -163,7 +163,7 @@ mod tests {


=== Matching Brace
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/matching_brace.rs#L7[matching_brace.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/matching_brace.rs#L7[matching_brace.rs]

If the cursor is on any brace (`<>(){}[]||`) which is a part of a brace-pair,
moves cursor to the matching brace. It uses the actual parser to determine
Expand All @@ -177,7 +177,7 @@ braces, so it won't confuse generics with comparisons.


=== Memory Usage
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide_db/src/change.rs#L166[change.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_db/src/change.rs#L166[change.rs]

Clears rust-analyzer's internal database and prints memory usage statistics.

Expand All @@ -189,7 +189,7 @@ Clears rust-analyzer's internal database and prints memory usage statistics.


=== On Enter
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/typing/on_enter.rs#L15[on_enter.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/typing/on_enter.rs#L15[on_enter.rs]

rust-analyzer can override kbd:[Enter] key to make it smarter:

Expand All @@ -212,7 +212,7 @@ Add the following to `keybindings.json`:


=== On Typing Assists
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/typing.rs#L37[typing.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/typing.rs#L37[typing.rs]

Some features trigger on typing certain characters:

Expand All @@ -221,7 +221,7 @@ Some features trigger on typing certain characters:


=== Parent Module
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/parent_module.rs#L12[parent_module.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/parent_module.rs#L12[parent_module.rs]

Navigates to the parent module of the current module.

Expand All @@ -233,7 +233,7 @@ Navigates to the parent module of the current module.


=== Run
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/runnables.rs#L81[runnables.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L81[runnables.rs]

Shows a popup suggesting to run a test/benchmark/binary **at the current cursor
location**. Super useful for repeatedly running just a single test. Do bind this
Expand All @@ -247,7 +247,7 @@ to a shortcut!


=== Semantic Syntax Highlighting
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/syntax_highlighting.rs#L34[syntax_highlighting.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/syntax_highlighting.rs#L34[syntax_highlighting.rs]

rust-analyzer highlights the code semantically.
For example, `bar` in `foo::Bar` might be colored differently depending on whether `Bar` is an enum or a trait.
Expand All @@ -259,7 +259,7 @@ We also give special modifier for `mut` and `&mut` local variables.


=== Show Syntax Tree
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/syntax_tree.rs#L9[syntax_tree.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/syntax_tree.rs#L9[syntax_tree.rs]

Shows the parse tree of the current file. It exists mostly for debugging
rust-analyzer itself.
Expand All @@ -272,7 +272,7 @@ rust-analyzer itself.


=== Status
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/status.rs#L25[status.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/status.rs#L25[status.rs]

Shows internal statistic about memory usage of rust-analyzer.

Expand All @@ -284,7 +284,7 @@ Shows internal statistic about memory usage of rust-analyzer.


=== Structural Search and Replace
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/ssr.rs#L7[ssr.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/ssr.rs#L7[ssr.rs]

Search and replace with named wildcards that will match any expression, type, path, pattern or item.
The syntax for a structural search replace command is `<search_pattern> ==>> <replace_pattern>`.
Expand Down Expand Up @@ -338,7 +338,7 @@ String::from((y + 5).foo(z))


=== Workspace Symbol
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide_db/src/symbol_index.rs#L143[symbol_index.rs]
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_db/src/symbol_index.rs#L143[symbol_index.rs]

Uses fuzzy-search to find types, modules and functions by name across your
project and dependencies. This is **the** most useful feature, which improves code
Expand Down