Documentation
¶
Overview ¶
Package queries provides specific incremental.Query types for various parts of Protocompile. It is separate from package incremental itself because it is Protocompile-specific.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AST ¶
AST is an incremental.Query for the AST of a Protobuf file.
AST queries with different Openers are considered distinct.
func (AST) Execute ¶
Execute implements incremental.Query.
func (AST) Key ¶
Key implements incremental.Query.
The key for a Contents query is the query itself. This means that a single incremental.Executor can host Contents queries for multiple Openers. It also means that the Openers must all be comparable. As the [Opener] documentation states, implementations should take a pointer receiver so that comparison uses object identity.
type FDP ¶
FDP is an incremental.Query that converts the lowered IR files *ir.File to *descriptorpb.FileDescriptorProto
FDP queries with different File and Options are considered distinct. The File field must not be edited between different FDP queries!
func (FDP) Execute ¶
func (l FDP) Execute(t *incremental.Task) (*descriptorpb.FileDescriptorProto, error)
Execute implements incremental.Query.
type FDS ¶
type FDS struct {
source.Opener // Must be comparable.
*ir.Session
source.Workspace // Must be comparable
fdp.Options
}
FDS is an incremental.Query that produces a *descriptorpb.FileDescriptorSet. It takes the IR files ir.File produced via Link, topologically sorts the resulting IR files, and converts each to a *descriptorpb.FileDescriptorProto via FDP. It then bundles them all together into a *descriptorpb.FileDescriptorSet.
FDS queries with different Openers, options, and workspaces are considered distinct.
func (FDS) Execute ¶
func (l FDS) Execute(t *incremental.Task) (*descriptorpb.FileDescriptorSet, error)
Execute implements incremental.Query.
type File ¶
type File struct {
source.Opener // Must be comparable.
Path string
// If set, any errors generated from opening the file are logged as
// diagnostics. Setting this to false is useful for cases where the
// caller wants to emit a more general diagnostic.
ReportError bool
}
File is an incremental.Query for the contents of a file as provided by a source.Opener.
File queries with different Openers are considered distinct.
func (File) Execute ¶
Execute implements incremental.Query.
func (File) Key ¶
Key implements incremental.Query.
The key for a File query is the query itself. This means that a single incremental.Executor can host File queries for multiple Openers. It also means that the Openers must all be comparable. As the [Opener] documentation states, implementations should take a pointer receiver so that comparison uses object identity.
type IR ¶
type IR struct {
source.Opener // Must be comparable.
*ir.Session
Path string
// contains filtered or unexported fields
}
IR is an incremental.Query for the lowered IR of a Protobuf file.
IR queries with different Openers are considered distinct.
func (IR) Execute ¶
Execute implements incremental.Query.
type Link ¶
type Link struct {
source.Opener // Must be comparable.
*ir.Session
source.Workspace // Must be comparable.
}
Link is an incremental.Query for the lowered IR files *ir.File of the given Protobuf source workspace source.Workspace. This query links the compilation of the given sources together and allows us to additional checks across the sources, e.g. duplicate symbols and extensions across the given source.Workspace.
Link queries with different [source.Opener]s and/or [source.Workspace]s are considered distinct.
func (Link) Execute ¶
Execute implements incremental.Query.