Documentation ¶
Index ¶
- func DumpAST(node ast.Node, parseRes parser.Result) string
- func File(filename string, out io.Writer) error
- func FileInPlace(filename string) error
- func Format(in io.Reader, out io.Writer) error
- func NewDefaultPrinter() *protoprint.Printer
- func NewFormatter(writer io.Writer, fileNode FileNodeInterface) *formatter
- func PrintAndFormatFileDescriptor(fd protoreflect.FileDescriptor, out io.Writer) error
- func PrintDescriptor(d protoreflect.Descriptor) (string, error)
- func PrintNode(fileNode FileNodeInterface, node ast.Node) (string, error)
- func SortElements(a, b protoprint.Element, ignore func() bool) (less bool)
- func StringForFieldReference(fieldReference *ast.FieldReferenceNode) string
- func StringForOptionName(optionNameNode *ast.OptionNameNode) string
- type FileNodeInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileInPlace ¶
func NewDefaultPrinter ¶
func NewDefaultPrinter() *protoprint.Printer
func NewFormatter ¶
func NewFormatter( writer io.Writer, fileNode FileNodeInterface, ) *formatter
NewFormatter returns a new formatter for the given file.
func PrintAndFormatFileDescriptor ¶
func PrintAndFormatFileDescriptor(fd protoreflect.FileDescriptor, out io.Writer) error
func PrintDescriptor ¶
func PrintDescriptor(d protoreflect.Descriptor) (string, error)
func SortElements ¶
func SortElements(a, b protoprint.Element, ignore func() bool) (less bool)
func StringForFieldReference ¶
func StringForFieldReference(fieldReference *ast.FieldReferenceNode) string
StringForFieldReference returns the string representation of the given field reference. This is used for sorting file-level options.
func StringForOptionName ¶
func StringForOptionName(optionNameNode *ast.OptionNameNode) string
StringForOptionName returns the string representation of the given option name node. This is used for sorting file-level options.
Types ¶
type FileNodeInterface ¶
type FileNodeInterface interface { GetSyntax() *ast.SyntaxNode GetEdition() *ast.EditionNode GetDecls() []*ast.FileElement GetEOF() *ast.RuneNode NodeInfo(node ast.Node) ast.NodeInfo }
func NodeInfoOverlay ¶
func NodeInfoOverlay(fileNode FileNodeInterface, infos map[ast.Node]ast.NodeInfo) FileNodeInterface
Click to show internal directories.
Click to hide internal directories.