Skip to content

Commit 706564b

Browse files
committed
sphinxdocs: make xrefs to tag class attributes using attr role work
1 parent d6af2b7 commit 706564b

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

sphinxdocs/src/sphinx_bzl/bzl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,10 +1156,10 @@ class _BzlTagClass(_BzlCallable):
11561156

11571157
doc_field_types = [
11581158
_BzlGroupedField(
1159-
"arg",
1159+
"attr",
11601160
label=_("Attributes"),
11611161
names=["attr"],
1162-
rolename="arg",
1162+
rolename="attr",
11631163
can_collapse=False,
11641164
),
11651165
]

sphinxdocs/tests/sphinx_stardoc/sphinx_output_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def _doc_element(self, doc):
6363
("full_repo_provider", "@testrepo//lang:provider.bzl%LangInfo", "provider.html#LangInfo"),
6464
("full_repo_aspect", "@testrepo//lang:aspect.bzl%myaspect", "aspect.html#myaspect"),
6565
("full_repo_target", "@testrepo//lang:relativetarget", "target.html#relativetarget"),
66+
("tag_class_attr_using_attr_role", "myext.mytag.ta1", "module_extension.html#myext.mytag.ta1"),
6667
# fmt: on
6768
)
6869
def test_xrefs(self, text, href):

sphinxdocs/tests/sphinx_stardoc/xrefs.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,7 @@ Various tests of cross referencing support
4141
## Any xref
4242

4343
* {any}`LangInfo`
44+
45+
## Tag class refs
46+
47+
* tag class attribute using attr role: {attr}`myext.mytag.ta1`

0 commit comments

Comments
 (0)