aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/protobuf
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2018-07-17 03:50:24 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-17 03:51:47 -0700
commit715a7728e7e4a427c8d76545933f86bce5ddfbd9 (patch)
tree7919b33176e9cf1bd762c446b899768acd625e89 /src/main/protobuf
parent0451f1b3e8fe11dc6da021c9c137ae68255aa472 (diff)
Expose BUILD and Starlark symbols.
PiperOrigin-RevId: 204889082
Diffstat (limited to 'src/main/protobuf')
-rw-r--r--src/main/protobuf/BUILD1
-rw-r--r--src/main/protobuf/builtin.proto87
2 files changed, 88 insertions, 0 deletions
diff --git a/src/main/protobuf/BUILD b/src/main/protobuf/BUILD
index fbb1374348..55c8300b93 100644
--- a/src/main/protobuf/BUILD
+++ b/src/main/protobuf/BUILD
@@ -17,6 +17,7 @@ FILES = [
"android_deploy_info",
"bazel_flags",
"build",
+ "builtin",
"bundlemerge",
"command_server",
"crosstool_config",
diff --git a/src/main/protobuf/builtin.proto b/src/main/protobuf/builtin.proto
new file mode 100644
index 0000000000..72df5a17f2
--- /dev/null
+++ b/src/main/protobuf/builtin.proto
@@ -0,0 +1,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;
+}