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

domain: c: fix warning for intersphinx targets #8418

Closed
wants to merge 1 commit into from

Conversation

utzig
Copy link
Contributor

@utzig utzig commented Nov 13, 2020

Referencing a symbol using project:symbol, which is a valid syntax that can be resolved by intersphinx, results in the C-domain parser printing a warning "Unparseable C cross-reference". The resolution still works correctly because it is postponed to intersphinx.

This commit adds a small check for intersphinx target format validity before printing the warning.

/cc @jakobandersen

Referencing a symbol using <project:symbol>, which is a valid syntax
that can be resolved by intersphinx, results in the C-domain parser
printing a warning "Unparseable C cross-reference". The resolution
still works correctly because it is postponed to intersphinx.

This commit adds a small check for intersphinx target format validity
before printing the warning.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
@jakobandersen
Copy link
Contributor

Hmm, do you have a small example project where this helps?

@utzig
Copy link
Contributor Author

utzig commented Nov 15, 2020

Hmm, do you have a small example project where this helps?

I just built this little toy project which shows the issue. It has 3 projects, two of them, proj1 and proj2, export a function named "fn". In the "main" project I try to link to "fn". It will always link correctly to one of the "fn" functions, but there is no control over which. If I use "proj1:fn" or "proj2:fn" than it will link to the one I want, but will throw a "Unparseable C cross-reference: bla bla bla" warning on the way.

inter_warn.tar.gz

@utzig
Copy link
Contributor Author

utzig commented Nov 30, 2020

@jakobandersen Have you had a chance to look into this?

@jakobandersen
Copy link
Contributor

I find this way of making it work a bit iffy: when you write any kind of role in your input you are requesting a specific handler to be invoked, e.g., for :c:func: you request lookup in the documented C entities (with intersphinx as backup). But here you are explicitly requesting that the ordinary handler does not do any work.
I therefore suggest that intersphinx should provide a role, say inter which you can use for this purpose.
For example it could be made possible to write

:inter:`proj1,c:func,fn`

where the three comma-separated components are

  1. the project specifier, as intersphinx understands it,
  2. the original role, needed by intersphinx for matching,
  3. the query symbol as if one would have given it to the original role from (2).

@tk0miya
Copy link
Member

tk0miya commented Apr 5, 2021

FYI: Now I just posted a draft version of the :intersphinx: role in #9062.

@tk0miya tk0miya closed this May 9, 2021
@tk0miya tk0miya deleted the branch sphinx-doc:3.x May 9, 2021 03:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 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

3 participants