All :c:*: roles should check objtype on resolving refs (refs: #7243)#7256
All :c:*: roles should check objtype on resolving refs (refs: #7243)#7256tk0miya wants to merge 1 commit intosphinx-doc:3.xfrom
Conversation
…doc#7243) All :c:*: roles can refer all kind of C objects even if objtype not matched. To search objects correctly, this change the form of key for objects to a pair of objtype and objname.
Codecov Report
@@ Coverage Diff @@
## 3.x #7256 +/- ##
=======================================
Coverage 83.95% 83.95%
=======================================
Files 280 280
Lines 43128 43135 +7
Branches 6299 6302 +3
=======================================
+ Hits 36207 36214 +7
Misses 5543 5543
Partials 1378 1378
Continue to review full report at Codecov.
|
| def objects(self) -> Dict[str, Tuple[str, str]]: | ||
| return self.data.setdefault('objects', {}) # fullname -> docname, objtype | ||
| def objects(self) -> Dict[Tuple[str, str], str]: | ||
| return self.data.setdefault('objects', {}) # objtype, fullname -> docname |
There was a problem hiding this comment.
I'll change the structure of self.objects later to add node_id into the value in next PR. It is also needed to avoid conflicts with other domains (refs: #6903).
|
I worry about cpp domain also have same issue. But it is too complicated to me. |
|
As hinted over in #7243, I'm not sure this is a good resolution for C. Instead of things silently linking but with misleading rst code, then now there are no links but with warnings about targets not being found. As one really shouldn't have two entities with the same name (C does not support overloading) I believe warnings on role/objtype mismatch is a better resolution. If you are ok with this, I'll make a PR with a solution along those lines. |
|
Your idea seems better than mine. Withdrawing with pleasure :-) |
Feature or Bugfix
Purpose
All :c:*: roles can refer all kind of C objects even if objtype
not matched. To search objects correctly, this change the form of
key for objects to a pair of objtype and objname.
refs: #7243
Remaining tasks