diff options
| author | bors <bors@rust-lang.org> | 2025-01-20 20:41:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-01-20 20:41:33 +0000 |
| commit | f3d1d47fd84dfcf7f513be1dbad356e74c8f3b2b (patch) | |
| tree | 3bf9ce3cf46983346a1d829e80873555105cd58e /src/tools/rust-analyzer/docs/dev | |
| parent | 9f4d9dc102fee5c1fe8adce2c4a58254cae510f4 (diff) | |
| parent | 67b609a91958f344d71c99504808e77726af13e2 (diff) | |
| download | rust-f3d1d47fd84dfcf7f513be1dbad356e74c8f3b2b.tar.gz rust-f3d1d47fd84dfcf7f513be1dbad356e74c8f3b2b.zip | |
Auto merge of #135789 - matthiaskrgr:rollup-4cvw8s4, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #133695 (Reexport likely/unlikely in std::hint) - #135330 (Respect --sysroot for rustc -vV and -Cpasses=list) - #135333 (Partial progress on #132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase) - #135741 (Recognise new IPv6 documentation range from IETF RFC 9637) - #135770 (Update contributing docs for submodule/subtree changes) - #135775 (Subtree update of `rust-analyzer`) - #135776 (Subtree sync for rustc_codegen_cranelift) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/tools/rust-analyzer/docs/dev')
| -rw-r--r-- | src/tools/rust-analyzer/docs/dev/README.md | 16 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/docs/dev/lsp-extensions.md | 19 |
2 files changed, 27 insertions, 8 deletions
diff --git a/src/tools/rust-analyzer/docs/dev/README.md b/src/tools/rust-analyzer/docs/dev/README.md index cd0f49174cd..3ba492e0959 100644 --- a/src/tools/rust-analyzer/docs/dev/README.md +++ b/src/tools/rust-analyzer/docs/dev/README.md @@ -154,19 +154,21 @@ There are also several VS Code commands which might be of interest: * `rust-analyzer: Status` shows some memory-usage statistics. -* `rust-analyzer: Syntax Tree` shows syntax tree of the current file/selection. - * `rust-analyzer: View Hir` shows the HIR expressions within the function containing the cursor. - You can hover over syntax nodes in the opened text file to see the appropriate - rust code that it refers to and the rust editor will also highlight the proper - text range. +* 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. + + You can click on nodes in the rust editor to go to the corresponding syntax node. + + 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. If you trigger Go to Definition in the inspected Rust source file, - the syntax tree read-only editor should scroll to and select the + the syntax tree view should scroll to and select the appropriate syntax node token. -  + You can click on `Copy` next to a syntax node to copy a text representation of the node. + +  ## Profiling diff --git a/src/tools/rust-analyzer/docs/dev/lsp-extensions.md b/src/tools/rust-analyzer/docs/dev/lsp-extensions.md index 21ac3a5a269..a632fc6f5fb 100644 --- a/src/tools/rust-analyzer/docs/dev/lsp-extensions.md +++ b/src/tools/rust-analyzer/docs/dev/lsp-extensions.md @@ -1,5 +1,5 @@ <!--- -lsp/ext.rs hash: 6dd762ae19630ec0 +lsp/ext.rs hash: 2d8604825c458288 If you need to change the above hash to make the test pass, please check if you need to adjust this doc as well and ping this issue: @@ -710,6 +710,23 @@ interface SyntaxTreeParams { Returns textual representation of a parse tree for the file/selected region. Primarily for debugging, but very useful for all people working on rust-analyzer itself. +## View Syntax Tree + +**Method:** `rust-analyzer/viewSyntaxTree` + +**Request:** + +```typescript +interface ViewSyntaxTreeParams { + textDocument: TextDocumentIdentifier, +} +``` + +**Response:** `string` + +Returns json representation of the file's syntax tree. +Used to create a treeView for debugging and working on rust-analyzer itself. + ## View Hir **Method:** `rust-analyzer/viewHir` |
