WIP: Add bazel info starlark-environments-proto #24817
Draft
+493
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added
bazel info starlark-environments-proto
command that can be used by LSPs to obtain list of starlark symbols per starlark environment (BUILD file, .bzl file, MODULE file, etc) from running instance of bazel.This PR needs a lot of polishing, but decided to push it early to collect comments from interested parties on related issues - CC-ing @cameron-martin, @withered-magic
Comparison between data exported by this command and data created through
bazel build ...:gen_api_proto
: gistNeed decision
Currently used
builtin.Builtins
for easier comparison with data created by:gen_api_proto
.bazel help builtin-symbols-as-proto
#21936 (review)Current implementation does not fill
global.type
with types, param types orreturn_type
of callables. Need to figure out how to exactly represent types. Decision is related to deciding on the proto - for starlark protos there is a FR to add types: Stardoc protos and ModuleInfoExtractor / starlark_doc_extract should export parameter type annotations for builtin functions #21979Some rules and/or their attributes are parsed out from source code by BuildDocCollector. Need to either ignore those for time being; extract those during build phase or change the way those are specified. See those attributes in https://github.com/search?q=repo%3Abazelbuild%2Fbazel%20%23BLAZE_RULE&type=code
Dump of noticed issues that need to be fixed as well:
PredefinedAttributes
select
:<a href=\"${link common-definitions#configurable-attributes}\">
<a href=\"../builtins/Label.html\">