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
IDLE: Restore or keep calltip when needed #86405
Comments
If one types 'int(' an int calltip is displayed. If one adds 'float(' then the float calltip is displayed instead. If one adds '"3.1")', the int calltip is restored. (Actually a new int calltip.) Finally, if one closes with ')', the int calltip is removed. If, after 'int(', one adds instead 'f(', where f has no accessible signature or docstring and hence no calltip, the int calltip is dropped with no replacement. When f is closed, the int calltip is not restored because open_calltip in def refresh_calltip_event(self, event): # Bound to ')'.
if self.active_calltip and self.active_calltip.tipwindow:
self.open_calltip(False) is not called because there is no existing calltip. This issue is about somehow having the int calltip after the f call. Possibilities.
Tal, any opinions on the desired behavior. I believe the bpo-40511 revision should make any of the above, with 1 and 2 being easiest and safest. A problem with 3 and 4 is that the text cursor can be moved out of the call and the calltip closed without the call being completed with ')'. I want to add more tests first. |
We already have a "<<refresh-calltip>>" virtual event which is triggered upon typing a closing parenthesis ')'. We could just have it always call "open_calltip()" rather than only doing so when one is already open. See PR #67289. |
I dislike the idea of creating a Hyperparser and calling get_surrounding_brackets on every ). For (, the open is the ( just typed and the close is typically the newline to the right. For ), the open may be several lines back. I will test for noticeable delay after sleeping. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: