Closed erenon closed 1 year ago
We also need to include the line number in the original .bzl where the symbol was defined. This sourcemap allows the docsite to give users an "edit this" link that takes you to the right spot to contribute documentation fixes.
The new native starlark_doc_extract
rule coming in Bazel 7 will give you ModuleInfo.file
(the label of the module overall) and *Info.origin_key
(the label of the file where the symbol was originally defined, and the name under which it was defined there) - and we are switching over Stardoc to use the new rule.
Unfortunately, for memory-saving reasons, we can't directly give you line numbers.
The ModuleInfo proto does not export the full path/label of the symbols, nor the other info protos. I'd like to write templates that automatically add load usage, e.g:
But the
/foo/bar:baz.bzl
part is not available for the template.