Skip to content

Search: fix parsing of parameters inside sphinx domains #9750

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

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Nov 21, 2022

We were removing all dl lists that were inside a domain in order to remove nested domains, but in doing so we were removing parameters (they are inside a dl list!).

Instead, let's reuse the method to detect sphinx domains.

Front logo Front conversations

We were removing all dl lists that were inside a domain
in order to remove nested domains, but in doing so we were
removing parameters (they are inside a dl list!).

Instead, let's reuse the method to detect sphinx domains.
@stsewd stsewd requested a review from a team as a code owner November 21, 2022 18:52
@stsewd stsewd requested a review from humitos November 21, 2022 18:52
@@ -40,6 +40,6 @@
],
"domain_data": {
"test_py_module.test.Foo": "Docstring for class Foo. This text tests for the formatting of docstrings generated from output sphinx.ext.autodoc.",
"test_py_module.test.Foo.__init__": "Start the Foo."
"test_py_module.test.Foo.__init__": "Start the Foo. Parameters: qux (string) – The first argument to initialize class. spam (bool) – Spam me yes or no…"
Copy link
Member Author

Choose a reason for hiding this comment

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

funny, we already had that test case, but we were expecting the wrong result :D

Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

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

Great find! The structure of the params/return list has changed a few times, so this is probably a wise decision either way.

@stsewd stsewd merged commit a609d9a into main Nov 21, 2022
@stsewd stsewd deleted the fix-parameters-parsing branch November 21, 2022 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants