2018-06-13 01:15:36 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
import "types.proto";
|
|
|
|
package github.semantic.v1alpha1;
|
|
|
|
|
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-06-13 01:29:41 +03:00
|
|
|
// Parse source code blobs and return abstract syntax trees.
|
2018-06-13 01:15:36 +03:00
|
|
|
rpc Parse (ParseTreeRequest) returns (ParseTreeResponse);
|
2018-06-14 22:56:37 +03:00
|
|
|
rpc ParseRaw (ParseTreeRequest) returns (RawParseTreeResponse);
|
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-06-13 01:29:41 +03:00
|
|
|
// AST diff of source blobs
|
2018-06-13 01:15:36 +03:00
|
|
|
// rpc Diff (DiffRequest) returns (DiffResponse) {}
|
|
|
|
|
|
|
|
// Analyzing
|
|
|
|
//
|
|
|
|
// Calculate an import graph for a project.
|
|
|
|
// rpc GraphImports (ImportGraphRequest) returns (ImportGraphResponse);
|
|
|
|
// rpc GraphCalls (CallGraphRequest) returns (CallGraphResponse);
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
message ParseTreeRequest {
|
|
|
|
repeated Blob blobs = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ParseTreeResponse {
|
|
|
|
bytes json_tree = 1;
|
|
|
|
repeated ParseError errors = 2;
|
|
|
|
}
|
|
|
|
|
2018-06-14 22:56:37 +03:00
|
|
|
message RawParseTreeResponse {
|
|
|
|
repeated Term terms = 1;
|
|
|
|
}
|
|
|
|
|
2018-06-13 01:15:36 +03:00
|
|
|
message SummarizeDiffRequest {
|
|
|
|
repeated BlobPair blobPairs = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SummarizeDiffResponse {
|
|
|
|
repeated DiffSummary changes = 1;
|
|
|
|
repeated ParseError errors = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message BlobPair {
|
|
|
|
Blob before = 1;
|
|
|
|
Blob after = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|