mirror of
https://github.com/github/semantic.git
synced 2024-12-29 18:06:14 +03:00
163 lines
3.0 KiB
Protocol Buffer
163 lines
3.0 KiB
Protocol Buffer
// This file was generated by proto-gen. Do not edit by hand.
|
|
syntax = "proto3";
|
|
|
|
package github.semantic;
|
|
|
|
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 {
|
|
// Check health & status of the service.
|
|
rpc Ping (PingRequest) returns (PingResponse);
|
|
// Calculate c-tags like symbols for blobs.
|
|
rpc ParseTreeSymbols (ParseTreeRequest) returns (ParseTreeSymbolResponse);
|
|
// Calculate table of contents style diff summaries.
|
|
rpc DiffTreeTOC (DiffTreeRequest) returns (DiffTreeTOCResponse);
|
|
// Tree diffs in adjacency graph representation.
|
|
rpc DiffTreeGraph (DiffTreeRequest) returns (DiffTreeGraphResponse);
|
|
}
|
|
|
|
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 DiffTreeRequest {
|
|
repeated BlobPair blobs = 1;
|
|
}
|
|
|
|
message DiffTreeTOCResponse {
|
|
repeated TOCSummaryFile files = 1;
|
|
}
|
|
|
|
message TOCSummaryFile {
|
|
string filePath = 1;
|
|
string fileLanguage = 2;
|
|
repeated TOCSummaryChange fileChanges = 3;
|
|
repeated TOCSummaryError fileErrors = 4;
|
|
}
|
|
|
|
message TOCSummaryChange {
|
|
string category = 1;
|
|
string term = 2;
|
|
Span span = 3;
|
|
string changeType = 4;
|
|
}
|
|
|
|
message TOCSummaryError {
|
|
string error = 1;
|
|
Span span = 2;
|
|
}
|
|
|
|
message DiffTreeGraphResponse {
|
|
repeated DiffTreeVertex vertices = 1;
|
|
repeated DiffTreeEdge edges = 2;
|
|
}
|
|
|
|
message DiffTreeEdge {
|
|
int64 source = 1;
|
|
int64 target = 2;
|
|
}
|
|
|
|
message DiffTreeVertex {
|
|
int64 diffVertexId = 1;
|
|
DiffTreeTerm term = 2;
|
|
}
|
|
|
|
message DiffTreeTerm {
|
|
oneof sum {
|
|
DeletedTerm deletedTerm = 1;
|
|
InsertedTerm insertedTerm = 2;
|
|
ReplacedTerm replacedTerm = 3;
|
|
MergedTerm mergedTerm = 4;
|
|
}
|
|
}
|
|
|
|
message DeletedTerm {
|
|
string deletedTermName = 1;
|
|
Span beforeSpan = 2;
|
|
}
|
|
|
|
message InsertedTerm {
|
|
string insertedTermName = 1;
|
|
Span afterSpan = 2;
|
|
}
|
|
|
|
message ReplacedTerm {
|
|
string beforeTermName = 1;
|
|
Span beforeSpan = 2;
|
|
string afterTermName = 3;
|
|
Span afterSpan = 4;
|
|
}
|
|
|
|
message MergedTerm {
|
|
string mergedTermName = 1;
|
|
Span beforeSpan = 2;
|
|
Span afterSpan = 3;
|
|
}
|
|
|
|
enum Language {
|
|
UNKNOWN = 0;
|
|
GO = 1;
|
|
HASKELL = 2;
|
|
JAVA = 3;
|
|
JAVASCRIPT = 4;
|
|
JSON = 5;
|
|
JSX = 6;
|
|
MARKDOWN = 7;
|
|
PYTHON = 8;
|
|
RUBY = 9;
|
|
TYPESCRIPT = 10;
|
|
PHP = 11;
|
|
}
|
|
|
|
message Blob {
|
|
bytes blobSource = 1;
|
|
string blobPath = 2;
|
|
Language blobLanguage = 3;
|
|
}
|
|
|
|
message BlobPair {
|
|
Blob before = 1;
|
|
Blob after = 2;
|
|
}
|
|
|
|
message File {
|
|
string filePath = 1;
|
|
string fileLanguage = 2;
|
|
repeated Symbol fileSymbols = 3;
|
|
}
|
|
|
|
message Symbol {
|
|
string symbolName = 1;
|
|
string symbolKind = 2;
|
|
string symbolLine = 3;
|
|
Span symbolSpan = 4;
|
|
}
|
|
|
|
message Position {
|
|
int64 line = 1;
|
|
int64 column = 2;
|
|
}
|
|
|
|
message Span {
|
|
Position start = 1;
|
|
Position end = 2;
|
|
}
|