-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fix #7119: Show type hint names unqualified when resolving succeeded #8432
Merged
tk0miya
merged 4 commits into
sphinx-doc:master
from
tk0miya:7119_pending_xref_condition
Mar 6, 2021
Merged
Fix #7119: Show type hint names unqualified when resolving succeeded #8432
tk0miya
merged 4 commits into
sphinx-doc:master
from
tk0miya:7119_pending_xref_condition
Mar 6, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0b33db8
to
6e8cf03
Compare
tk0miya
commented
Nov 15, 2020
shimizukawa
reviewed
Nov 23, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed.
6e8cf03
to
ce59517
Compare
ce59517
to
e6674ec
Compare
tk0miya
commented
Dec 25, 2020
@@ -91,7 +91,14 @@ def type_to_xref(text: str, env: BuildEnvironment = None) -> addnodes.pending_xr | |||
else: | |||
kwargs = {} | |||
|
|||
return pending_xref('', nodes.Text(text), | |||
if env.config.python_use_unqualified_type_names: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to use this option on PyField.make_xref()
. I'll do it the next PR.
To choose appropriate content for pending_xref node on resolving, this introduces a new custom node `pending_xref_condition`. It only has a condition for the filtering and contents of the reference.
e6674ec
to
24b6814
Compare
24b6814
to
6b5448f
Compare
…fied_type_names Add a new config variable: python_use_unqualified_type_names. If enabled, it goes to suppress the module name of the python reference if it can be resolved.
bf5c7df
to
02cbf43
Compare
02cbf43
to
7f0b13a
Compare
It's time to merge! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature or Bugfix
Purpose
Add pending_xref_condition node
To choose appropriate content for pending_xref node on resolving,
this introduces a new custom node
pending_xref_condition
. It onlyhas a condition for the filtering and contents of the reference.
Add a new config variable: python_smart_reference. If enabled, it goes
to suppress the module name of the python reference if it can be
resolved.