2018-06-13 01:15:36 +03:00
|
|
|
syntax = "proto3";
|
2018-07-04 00:21:46 +03:00
|
|
|
|
|
|
|
package github.semantic;
|
|
|
|
|
2018-08-30 21:16:40 +03:00
|
|
|
import "python_diff.proto";
|
2018-09-08 01:12:47 +03:00
|
|
|
import "ruby_diff.proto";
|
|
|
|
import "typescript_diff.proto";
|
2018-06-26 17:48:34 +03:00
|
|
|
|
2018-09-10 21:15:52 +03:00
|
|
|
import "types.proto";
|
2018-09-10 21:43:42 +03:00
|
|
|
import "terms.proto";
|
|
|
|
import "error_details.proto";
|
2018-09-10 21:15:52 +03:00
|
|
|
|
2018-06-26 17:50:38 +03:00
|
|
|
option java_package = "com.github.semantic.analysis";
|
|
|
|
option go_package = "github.com/semantic/analysis/;analysis";
|
2018-07-04 00:21:46 +03:00
|
|
|
|
2018-06-13 01:15:36 +03:00
|
|
|
|
2018-06-13 01:29:41 +03:00
|
|
|
// Semantic's CodeAnalysis service provides endpoints for parsing, analyzing, and
|
2018-06-13 01:15:36 +03:00
|
|
|
// comparing source code.
|
|
|
|
service CodeAnalysis {
|
|
|
|
// Parsing
|
|
|
|
//
|
2018-09-07 18:59:41 +03:00
|
|
|
// Parse source code blobs and return abstract syntax trees as adjacency list graph.
|
|
|
|
rpc ParseTreeGraph (ParseTreeRequest) returns (ParseTreeGraphResponse);
|
2018-06-13 01:29:41 +03:00
|
|
|
// Parse source code blobs and return abstract syntax trees.
|
2018-07-03 18:33:12 +03:00
|
|
|
rpc ParseTree (ParseTreeRequest) returns (ParseTreeResponse);
|
2018-06-13 01:15:36 +03:00
|
|
|
|
|
|
|
// Diffing
|
|
|
|
//
|
2018-06-13 01:29:41 +03:00
|
|
|
// Summarize an AST diff of source blobs.
|
2018-06-13 01:15:36 +03:00
|
|
|
rpc SummarizeDiff (SummarizeDiffRequest) returns (SummarizeDiffResponse);
|
2018-07-13 19:37:16 +03:00
|
|
|
// Diff the ASTs of source blobs
|
|
|
|
rpc DiffTree (DiffTreeRequest) returns (DiffTreeResponse);
|
2018-06-13 01:15:36 +03:00
|
|
|
|
|
|
|
// Analyzing
|
|
|
|
//
|
|
|
|
// Calculate an import graph for a project.
|
2018-06-13 21:10:18 +03:00
|
|
|
rpc GraphImports (ImportGraphRequest) returns (ImportGraphResponse);
|
|
|
|
|
2018-08-30 20:18:49 +03:00
|
|
|
// Calculate a call graph for a project.
|
2018-07-17 17:15:04 +03:00
|
|
|
rpc GraphCalls (CallGraphRequest) returns (CallGraphResponse);
|
2018-06-13 01:15:36 +03:00
|
|
|
|
2018-08-30 20:18:49 +03:00
|
|
|
// Status and Health
|
|
|
|
//
|
2018-06-13 01:29:41 +03:00
|
|
|
// Check health & status of the service.
|
2018-06-13 01:15:36 +03:00
|
|
|
rpc CheckHealth (HealthCheckRequest) returns (HealthCheckResponse);
|
|
|
|
}
|
|
|
|
|
2018-09-08 01:12:47 +03:00
|
|
|
// Term Requests and Responses
|
|
|
|
//
|
2018-06-13 01:15:36 +03:00
|
|
|
message ParseTreeRequest {
|
|
|
|
repeated Blob blobs = 1;
|
|
|
|
}
|
|
|
|
|
2018-09-11 03:15:46 +03:00
|
|
|
// A ParseTreeResponse contains a list of syntax trees represented as adjacency
|
|
|
|
// graphs, one for each blob passed in the request.
|
2018-09-07 18:59:41 +03:00
|
|
|
message ParseTreeGraphResponse {
|
2018-09-11 03:15:46 +03:00
|
|
|
// The list of graphs.
|
|
|
|
repeated ParseTreeGraph graphs = 1;
|
|
|
|
// Entire response failed (e.g. a timeout)
|
2018-09-07 18:59:41 +03:00
|
|
|
DebugInfo error_info = 2;
|
|
|
|
}
|
|
|
|
|
2018-09-07 21:25:19 +03:00
|
|
|
message ParseTreeGraph {
|
2018-09-11 03:15:46 +03:00
|
|
|
TermGraph graph = 1;
|
|
|
|
string error = 2;
|
2018-09-07 21:25:19 +03:00
|
|
|
}
|
|
|
|
|
2018-09-10 21:43:42 +03:00
|
|
|
// A ParseTreeResponse contains a list of syntax trees, one for each blob passed
|
|
|
|
// in the request.
|
2018-06-13 01:15:36 +03:00
|
|
|
message ParseTreeResponse {
|
2018-09-10 21:43:42 +03:00
|
|
|
// The list of trees.
|
2018-09-10 21:15:52 +03:00
|
|
|
repeated ParseTree trees = 1;
|
2018-09-10 21:43:42 +03:00
|
|
|
// Entire response failed (e.g. a timeout)
|
|
|
|
DebugInfo error_info = 2;
|
2018-07-02 18:29:44 +03:00
|
|
|
}
|
|
|
|
|
2018-09-08 01:12:47 +03:00
|
|
|
// Diff Request & Responses
|
|
|
|
//
|
2018-06-13 01:15:36 +03:00
|
|
|
message SummarizeDiffRequest {
|
|
|
|
repeated BlobPair blobPairs = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SummarizeDiffResponse {
|
|
|
|
repeated DiffSummary changes = 1;
|
|
|
|
repeated ParseError errors = 2;
|
2018-08-23 01:41:27 +03:00
|
|
|
DebugInfo error_info = 3;
|
2018-06-13 01:15:36 +03:00
|
|
|
}
|
|
|
|
|
2018-07-13 19:37:16 +03:00
|
|
|
message DiffTreeRequest {
|
|
|
|
repeated BlobPair blobPairs = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DiffTreeResponse {
|
|
|
|
oneof response_type {
|
|
|
|
RubyDiffResponse ruby = 1;
|
2018-07-24 00:39:08 +03:00
|
|
|
PythonDiffResponse python = 2;
|
2018-07-24 01:11:24 +03:00
|
|
|
TypeScriptDiffResponse typescript = 3;
|
2018-07-13 19:37:16 +03:00
|
|
|
}
|
2018-08-24 20:11:38 +03:00
|
|
|
DebugInfo error_info = 4;
|
2018-07-13 19:37:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message RubyDiffResponse {
|
2018-08-30 21:16:40 +03:00
|
|
|
repeated rubydiff.RubyDiff diffs = 1;
|
2018-07-13 19:37:16 +03:00
|
|
|
}
|
|
|
|
|
2018-07-24 00:39:08 +03:00
|
|
|
message PythonDiffResponse {
|
2018-08-30 21:16:40 +03:00
|
|
|
repeated pythondiff.PythonDiff diffs = 1;
|
2018-07-24 00:39:08 +03:00
|
|
|
}
|
|
|
|
|
2018-07-24 01:11:24 +03:00
|
|
|
message TypeScriptDiffResponse {
|
2018-08-30 21:16:40 +03:00
|
|
|
repeated typescriptdiff.TypeScriptDiff diffs = 1;
|
2018-07-24 01:11:24 +03:00
|
|
|
}
|
|
|
|
|
2018-07-17 17:15:04 +03:00
|
|
|
message CallGraphRequest {
|
|
|
|
Project project = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CallGraphResponse {
|
2018-09-07 01:13:08 +03:00
|
|
|
ControlFlowGraph graph = 1;
|
2018-07-17 17:15:04 +03:00
|
|
|
DebugInfo error_info = 2;
|
|
|
|
}
|
|
|
|
|
2018-06-13 21:10:18 +03:00
|
|
|
message ImportGraphRequest {
|
|
|
|
Project project = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ImportGraphResponse {
|
2018-09-07 01:13:08 +03:00
|
|
|
ControlFlowGraph graph = 1;
|
2018-06-26 17:48:34 +03:00
|
|
|
DebugInfo error_info = 2;
|
2018-06-13 21:10:18 +03:00
|
|
|
}
|
|
|
|
|
2018-06-13 01:15:36 +03:00
|
|
|
message DiffSummary {
|
|
|
|
string term = 1;
|
|
|
|
string name = 2;
|
|
|
|
Span span = 3;
|
|
|
|
string change = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ParseError {
|
|
|
|
string error = 1;
|
|
|
|
Span span = 2;
|
|
|
|
string language = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message HealthCheckRequest {
|
|
|
|
string service = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message HealthCheckResponse {
|
|
|
|
enum ServingStatus {
|
|
|
|
UNKNOWN = 0;
|
|
|
|
SERVING = 1;
|
|
|
|
NOT_SERVING = 2;
|
|
|
|
}
|
|
|
|
ServingStatus status = 1;
|
|
|
|
}
|