aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/protobuf/builtin.proto
blob: 72df5a17f288d2d76443575df32b4b5b1e88a185 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Copyright 2018 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Proto that exposes all BUILD and Skylark builtin symboles.
//
// The API exporter is used for code completion in Cider.

syntax = "proto3";
package builtin;

// option java_api_version = 2;
option java_package = "com.google.devtools.build.docgen.builtin";
option java_outer_classname = "BuiltinProtos";

// Top-level object for all BUILD and Skylark builtin modules.
// Globals contains a list of all builtin variables, functions and packages
// (e.g. "java_common" and "native" will be included, same as "None" and
// "dict").
// Types contains a list of all builtin packages (e.g. "java_common"
// and "native"). All types should be uniquely named.
message Builtins {
  repeated Type type = 1;

  repeated Value global = 2;
}

// Representation for Skylark builtin packages. It contains all the symbols
// (variables and functions) exposed by the package.
// E.g. "list" is a Type that exposes a list of fields containing: "insert",
// "index", "remove" etc.
message Type {
  string name = 1;

  // List of fields and methods of this type. All such entities are listed as
  // fields, and methods are fields which are callable.
  repeated Value field = 2;

  // Module documentation.
  string doc = 3;
}

// Generic representation for a Skylark object. If the object is callable
// (can act as a function), then callable will be set.
message Value {
  string name = 1;

  // Name of the type.
  string type = 2;

  // Set when the object is a function.
  Callable callable = 3;

  // Value documentation.
  string doc = 4;
}

message Callable {
  repeated Param param = 1;

  // Name of the return type.
  string return_type = 2;
}

message Param {
  string name = 1;

  // Parameter type represented as a name.
  string type = 2;

  // Parameter documentation.
  string doc = 3;

  // Default value for the parameter, written as Skylark expression (e.g.
  // "False", "True", "[]", "None")
  string default_value = 4;
}