All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ph.semanticdb-java.0.10.3.source-code.semanticdb.proto Maven / Gradle / Ivy

The newest version!
// Original source: https://github.com/scalameta/scalameta/blob/cf796cf2436b40494baf2bdc266623dc65264ad5/semanticdb/semanticdb/semanticdb.proto
// Local modifications:
// - Removes unused fields to minimize the amount of generated code.
// - Adds SymbolInformation.documentation that is pending upstream approval.

syntax = "proto3";

package com.sourcegraph.semanticdb_javac;

enum Schema {
  LEGACY = 0;
  SEMANTICDB3 = 3;
  SEMANTICDB4 = 4;
}

message TextDocuments {
  repeated TextDocument documents = 1;
}

message TextDocument {
  reserved 4, 8, 9;
  Schema schema = 1;
  string uri = 2;
  string text = 3;
  string md5 = 11;
  Language language = 10;
  repeated SymbolInformation symbols = 5;
  repeated SymbolOccurrence occurrences = 6;
  repeated Synthetic synthetics = 12;
}

enum Language {
  UNKNOWN_LANGUAGE = 0;
  SCALA = 1;
  JAVA = 2;
  KOTLIN = 3;
}

message Range {
  int32 start_line = 1;
  int32 start_character = 2;
  int32 end_line = 3;
  int32 end_character = 4;
}

message Signature {
  oneof sealed_value {
    ClassSignature class_signature = 1;
    MethodSignature method_signature = 2;
    TypeSignature type_signature = 3;
    ValueSignature value_signature = 4;
  }
}

message ClassSignature {
  Scope type_parameters = 1;
  repeated Type parents = 2;
  Scope declarations = 4;
}

message MethodSignature {
  Scope type_parameters = 1;
  repeated Scope parameter_lists = 2;
  Type return_type = 3;
  repeated Type throws = 4;
}

message TypeSignature {
  Scope type_parameters = 1;
  Type lower_bound = 2;
  Type upper_bound = 3;
}

message ValueSignature {
  Type tpe = 1;
}

message SymbolInformation {
  enum Kind {
    reserved 1, 2, 4, 5, 15, 16;
    UNKNOWN_KIND = 0;
    LOCAL = 19;
    FIELD = 20;
    METHOD = 3;
    CONSTRUCTOR = 21;
    MACRO = 6;
    TYPE = 7;
    PARAMETER = 8;
    SELF_PARAMETER = 17;
    TYPE_PARAMETER = 9;
    OBJECT = 10;
    PACKAGE = 11;
    PACKAGE_OBJECT = 12;
    CLASS = 13;
    TRAIT = 14;
    INTERFACE = 18;
  }
  enum Property {
    UNKNOWN_PROPERTY = 0;
    reserved 0x1;
    reserved 0x2;
    ABSTRACT = 0x4;
    FINAL = 0x8;
    SEALED = 0x10;
    IMPLICIT = 0x20;
    LAZY = 0x40;
    CASE = 0x80;
    COVARIANT = 0x100;
    CONTRAVARIANT = 0x200;
    VAL = 0x400;
    VAR = 0x800;
    STATIC = 0x1000;
    PRIMARY = 0x2000;
    ENUM = 0x4000;
    DEFAULT = 0x8000;
  }
  reserved 2, 6, 7, 8, 9, 10, 11, 12, 14;
  string symbol = 1;
  Language language = 16;
  Kind kind = 3;
  int32 properties = 4;
  string display_name = 5;
  // -- OUT OF SPEC -- //
  repeated AnnotationTree annotations = 13;
  // -- OUT OF SPEC -- //
  Signature signature = 17;
  Access access = 18;
  repeated string overridden_symbols = 19;
  Documentation documentation = 20;
  string enclosing_symbol = 15;

  // -- OUT OF SPEC -- //
  repeated string definition_relationships = 21;
  // -- OUT OF SPEC -- //
}

message Access {
  oneof sealed_value {
    PrivateAccess private_access = 1;
    PrivateThisAccess private_this_access = 2;
    PrivateWithinAccess private_within_access = 3;
    ProtectedAccess protected_access = 4;
    PublicAccess public_access = 7;
  }
}

message PrivateAccess {}

message PrivateWithinAccess {
  string symbol = 1;
}

message PrivateThisAccess {
}

message ProtectedAccess {}

message PublicAccess {}

message Documentation {
  enum Format {
    HTML = 0;
    MARKDOWN = 1;
    JAVADOC = 2;
    SCALADOC = 3;
    KDOC = 4;
  }
  string message = 1;
  Format format = 2;
}

message SymbolOccurrence {
  enum Role {
    UNKNOWN_ROLE = 0;
    REFERENCE = 1;
    DEFINITION = 2;
    // NOTE: this role does not exist in the upstream SemanticDB spec.
    // WE added SYNTHETIC_DEFINITION fix the following scip-java issue:
    // https://github.com/sourcegraph/scip-java/issues/399
    SYNTHETIC_DEFINITION = 3;
  }
  Range range = 1;
  string symbol = 2;
  Role role = 3;
}

message Scope {
  repeated string symlinks = 1;
  repeated SymbolInformation hardlinks = 2;
}

