Format outputs a nicely formatted version of the source code for the Node. Formatting is done by https://github.com/ditashi/jsbeautifier-go/
()
| 361 | // Format outputs a nicely formatted version of the source code for the |
| 362 | // Node. Formatting is done by https://github.com/ditashi/jsbeautifier-go/ |
| 363 | func (n *Node) Format() (string, error) { |
| 364 | source := n.Content() |
| 365 | return jsbeautifier.Beautify(&source, jsbeautifier.DefaultOptions()) |
| 366 | } |
| 367 | |
| 368 | // Query executes a tree-sitter query on a specific Node. |
| 369 | // Nodes captured by the query are passed one at a time to the |