Skip to content

Commit f2ce21c

Browse files
authored
Merge pull request #18957 from markmurphydev/docs_vscode_syntax_tree
Update syntax tree viewer docs
2 parents 2cd26fd + 1e40500 commit f2ce21c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Diff for: docs/dev/README.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,21 @@ There are also several VS Code commands which might be of interest:
154154

155155
* `rust-analyzer: Status` shows some memory-usage statistics.
156156

157-
* `rust-analyzer: Syntax Tree` shows syntax tree of the current file/selection.
158-
159157
* `rust-analyzer: View Hir` shows the HIR expressions within the function containing the cursor.
160158

161-
You can hover over syntax nodes in the opened text file to see the appropriate
162-
rust code that it refers to and the rust editor will also highlight the proper
163-
text range.
159+
* If `rust-analyzer.showSyntaxTree` is enabled in settings, `Rust Syntax Tree: Focus on Rust Syntax Tree View` shows the syntax tree of the current file.
160+
161+
You can click on nodes in the rust editor to go to the corresponding syntax node.
162+
163+
You can click on `Reveal Syntax Element` next to a syntax node to go to the corresponding rust code and highlight the proper text range.
164164

165165
If you trigger Go to Definition in the inspected Rust source file,
166-
the syntax tree read-only editor should scroll to and select the
166+
the syntax tree view should scroll to and select the
167167
appropriate syntax node token.
168168

169-
![demo](https://user-images.githubusercontent.com/36276403/78225773-6636a480-74d3-11ea-9d9f-1c9d42da03b0.png)
169+
You can click on `Copy` next to a syntax node to copy a text representation of the node.
170+
171+
![demo](https://github.com/user-attachments/assets/2d20ae87-0abf-495f-bee8-54aa2494a00d)
170172

171173
## Profiling
172174

0 commit comments

Comments
 (0)