Skip to content

PR: Fix showing signatures with type annotations in Help pane#25747

Open
jsbautista wants to merge 17 commits intospyder-ide:masterfrom
jsbautista:panelHelp
Open

PR: Fix showing signatures with type annotations in Help pane#25747
jsbautista wants to merge 17 commits intospyder-ide:masterfrom
jsbautista:panelHelp

Conversation

@jsbautista
Copy link
Copy Markdown
Collaborator

Description of Changes

Fix Verbose type annotations in help panel

Issue(s) Resolved

Fixes #22249

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct:
@jsbautista

Copy link
Copy Markdown
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Great work here @jsbautista! Just a few suggestions for you.

documentation = doc.get('docstring', '')
note = doc.get('note', '')
is_function = '__main__' in note
if is_function and source_text:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if is_function and source_text:
if is_function and source_text:

For clarity.

is_function = '__main__' in note
if is_function and source_text:
signature = unicodedata.normalize("NFKD", source_text)
match = re.search(r'def\s+.*?\)\s*(?:->\s*[^:]+)?\s*:', signature, re.S)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
match = re.search(r'def\s+.*?\)\s*(?:->\s*[^:]+)?\s*:', signature, re.S)
match = re.search(
r'def\s+.*?\)\s*(?:->\s*[^:]+)?\s*:', signature, re.S
)

Make line fit in 79 columns.

signature = unicodedata.normalize("NFKD", source_text)
match = re.search(r'def\s+.*?\)\s*(?:->\s*[^:]+)?\s*:', signature, re.S)
args = ''
if match:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if match:
if match:

For clarity.

'argspec': args,
'note': note,
'docstring': documentation
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
}
}

Fix code style and add blank for clarity.

@ccordoba12 ccordoba12 changed the title PR: Fix Verbose type annotations in help panel PR: Fix showing signatures with type annotations in Help pane Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verbose type annotations in help panel

2 participants