$ rust-analyzer parse < foo.rs
Outputs rowan debug tree.
Add a --json option, outputs like:
{
"kind": "SOURCE_FILE",
"type": "Node",
"start": ...,
"end": ...,
"children": [
{
"kind": "ERROR",
"type": "Node",
"start": ...,
"end": ...,
"children": [
{
"kind": "COMMA",
"type": "Token",
"text": ",",
"start": ...,
"end": ...
}
]
}
]
}
Similar to rust-analyzer.viewSyntaxTree, but with the addition of a text field in the token
Outputs rowan debug tree.
Add a
--jsonoption, outputs like:{ "kind": "SOURCE_FILE", "type": "Node", "start": ..., "end": ..., "children": [ { "kind": "ERROR", "type": "Node", "start": ..., "end": ..., "children": [ { "kind": "COMMA", "type": "Token", "text": ",", "start": ..., "end": ... } ] } ] }Similar to
rust-analyzer.viewSyntaxTree, but with the addition of atextfield in the token