mirror of
https://github.com/github/semantic.git
synced 2024-12-18 12:21:57 +03:00
110 lines
2.2 KiB
Protocol Buffer
110 lines
2.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
import "ruby.proto";
|
|
import "json.proto";
|
|
import "typescript.proto";
|
|
import "types.proto";
|
|
import "error_details.proto";
|
|
|
|
option java_package = "com.github.semantic.analysis";
|
|
option go_package = "github.com/semantic/analysis/;analysis";
|
|
package github.semantic;
|
|
|
|
// 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.
|
|
rpc ParseTree (ParseTreeRequest) returns (ParseTreeResponse);
|
|
|
|
// Diffing
|
|
//
|
|
// Summarize an AST diff of source blobs.
|
|
rpc SummarizeDiff (SummarizeDiffRequest) returns (SummarizeDiffResponse);
|
|
// AST diff of source blobs
|
|
// rpc Diff (DiffRequest) returns (DiffResponse) {}
|
|
|
|
// Analyzing
|
|
//
|
|
// Calculate an import graph for a project.
|
|
rpc GraphImports (ImportGraphRequest) returns (ImportGraphResponse);
|
|
|
|
// rpc GraphCalls (CallGraphRequest) returns (CallGraphResponse);
|
|
|
|
// Check health & status of the service.
|
|
rpc CheckHealth (HealthCheckRequest) returns (HealthCheckResponse);
|
|
}
|
|
|
|
message ParseTreeRequest {
|
|
repeated Blob blobs = 1;
|
|
}
|
|
|
|
message ParseTreeResponse {
|
|
oneof response_type {
|
|
RubyResponse ruby = 1;
|
|
JSONResponse json = 2;
|
|
TypeScriptResponse typescript = 3;
|
|
}
|
|
}
|
|
|
|
message RubyResponse {
|
|
repeated ruby.RubyTerm terms = 1;
|
|
}
|
|
|
|
message JSONResponse {
|
|
repeated json.JSONTerm terms = 1;
|
|
}
|
|
|
|
message TypeScriptResponse {
|
|
repeated typescript.TypeScriptTerm terms = 1;
|
|
}
|
|
|
|
message SummarizeDiffRequest {
|
|
repeated BlobPair blobPairs = 1;
|
|
}
|
|
|
|
message SummarizeDiffResponse {
|
|
repeated DiffSummary changes = 1;
|
|
repeated ParseError errors = 2;
|
|
}
|
|
|
|
message ImportGraphRequest {
|
|
Project project = 1;
|
|
}
|
|
|
|
message ImportGraphResponse {
|
|
ImportGraph graph = 1;
|
|
DebugInfo error_info = 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;
|
|
}
|