1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 00:42:33 +03:00
semantic/proto/semantic.proto
2020-03-04 13:48:32 -08:00

208 lines
3.3 KiB
Protocol Buffer

syntax = "proto3";
package github.semantic;
option ruby_package = "Semantic::Proto";
message PingRequest {
string service = 1;
}
message PingResponse {
string status = 1;
string hostname = 2;
string timestamp = 3;
string sha = 4;
}
message ParseTreeRequest {
repeated Blob blobs = 1;
}
message ParseTreeSymbolResponse {
repeated File files = 1;
}
message ParseTreeGraphResponse {
repeated ParseTreeFileGraph files = 1;
}
message ParseTreeStackGraphResponse {
repeated StackGraphFile files = 1;
}
message ParseTreeFileGraph {
string path = 1;
string language = 2;
repeated TermVertex vertices = 3;
repeated TermEdge edges = 4;
repeated ParseError errors = 5;
}
message TermEdge {
int32 source = 1;
int32 target = 2;
}
message TermVertex {
int32 vertex_id = 1;
string term = 2;
Span span = 3;
}
message ParseError {
string error = 1;
}
message DiffTreeRequest {
repeated BlobPair blobs = 1;
}
message DiffTreeTOCResponse {
repeated TOCSummaryFile files = 1;
}
message TOCSummaryFile {
string path = 1;
string language = 2;
repeated TOCSummaryChange changes = 3;
repeated TOCSummaryError errors = 4;
}
message TOCSummaryChange {
string category = 1;
string term = 2;
Span span = 3;
ChangeType change_type = 4;
}
message TOCSummaryError {
string error = 1;
Span span = 2;
}
enum ChangeType {
NONE = 0;
ADDED = 1;
REMOVED = 2;
MODIFIED = 3;
}
message DiffTreeGraphResponse {
repeated DiffTreeFileGraph files = 1;
}
message DiffTreeFileGraph {
string path = 1;
string language = 2;
repeated DiffTreeVertex vertices = 3;
repeated DiffTreeEdge edges = 4;
repeated ParseError errors = 5;
}
message DiffTreeEdge {
int32 source = 1;
int32 target = 2;
}
message DiffTreeVertex {
int32 diff_vertex_id = 1;
oneof diff_term {
DeletedTerm deleted = 2;
InsertedTerm inserted = 3;
ReplacedTerm replaced = 4;
MergedTerm merged = 5;
}
}
message DeletedTerm {
string term = 1;
Span span = 2;
}
message InsertedTerm {
string term = 1;
Span span = 2;
}
message ReplacedTerm {
string before_term = 1;
Span before_span = 2;
string after_term = 3;
Span after_span = 4;
}
message MergedTerm {
string term = 1;
Span before_span = 2;
Span after_span = 3;
}
message Blob {
string content = 1;
string path = 2;
string language = 3;
}
message BlobPair {
Blob before = 1;
Blob after = 2;
}
message File {
string path = 1;
string language = 2;
repeated Symbol symbols = 3;
repeated ParseError errors = 4;
string blob_oid = 5;
}
message Symbol {
string symbol = 1;
string kind = 2;
string line = 3;
Span span = 4;
Docstring docs = 5;
}
message Docstring {
string docstring = 1;
}
message Position {
int32 line = 1;
int32 column = 2;
}
message Span {
Position start = 1;
Position end = 2;
}
message StackGraphFile {
string path = 1;
string language = 2;
repeated StackGraphNode nodes = 3;
repeated StackGraphPath paths = 4;
repeated ParseError errors = 5;
}
message StackGraphNode {
int64 id = 1;
string name = 2;
string line = 3;
string kind = 4;
bool is_definition = 5;
Span span = 6;
}
message StackGraphPath {
string starting_symbol_stack = 1;
int64 starting_scope_stack_size = 2;
int64 from = 3;
string edges = 4;
int64 to = 5;
string ending_scope_stack = 6;
string ending_symbol_stack = 7;
}