diff --git a/bikeshed/refs/source.py b/bikeshed/refs/source.py index ebc2395f5b..89544df7a0 100644 --- a/bikeshed/refs/source.py +++ b/bikeshed/refs/source.py @@ -211,7 +211,7 @@ def forRefsIterator(targetFors: str | list[str]) -> t.Generator[t.RefWrapper, No if exact: refs = list(textRefsIterator([text])) else: - textsToSearch = list(utils.linkTextVariations(text, linkType, linkFor)) + textsToSearch = list(utils.linkTextVariations(text, linkType)) if any(st.endswith("()") for st in textsToSearch): # Let argless methods (either with () at the end, or no parens at all) diff --git a/bikeshed/refs/utils.py b/bikeshed/refs/utils.py index 99df589d62..4b2f7ae782 100644 --- a/bikeshed/refs/utils.py +++ b/bikeshed/refs/utils.py @@ -58,9 +58,7 @@ def filterOldVersions(refs: list[t.RefWrapper], status: str | None = None) -> li return refs -def linkTextVariations( - str: str, linkType: str | None, linkFor: str | list[str] | None = None -) -> t.Generator[str, None, None]: +def linkTextVariations(str: str, linkType: str | None) -> t.Generator[str, None, None]: # Generate intelligent variations of the provided link text, # so explicitly adding an lt attr isn't usually necessary. str = str.strip() @@ -174,9 +172,7 @@ def linkTextVariations( # Let people refer to methods without the parens. # Since attrs and methods live in the same namespace, this is safe. - # But we want to avoid *other* confusions, like an interface and its constructor, - # so qualify it on there being a for value. - if linkFor and "(" not in str: + if "(" not in str: yield str + "()" # Allow linking to an enum-value with or without quotes