Include additional rule info while exporting builtins
My WIP Starlark LSP currently uses the ApiExporter to dump all types + globals to the builtins.pb proto, which the LSP then loads at runtime to provide type information/hover docs for Bazel builtins. Right now, the ApiExporter only sets the name and is_mandatory fields of rule Params, limiting the ability of the LSP to provide type checking for rules (e.g. validating argument types). This PR adds additional getters on RuleDocumentationAttribute for the attribute type, default value, documentation, allowing the LSP to use this additional information.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
@sgowroji Any pointers on getting CI to pass? Looks like a potential flake but I can't see the retry button in the usual place in the Buildkite UI.
Retried and looks good now.
Thank you!
I don't think we should continue trying to represent a native rule class as a callable builtin.Value. Instead, we should simply represent it using a message specifically designed for describing a rule class: a stardoc_output.RuleInfo.
See also discussion in https://github.com/bazelbuild/bazel/pull/21929