Merge pull request #18813 from Giga-Bowser/syntax-tree-view

feat: Add a new and improved syntax tree view
This commit is contained in:
Lukas Wirth 2025-01-10 06:56:34 +00:00 committed by GitHub
commit 5adca85d1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 812 additions and 701 deletions

View file

@ -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`