Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All :c:*: roles should check objtype on resolving refs (refs: #7243) #7256

Closed

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented Mar 5, 2020

Feature or Bugfix

  • Bugfix
  • Refactoring

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

  • tests

…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.
@tk0miya tk0miya added this to the 3.0.0 milestone Mar 5, 2020
@codecov
Copy link

codecov bot commented Mar 5, 2020

Codecov Report

Merging #7256 into 3.x will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           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           
Impacted Files Coverage Δ
tests/test_markup.py 98.29% <0.00%> (ø)
sphinx/writers/latex.py 83.98% <0.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 09623a9...53e7acc. Read the comment docs.

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@tk0miya
Copy link
Member Author

tk0miya commented Mar 5, 2020

I worry about cpp domain also have same issue. But it is too complicated to me.

@jakobandersen
Copy link
Contributor

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.

@tk0miya
Copy link
Member Author

tk0miya commented Mar 8, 2020

Your idea seems better than mine. Withdrawing with pleasure :-)

@tk0miya tk0miya closed this Mar 8, 2020
@tk0miya tk0miya deleted the 7243_croles_should_check_objtype branch March 8, 2020 15:27
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants