MCPcopy
hub / github.com/BishopFox/jsluice / Format

Method Format

tree.go:363–366  ·  view source on GitHub ↗

Format outputs a nicely formatted version of the source code for the Node. Formatting is done by https://github.com/ditashi/jsbeautifier-go/

()

Source from the content-addressed store, hash-verified

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/
363func (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

Callers 2

runQueryFunction · 0.80
formatFunction · 0.80

Calls 1

ContentMethod · 0.95

Tested by

no test coverage detected