message Type {
  reserved 1, 3, 4, 5, 6, 11, 12, 15, 16;
  oneof sealed_value {
    TypeRef type_ref = 2;
    SingleType single_type = 20;
    ThisType this_type = 21;
    SuperType super_type = 22;
    ConstantType constant_type = 23;
    IntersectionType intersection_type = 17;
    UnionType union_type = 18;
    WithType with_type = 19;
    StructuralType structural_type = 7;
    AnnotatedType annotated_type = 8;
    ExistentialType existential_type = 9;
    UniversalType universal_type = 10;
    ByNameType by_name_type = 13;
    RepeatedType repeated_type = 14;
  }
}


message TypeRef {
  Type prefix = 1;
  string symbol = 2;
  repeated Type type_arguments = 3;
}

message SingleType {
  Type prefix = 1;
  string symbol = 2;
}

message ThisType {
  string symbol = 1;
}

message SuperType {
  Type prefix = 1;
  string symbol = 2;
}

message ConstantType {
  Constant constant = 1;
}

message IntersectionType {
  repeated Type types = 1;
}

message UnionType {
  repeated Type types = 1;
}

message WithType {
  repeated Type types = 1;
}

message StructuralType {
  reserved 1, 2, 3;
  Type tpe = 4;
  Scope declarations = 5;
}

message AnnotatedType {
  reserved 2;
  repeated AnnotationTree annotations = 3;
  Type tpe = 1;
}

message ExistentialType {
  reserved 2;
  Type tpe = 1;
  Scope declarations = 3;
}

message UniversalType {
  reserved 1;
  Scope type_parameters = 3;
  Type tpe = 2;
}

message ByNameType {
  Type tpe = 1;
}

message RepeatedType {
  Type tpe = 1;
}

message Synthetic {
  Range range = 1;
  Tree tree = 2;
}

message Tree {
  oneof sealed_value {
    ApplyTree apply_tree = 1;
    FunctionTree function_tree = 2;
    IdTree id_tree = 3;
    LiteralTree literal_tree = 4;
    MacroExpansionTree macro_expansion_tree = 5;
    OriginalTree original_tree = 6;
    SelectTree select_tree = 7;
    TypeApplyTree type_apply_tree = 8;
    // -- OUT OF SPEC -- //
    AnnotationTree annotation_tree = 9;
    AssignTree assign_tree = 10;
    BinaryOperatorTree binop_tree = 11;
    UnaryOperatorTree unaryop_tree = 12;
    // -- OUT OF SPEC -- //
  }
}

message ApplyTree {
  Tree function = 1;
  repeated Tree arguments = 2;
}


message FunctionTree {
  repeated IdTree parameters = 1;
  Tree body = 2;
}

message IdTree {
  string symbol = 1;
}


message LiteralTree {
  Constant constant = 1;
}

message MacroExpansionTree {
  Tree before_expansion = 1;
  Type tpe = 2;
}

message OriginalTree {
  Range range = 1;
}

message SelectTree {
  Tree qualifier = 1;
  IdTree id = 2;
}

message TypeApplyTree {
  Tree function = 1;
  repeated Type type_arguments = 2;
}

// -- OUT OF SPEC -- //
message AnnotationTree {
  Type tpe = 1;
  repeated Tree parameters = 2;
}

message AssignTree {
    Tree lhs = 1;
    Tree rhs = 2;
}

message BinaryOperatorTree {
  Tree lhs = 1;
  BinaryOperator op = 2;
  Tree rhs = 3;
}

enum BinaryOperator {
  PLUS = 0;
  MINUS = 1;
  MULTIPLY = 2;
  DIVIDE = 3;
  REMAINDER = 4;
  GREATER_THAN = 5;
  LESS_THAN = 6;
  AND = 7;
  XOR = 8;
  OR = 9;
  CONDITIONAL_AND = 10;
  CONDITIONAL_OR = 11;
  SHIFT_LEFT = 12;
  SHIFT_RIGHT = 13;
  SHIFT_RIGHT_UNSIGNED = 14;
  EQUAL_TO = 15;
  NOT_EQUAL_TO = 16;
  GREATER_THAN_EQUAL = 17;
  LESS_THAN_EQUAL = 18;
}

// https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15
message UnaryOperatorTree {
  UnaryOperator op = 1;
  Tree tree = 2;
}

enum UnaryOperator {
  UNARY_MINUS = 0;
  UNARY_PLUS = 1;
  UNARY_POSTFIX_INCREMENT = 2;
  UNARY_POSTFIX_DECREMENT = 3;
  UNARY_PREFIX_DECREMENT = 4;
  UNARY_PREFIX_INCREMENT = 5;
  UNARY_BITWISE_COMPLEMENT = 6;
  UNARY_LOGICAL_COMPLEMENT = 7;
}
// -- OUT OF SPEC -- //

message Constant {
  oneof sealed_value {
    UnitConstant unit_constant = 1;
    BooleanConstant boolean_constant = 2;
    ByteConstant byte_constant = 3;
    ShortConstant short_constant = 4;
    CharConstant char_constant = 5;
    IntConstant int_constant = 6;
    LongConstant long_constant = 7;
    FloatConstant float_constant = 8;
    DoubleConstant double_constant = 9;
    StringConstant string_constant = 10;
    NullConstant null_constant = 11;
  }
}

message UnitConstant {
}

message BooleanConstant {
  bool value = 1;
}

message ByteConstant {
  int32 value = 1;
}

message ShortConstant {
  int32 value = 1;
}

message CharConstant {
  int32 value = 1;
}

message IntConstant {
  int32 value = 1;
}

message LongConstant {
  int64 value = 1;
}

message FloatConstant {
  float value = 1;
}

message DoubleConstant {
  double value = 1;
}

message StringConstant {
  string value = 1;
}

message NullConstant {
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy