Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterSyntaxServer(s grpc.ServiceRegistrar, srv SyntaxServer)
- type Client
- func (c *Client) Highlight(uri workspaceapi.URI, content string) (iterator.Iterator[textapi.Location], error)
- func (c *Client) Init(ctx context.Context, cc grpc.ClientConnInterface)
- func (c *Client) Query(file workspaceapi.URI, query string, captureNames []string) (iterator.Iterator[syntaxapi.Result], error)
- func (c *Client) QueryNode(file workspaceapi.URI, nodeTypes syntaxapi.NodeCaptureName) (iterator.Iterator[syntaxapi.Result], error)
- func (c *Client) Search(query string, captureNames []string, languages ...string) (iterator.Iterator[syntaxapi.Result], error)
- func (c *Client) SearchNode(nodeTypes syntaxapi.NodeCaptureName) (iterator.Iterator[syntaxapi.Result], error)
- type HighlightRequest
- func (*HighlightRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HighlightRequest) GetContent() string
- func (x *HighlightRequest) GetUri() string
- func (*HighlightRequest) ProtoMessage()
- func (x *HighlightRequest) ProtoReflect() protoreflect.Message
- func (x *HighlightRequest) Reset()
- func (x *HighlightRequest) String() string
- type HighlightResponse
- func (*HighlightResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HighlightResponse) GetAttr() *termrpc.Attributes
- func (x *HighlightResponse) GetFrom() *termrpc.Coordinates
- func (x *HighlightResponse) GetMessage() string
- func (x *HighlightResponse) GetTo() *termrpc.Coordinates
- func (*HighlightResponse) ProtoMessage()
- func (x *HighlightResponse) ProtoReflect() protoreflect.Message
- func (x *HighlightResponse) Reset()
- func (x *HighlightResponse) String() string
- type QueryNodeRequest
- func (*QueryNodeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryNodeRequest) GetNodeTypes() uint32
- func (x *QueryNodeRequest) GetUri() string
- func (*QueryNodeRequest) ProtoMessage()
- func (x *QueryNodeRequest) ProtoReflect() protoreflect.Message
- func (x *QueryNodeRequest) Reset()
- func (x *QueryNodeRequest) String() string
- type QueryRequest
- func (*QueryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryRequest) GetCaptureNames() []string
- func (x *QueryRequest) GetQuery() string
- func (x *QueryRequest) GetUri() string
- func (*QueryRequest) ProtoMessage()
- func (x *QueryRequest) ProtoReflect() protoreflect.Message
- func (x *QueryRequest) Reset()
- func (x *QueryRequest) String() string
- type SearchNodeRequest
- type SearchRequest
- func (*SearchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SearchRequest) GetCaptureNames() []string
- func (x *SearchRequest) GetLanguages() []string
- func (x *SearchRequest) GetQuery() string
- func (*SearchRequest) ProtoMessage()
- func (x *SearchRequest) ProtoReflect() protoreflect.Message
- func (x *SearchRequest) Reset()
- func (x *SearchRequest) String() string
- type SearchResponse
- func (*SearchResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SearchResponse) GetCaptureName() string
- func (x *SearchResponse) GetFrom() *termrpc.Coordinates
- func (x *SearchResponse) GetText() string
- func (x *SearchResponse) GetTo() *termrpc.Coordinates
- func (x *SearchResponse) GetUri() string
- func (*SearchResponse) ProtoMessage()
- func (x *SearchResponse) ProtoReflect() protoreflect.Message
- func (x *SearchResponse) Reset()
- func (x *SearchResponse) String() string
- type SyntaxClient
- type SyntaxServer
- type Syntax_HighlightClient
- type Syntax_HighlightServer
- type Syntax_QueryClient
- type Syntax_QueryNodeClient
- type Syntax_QueryNodeServer
- type Syntax_QueryServer
- type Syntax_SearchClient
- type Syntax_SearchNodeClient
- type Syntax_SearchNodeServer
- type Syntax_SearchServer
- type UnimplementedSyntaxServer
- func (UnimplementedSyntaxServer) Highlight(*HighlightRequest, grpc.ServerStreamingServer[HighlightResponse]) error
- func (UnimplementedSyntaxServer) Query(*QueryRequest, grpc.ServerStreamingServer[SearchResponse]) error
- func (UnimplementedSyntaxServer) QueryNode(*QueryNodeRequest, grpc.ServerStreamingServer[SearchResponse]) error
- func (UnimplementedSyntaxServer) Search(*SearchRequest, grpc.ServerStreamingServer[SearchResponse]) error
- func (UnimplementedSyntaxServer) SearchNode(*SearchNodeRequest, grpc.ServerStreamingServer[SearchResponse]) error
- type UnsafeSyntaxServer
Constants ¶
const ( Syntax_Search_FullMethodName = "/syntax.Syntax/Search" Syntax_SearchNode_FullMethodName = "/syntax.Syntax/SearchNode" Syntax_Query_FullMethodName = "/syntax.Syntax/Query" Syntax_QueryNode_FullMethodName = "/syntax.Syntax/QueryNode" Syntax_Highlight_FullMethodName = "/syntax.Syntax/Highlight" )
Variables ¶
var File_syntaxrpc_syntax_proto protoreflect.FileDescriptor
var Syntax_ServiceDesc = grpc.ServiceDesc{ ServiceName: "syntax.Syntax", HandlerType: (*SyntaxServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Search", Handler: _Syntax_Search_Handler, ServerStreams: true, }, { StreamName: "SearchNode", Handler: _Syntax_SearchNode_Handler, ServerStreams: true, }, { StreamName: "Query", Handler: _Syntax_Query_Handler, ServerStreams: true, }, { StreamName: "QueryNode", Handler: _Syntax_QueryNode_Handler, ServerStreams: true, }, { StreamName: "Highlight", Handler: _Syntax_Highlight_Handler, ServerStreams: true, }, }, Metadata: "syntaxrpc/syntax.proto", }
Syntax_ServiceDesc is the grpc.ServiceDesc for Syntax service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSyntaxServer ¶
func RegisterSyntaxServer(s grpc.ServiceRegistrar, srv SyntaxServer)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client satisfies syntaxapi.Parser via gRPC.
func NewClient ¶
func NewClient(ctx context.Context, cc grpc.ClientConnInterface) *Client
NewClient allocates storage for a new Client and initializes it with the given connection.
func (*Client) Highlight ¶ added in v0.0.24
func (c *Client) Highlight( uri workspaceapi.URI, content string, ) (iterator.Iterator[textapi.Location], error)
Highlight satisfies syntaxapi.Parser.
func (*Client) Init ¶
func (c *Client) Init(ctx context.Context, cc grpc.ClientConnInterface)
Init initializes this client with cc.
func (*Client) Query ¶ added in v0.0.14
func (c *Client) Query( file workspaceapi.URI, query string, captureNames []string, ) (iterator.Iterator[syntaxapi.Result], error)
Query satisfies syntaxapi.Parser.
func (*Client) QueryNode ¶ added in v0.0.14
func (c *Client) QueryNode( file workspaceapi.URI, nodeTypes syntaxapi.NodeCaptureName, ) (iterator.Iterator[syntaxapi.Result], error)
QueryNode satisfies syntaxapi.Parser.
func (*Client) Search ¶
func (c *Client) Search( query string, captureNames []string, languages ...string, ) (iterator.Iterator[syntaxapi.Result], error)
Search satisfies syntaxapi.Parser.
func (*Client) SearchNode ¶ added in v0.0.14
func (c *Client) SearchNode( nodeTypes syntaxapi.NodeCaptureName, ) (iterator.Iterator[syntaxapi.Result], error)
SearchNode satisfies syntaxapi.Parser.
type HighlightRequest ¶ added in v0.0.24
type HighlightRequest struct {
Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
// contains filtered or unexported fields
}
func (*HighlightRequest) Descriptor
deprecated
added in
v0.0.24
func (*HighlightRequest) Descriptor() ([]byte, []int)
Deprecated: Use HighlightRequest.ProtoReflect.Descriptor instead.
func (*HighlightRequest) GetContent ¶ added in v0.0.24
func (x *HighlightRequest) GetContent() string
func (*HighlightRequest) GetUri ¶ added in v0.0.24
func (x *HighlightRequest) GetUri() string
func (*HighlightRequest) ProtoMessage ¶ added in v0.0.24
func (*HighlightRequest) ProtoMessage()
func (*HighlightRequest) ProtoReflect ¶ added in v0.0.24
func (x *HighlightRequest) ProtoReflect() protoreflect.Message
func (*HighlightRequest) Reset ¶ added in v0.0.24
func (x *HighlightRequest) Reset()
func (*HighlightRequest) String ¶ added in v0.0.24
func (x *HighlightRequest) String() string
type HighlightResponse ¶ added in v0.0.24
type HighlightResponse struct {
From *termrpc.Coordinates `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
To *termrpc.Coordinates `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
Attr *termrpc.Attributes `protobuf:"bytes,3,opt,name=attr,proto3" json:"attr,omitempty"`
Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
// contains filtered or unexported fields
}
func (*HighlightResponse) Descriptor
deprecated
added in
v0.0.24
func (*HighlightResponse) Descriptor() ([]byte, []int)
Deprecated: Use HighlightResponse.ProtoReflect.Descriptor instead.
func (*HighlightResponse) GetAttr ¶ added in v0.0.24
func (x *HighlightResponse) GetAttr() *termrpc.Attributes
func (*HighlightResponse) GetFrom ¶ added in v0.0.24
func (x *HighlightResponse) GetFrom() *termrpc.Coordinates
func (*HighlightResponse) GetMessage ¶ added in v0.0.24
func (x *HighlightResponse) GetMessage() string
func (*HighlightResponse) GetTo ¶ added in v0.0.24
func (x *HighlightResponse) GetTo() *termrpc.Coordinates
func (*HighlightResponse) ProtoMessage ¶ added in v0.0.24
func (*HighlightResponse) ProtoMessage()
func (*HighlightResponse) ProtoReflect ¶ added in v0.0.24
func (x *HighlightResponse) ProtoReflect() protoreflect.Message
func (*HighlightResponse) Reset ¶ added in v0.0.24
func (x *HighlightResponse) Reset()
func (*HighlightResponse) String ¶ added in v0.0.24
func (x *HighlightResponse) String() string
type QueryNodeRequest ¶ added in v0.0.14
type QueryNodeRequest struct {
Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
// Bitflags of node capture types to search for.
// Values: Scope=1, DefinitionNamespace=2, Reference=4, DefinitionFunc=8,
//
// DefinitionVar=16, DefinitionMethod=32, DefinitionType=64
NodeTypes uint32 `protobuf:"varint,2,opt,name=node_types,json=nodeTypes,proto3" json:"node_types,omitempty"`
// contains filtered or unexported fields
}
func (*QueryNodeRequest) Descriptor
deprecated
added in
v0.0.14
func (*QueryNodeRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryNodeRequest.ProtoReflect.Descriptor instead.
func (*QueryNodeRequest) GetNodeTypes ¶ added in v0.0.14
func (x *QueryNodeRequest) GetNodeTypes() uint32
func (*QueryNodeRequest) GetUri ¶ added in v0.0.14
func (x *QueryNodeRequest) GetUri() string
func (*QueryNodeRequest) ProtoMessage ¶ added in v0.0.14
func (*QueryNodeRequest) ProtoMessage()
func (*QueryNodeRequest) ProtoReflect ¶ added in v0.0.14
func (x *QueryNodeRequest) ProtoReflect() protoreflect.Message
func (*QueryNodeRequest) Reset ¶ added in v0.0.14
func (x *QueryNodeRequest) Reset()
func (*QueryNodeRequest) String ¶ added in v0.0.14
func (x *QueryNodeRequest) String() string
type QueryRequest ¶ added in v0.0.14
type QueryRequest struct {
Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`
CaptureNames []string `protobuf:"bytes,3,rep,name=capture_names,json=captureNames,proto3" json:"capture_names,omitempty"`
// contains filtered or unexported fields
}
func (*QueryRequest) Descriptor
deprecated
added in
v0.0.14
func (*QueryRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
func (*QueryRequest) GetCaptureNames ¶ added in v0.0.14
func (x *QueryRequest) GetCaptureNames() []string
func (*QueryRequest) GetQuery ¶ added in v0.0.14
func (x *QueryRequest) GetQuery() string
func (*QueryRequest) GetUri ¶ added in v0.0.14
func (x *QueryRequest) GetUri() string
func (*QueryRequest) ProtoMessage ¶ added in v0.0.14
func (*QueryRequest) ProtoMessage()
func (*QueryRequest) ProtoReflect ¶ added in v0.0.14
func (x *QueryRequest) ProtoReflect() protoreflect.Message
func (*QueryRequest) Reset ¶ added in v0.0.14
func (x *QueryRequest) Reset()
func (*QueryRequest) String ¶ added in v0.0.14
func (x *QueryRequest) String() string
type SearchNodeRequest ¶ added in v0.0.14
type SearchNodeRequest struct {
// Bitflags of node capture types to search for.
// Values: Scope=1, DefinitionNamespace=2, Reference=4, DefinitionFunc=8,
//
// DefinitionVar=16, DefinitionMethod=32, DefinitionType=64
NodeTypes uint32 `protobuf:"varint,1,opt,name=node_types,json=nodeTypes,proto3" json:"node_types,omitempty"`
// contains filtered or unexported fields
}
func (*SearchNodeRequest) Descriptor
deprecated
added in
v0.0.14
func (*SearchNodeRequest) Descriptor() ([]byte, []int)
Deprecated: Use SearchNodeRequest.ProtoReflect.Descriptor instead.
func (*SearchNodeRequest) GetNodeTypes ¶ added in v0.0.14
func (x *SearchNodeRequest) GetNodeTypes() uint32
func (*SearchNodeRequest) ProtoMessage ¶ added in v0.0.14
func (*SearchNodeRequest) ProtoMessage()
func (*SearchNodeRequest) ProtoReflect ¶ added in v0.0.14
func (x *SearchNodeRequest) ProtoReflect() protoreflect.Message
func (*SearchNodeRequest) Reset ¶ added in v0.0.14
func (x *SearchNodeRequest) Reset()
func (*SearchNodeRequest) String ¶ added in v0.0.14
func (x *SearchNodeRequest) String() string
type SearchRequest ¶
type SearchRequest struct {
Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
CaptureNames []string `protobuf:"bytes,2,rep,name=capture_names,json=captureNames,proto3" json:"capture_names,omitempty"`
Languages []string `protobuf:"bytes,3,rep,name=languages,proto3" json:"languages,omitempty"`
// contains filtered or unexported fields
}
func (*SearchRequest) Descriptor
deprecated
func (*SearchRequest) Descriptor() ([]byte, []int)
Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) GetCaptureNames ¶
func (x *SearchRequest) GetCaptureNames() []string
func (*SearchRequest) GetLanguages ¶ added in v0.0.45
func (x *SearchRequest) GetLanguages() []string
func (*SearchRequest) GetQuery ¶
func (x *SearchRequest) GetQuery() string
func (*SearchRequest) ProtoMessage ¶
func (*SearchRequest) ProtoMessage()
func (*SearchRequest) ProtoReflect ¶
func (x *SearchRequest) ProtoReflect() protoreflect.Message
func (*SearchRequest) Reset ¶
func (x *SearchRequest) Reset()
func (*SearchRequest) String ¶
func (x *SearchRequest) String() string
type SearchResponse ¶
type SearchResponse struct {
Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
From *termrpc.Coordinates `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"`
To *termrpc.Coordinates `protobuf:"bytes,5,opt,name=to,proto3" json:"to,omitempty"`
CaptureName string `protobuf:"bytes,6,opt,name=capture_name,json=captureName,proto3" json:"capture_name,omitempty"`
// contains filtered or unexported fields
}
func (*SearchResponse) Descriptor
deprecated
func (*SearchResponse) Descriptor() ([]byte, []int)
Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead.
func (*SearchResponse) GetCaptureName ¶ added in v0.0.13
func (x *SearchResponse) GetCaptureName() string
func (*SearchResponse) GetFrom ¶ added in v0.0.13
func (x *SearchResponse) GetFrom() *termrpc.Coordinates
func (*SearchResponse) GetText ¶
func (x *SearchResponse) GetText() string
func (*SearchResponse) GetTo ¶ added in v0.0.13
func (x *SearchResponse) GetTo() *termrpc.Coordinates
func (*SearchResponse) GetUri ¶
func (x *SearchResponse) GetUri() string
func (*SearchResponse) ProtoMessage ¶
func (*SearchResponse) ProtoMessage()
func (*SearchResponse) ProtoReflect ¶
func (x *SearchResponse) ProtoReflect() protoreflect.Message
func (*SearchResponse) Reset ¶
func (x *SearchResponse) Reset()
func (*SearchResponse) String ¶
func (x *SearchResponse) String() string
type SyntaxClient ¶
type SyntaxClient interface {
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SearchResponse], error)
SearchNode(ctx context.Context, in *SearchNodeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SearchResponse], error)
Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SearchResponse], error)
QueryNode(ctx context.Context, in *QueryNodeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SearchResponse], error)
Highlight(ctx context.Context, in *HighlightRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[HighlightResponse], error)
}
SyntaxClient is the client API for Syntax service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewSyntaxClient ¶
func NewSyntaxClient(cc grpc.ClientConnInterface) SyntaxClient
type SyntaxServer ¶
type SyntaxServer interface {
Search(*SearchRequest, grpc.ServerStreamingServer[SearchResponse]) error
SearchNode(*SearchNodeRequest, grpc.ServerStreamingServer[SearchResponse]) error
Query(*QueryRequest, grpc.ServerStreamingServer[SearchResponse]) error
QueryNode(*QueryNodeRequest, grpc.ServerStreamingServer[SearchResponse]) error
Highlight(*HighlightRequest, grpc.ServerStreamingServer[HighlightResponse]) error
// contains filtered or unexported methods
}
SyntaxServer is the server API for Syntax service. All implementations must embed UnimplementedSyntaxServer for forward compatibility.
type Syntax_HighlightClient ¶ added in v0.0.24
type Syntax_HighlightClient = grpc.ServerStreamingClient[HighlightResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Syntax_HighlightServer ¶ added in v0.0.24
type Syntax_HighlightServer = grpc.ServerStreamingServer[HighlightResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Syntax_QueryClient ¶ added in v0.0.14
type Syntax_QueryClient = grpc.ServerStreamingClient[SearchResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Syntax_QueryNodeClient ¶ added in v0.0.14
type Syntax_QueryNodeClient = grpc.ServerStreamingClient[SearchResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Syntax_QueryNodeServer ¶ added in v0.0.14
type Syntax_QueryNodeServer = grpc.ServerStreamingServer[SearchResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Syntax_QueryServer ¶ added in v0.0.14
type Syntax_QueryServer = grpc.ServerStreamingServer[SearchResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Syntax_SearchClient ¶
type Syntax_SearchClient = grpc.ServerStreamingClient[SearchResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Syntax_SearchNodeClient ¶ added in v0.0.14
type Syntax_SearchNodeClient = grpc.ServerStreamingClient[SearchResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Syntax_SearchNodeServer ¶ added in v0.0.14
type Syntax_SearchNodeServer = grpc.ServerStreamingServer[SearchResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Syntax_SearchServer ¶
type Syntax_SearchServer = grpc.ServerStreamingServer[SearchResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type UnimplementedSyntaxServer ¶
type UnimplementedSyntaxServer struct{}
UnimplementedSyntaxServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedSyntaxServer) Highlight ¶ added in v0.0.24
func (UnimplementedSyntaxServer) Highlight(*HighlightRequest, grpc.ServerStreamingServer[HighlightResponse]) error
func (UnimplementedSyntaxServer) Query ¶ added in v0.0.14
func (UnimplementedSyntaxServer) Query(*QueryRequest, grpc.ServerStreamingServer[SearchResponse]) error
func (UnimplementedSyntaxServer) QueryNode ¶ added in v0.0.14
func (UnimplementedSyntaxServer) QueryNode(*QueryNodeRequest, grpc.ServerStreamingServer[SearchResponse]) error
func (UnimplementedSyntaxServer) Search ¶
func (UnimplementedSyntaxServer) Search(*SearchRequest, grpc.ServerStreamingServer[SearchResponse]) error
func (UnimplementedSyntaxServer) SearchNode ¶ added in v0.0.14
func (UnimplementedSyntaxServer) SearchNode(*SearchNodeRequest, grpc.ServerStreamingServer[SearchResponse]) error
type UnsafeSyntaxServer ¶
type UnsafeSyntaxServer interface {
// contains filtered or unexported methods
}
UnsafeSyntaxServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SyntaxServer will result in compilation errors.