mirror of
https://github.com/github/semantic.git
synced 2024-12-20 21:31:48 +03:00
191 lines
4.0 KiB
Protocol Buffer
191 lines
4.0 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package github.semantic;
|
|
|
|
import "go_term.proto";
|
|
import "java_term.proto";
|
|
import "json_term.proto";
|
|
import "python_diff.proto";
|
|
import "python_term.proto";
|
|
import "ruby_diff.proto";
|
|
import "ruby_term.proto";
|
|
import "typescript_diff.proto";
|
|
import "typescript_term.proto";
|
|
import "types.proto";
|
|
import "error_details.proto";
|
|
|
|
option java_package = "com.github.semantic.analysis";
|
|
option go_package = "github.com/semantic/analysis/;analysis";
|
|
|
|
|
|
// Semantic's CodeAnalysis service provides endpoints for parsing, analyzing, and
|
|
// comparing source code.
|
|
service CodeAnalysis {
|
|
// Parsing
|
|
//
|
|
// Parse source code blobs and return abstract syntax trees as adjacency list graph.
|
|
rpc ParseTreeGraph (ParseTreeRequest) returns (ParseTreeGraphResponse);
|
|
// Parse source code blobs and return abstract syntax trees.
|
|
rpc ParseTree (ParseTreeRequest) returns (ParseTreeResponse);
|
|
|
|
// Diffing
|
|
//
|
|
// Summarize an AST diff of source blobs.
|
|
rpc SummarizeDiff (SummarizeDiffRequest) returns (SummarizeDiffResponse);
|
|
// Diff the ASTs of source blobs
|
|
rpc DiffTree (DiffTreeRequest) returns (DiffTreeResponse);
|
|
|
|
// Analyzing
|
|
//
|
|
// Calculate an import graph for a project.
|
|
rpc GraphImports (ImportGraphRequest) returns (ImportGraphResponse);
|
|
|
|
// Calculate a call graph for a project.
|
|
rpc GraphCalls (CallGraphRequest) returns (CallGraphResponse);
|
|
|
|
// Status and Health
|
|
//
|
|
// Check health & status of the service.
|
|
rpc CheckHealth (HealthCheckRequest) returns (HealthCheckResponse);
|
|
}
|
|
|
|
// Term Requests and Responses
|
|
//
|
|
message ParseTreeRequest {
|
|
repeated Blob blobs = 1;
|
|
}
|
|
|
|
message ParseTreeGraphResponse {
|
|
ParseTreeGraph response = 1;
|
|
DebugInfo error_info = 2;
|
|
}
|
|
|
|
message ParseTreeGraph {
|
|
repeated TermGraph graphs = 1;
|
|
repeated DebugInfo error_info = 2;
|
|
}
|
|
|
|
|
|
message ParseTreeResponse {
|
|
DebugInfo error_info = 1;
|
|
oneof response_type {
|
|
GoResponse go = 2;
|
|
JavaResponse java = 3;
|
|
JSONResponse json = 4;
|
|
PythonResponse python = 5;
|
|
RubyResponse ruby = 6;
|
|
TypeScriptResponse typescript = 7;
|
|
}
|
|
}
|
|
|
|
message GoResponse {
|
|
repeated goterm.GoTerm terms = 1;
|
|
repeated DebugInfo errors = 2;
|
|
}
|
|
|
|
message JavaResponse {
|
|
repeated javaterm.JavaTerm terms = 1;
|
|
repeated DebugInfo errors = 2;
|
|
}
|
|
|
|
message JSONResponse {
|
|
repeated jsonterm.JSONTerm terms = 1;
|
|
repeated DebugInfo errors = 2;
|
|
}
|
|
|
|
message PythonResponse {
|
|
repeated pythonterm.PythonTerm terms = 1;
|
|
repeated DebugInfo errors = 2;
|
|
}
|
|
|
|
message RubyResponse {
|
|
repeated rubyterm.RubyTerm terms = 1;
|
|
repeated DebugInfo errors = 2;
|
|
}
|
|
|
|
message TypeScriptResponse {
|
|
repeated typescriptterm.TypeScriptTerm terms = 1;
|
|
repeated DebugInfo errors = 2;
|
|
}
|
|
|
|
// Diff Request & Responses
|
|
//
|
|
message SummarizeDiffRequest {
|
|
repeated BlobPair blobPairs = 1;
|
|
}
|
|
|
|
message SummarizeDiffResponse {
|
|
repeated DiffSummary changes = 1;
|
|
repeated ParseError errors = 2;
|
|
DebugInfo error_info = 3;
|
|
}
|
|
|
|
message DiffTreeRequest {
|
|
repeated BlobPair blobPairs = 1;
|
|
}
|
|
|
|
message DiffTreeResponse {
|
|
oneof response_type {
|
|
RubyDiffResponse ruby = 1;
|
|
PythonDiffResponse python = 2;
|
|
TypeScriptDiffResponse typescript = 3;
|
|
}
|
|
DebugInfo error_info = 4;
|
|
}
|
|
|
|
message RubyDiffResponse {
|
|
repeated rubydiff.RubyDiff diffs = 1;
|
|
}
|
|
|
|
message PythonDiffResponse {
|
|
repeated pythondiff.PythonDiff diffs = 1;
|
|
}
|
|
|
|
message TypeScriptDiffResponse {
|
|
repeated typescriptdiff.TypeScriptDiff diffs = 1;
|
|
}
|
|
|
|
message CallGraphRequest {
|
|
Project project = 1;
|
|
}
|
|
|
|
message CallGraphResponse {
|
|
ControlFlowGraph graph = 1;
|
|
DebugInfo error_info = 2;
|
|
}
|
|
|
|
message ImportGraphRequest {
|
|
Project project = 1;
|
|
}
|
|
|
|
message ImportGraphResponse {
|
|
ControlFlowGraph graph = 1;
|
|
DebugInfo error_info = 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;
|
|
}
|