Closed n-peugnet closed 1 year ago
I identified the source of this bug.
It is because this block is not executed since after the evaluation of the ~
prefix the title is only $property
:
https://github.com/markstory/sphinxcontrib-phpdomain/blob/2d06842f100846505084b6aea9bf7b570c233037/sphinxcontrib/phpdomain.py#L518-L520
Which leads to modname
and clsname
being None
in resolve_xref()
and find_obj()
to return None
:
https://github.com/markstory/sphinxcontrib-phpdomain/blob/2d06842f100846505084b6aea9bf7b570c233037/sphinxcontrib/phpdomain.py#L701-L710
TBH I don't get why the offending line is there in the first place. I don't see any reason for not including these two values when the title starts with $
.
To filter out global variable? Then this check is incorrect, and even then, why check for global variables and not global functions?
I tried to remove the if and always add the namespace and class values and I didn't find any issues. But as the tests are not very strict I could easily have missed some regressions.
Basically, with this diff to the tests, the second reference added will not produce a link, whereas the two other will: