Documentation
¶
Overview ¶
Package sourceinfo contains the logic for computing source code info for a file descriptor.
The inputs to the computation are an AST for a file as well as the index of interpreted options for that file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSourceInfo ¶
func GenerateSourceInfo(file *ast.FileNode, opts options.Index) *descriptorpb.SourceCodeInfo
GenerateSourceInfo generates source code info for the given AST. If the given opts is present, it can generate source code info for interpreted options. Otherwise, any options in the AST will get source code info as uninterpreted options.
This includes comments only for locations that represent complete declarations. This is the same behavior as protoc, the reference compiler for Protocol Buffers.
func GenerateSourceInfoWithExtraComments ¶
func GenerateSourceInfoWithExtraComments(file *ast.FileNode, opts options.Index) *descriptorpb.SourceCodeInfo
GenerateSourceInfoWithExtraComments generates source code info for the given AST. If the given opts is present, it can generate source code info for interpreted options. Otherwise, any options in the AST will get source code info as uninterpreted options.
This includes comments for all locations. This is still lossy, but less so as it preserves far more comments from the source file.
Types ¶
This section is empty.