ApiExporter: capture missing attributes
There could be special attributes, such as 'package_metadata' and 'applicable_licenses' defined in lib/packages/RuleClass.java, that are not part of the exported builtin.pb. This causes language servers such as starpls to fail diagnosing when encounter these attributes.
Fix this by exposing ConfiguredRuleClassProvider from SymbolFamilies and route it down to ApiExporter.collectRuleInfo. There, we include all the previously unseen attributes into the exported data.
Note that this fix would only add the 'package_metadata' attribute to the final proto and not 'applicable_licenses' because the latter is currently an alias of the former.
Part of https://github.com/withered-magic/starpls/issues/410
Open question: should I add applicable_licenses attribute to the exported proto so starpls stop yelling about the unknown attribute? Or we can add a hardcoded clause in starpls to tell people to s/applicable_licenses/package_metadata?
Open question: should I add applicable_licenses attribute to the exported proto so starpls stop yelling about the unknown attribute? Or we can add a hardcoded clause in starpls to tell people to
s/applicable_licenses/package_metadata?
I would not add it to the exported proto. The notification should be sufficient. It is been package_metadata since bazel 7. Once bazel 9 comes out, even teams supporting LTS-2 will all be on 7 and can migrate.
cc: @tetromino as Im not sure who is the right owner for this code path.