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

PR: Don't hide calltip widget with a timer #3296

Merged
merged 13 commits into from
Jan 16, 2017

Conversation

ccordoba12
Copy link
Member

@ccordoba12 ccordoba12 commented Jul 17, 2016

Fixes #2644


New behavior in this PR:

  1. Calltips won't be hidden unless a matching closing ) is written by the user, or he/she presses these keys: up, down, or enter/return.
  2. If a calltip is already shown, no new calltip is generated (unless there's new info to show).

@ccordoba12 ccordoba12 added this to the v3.0rc1 milestone Jul 17, 2016
@jitseniesen
Copy link
Member

Looks good to me. I tested it and it seems to work. Just a couple of minor points (to prove that I did look at it), none of which are critical IMO:

  1. If you type something like max((b+1)/2), then the tooltip for max disappears when you type the first closing parenthesis, while I would have expected it to stay open until you finish the argument list for max.
  2. The flag hide_timer_on is always False now, so can we remove the timer logic?
  3. The function _find_parenthesis() in calltip.py looks very similar, at least in purpose, as find_brace_match in sourcecode/base.py .

@ccordoba12
Copy link
Member Author

@jitseniesen, thanks for the review :-) My replies to your points:

  1. I'm working on fixing this issue.
  2. I'd prefer to leave it because I invested a lot of time working on the timer logic and we could also need it in the future for other widgets.
  3. Yes. I'll see if I can use find_brace_match instead.

@ccordoba12 ccordoba12 modified the milestones: v3.1, v3.0beta5 Jul 20, 2016
@AIDAROIGCOMPTON-zz
Copy link

Hello


I am also hoping to disable the 3-second timer, as I am VERY new at Spyder and Python. Also very knew to gitHub, so I don't know if you've created a fix. Please let me know the status of your resolution.


I thank you in advance for your time & effort!

@ccordoba12
Copy link
Member Author

@AIDAROIGCOMPTON, this is precisely the fix for the timer. It will be available in Spyder 3.1, to be released in December :-)

@goanpeca
Copy link
Member

@ccordoba12 is this ready to be merged but on hold to be merged when 3.2 is about to be released, or?

Needs a rebase / merge also

@goanpeca goanpeca changed the title Don't hide the calltip with a timer PR: Don't hide the calltip with a timer Oct 26, 2016
@ccordoba12
Copy link
Member Author

This is for 3.1. I'll come back to it after I release 3.0.2 :-)

@ccordoba12 ccordoba12 changed the base branch from master to 3.x December 20, 2016 16:58
@ccordoba12 ccordoba12 changed the title PR: Don't hide the calltip with a timer PR: Don't hide calltip widget with a timer Dec 20, 2016
@ccordoba12
Copy link
Member Author

@jitseniesen, I think this one is ready. Would you mind to give one last test? Thanks :-)

@jitseniesen
Copy link
Member

If you type something like max((b+1)/2), then the tooltip for max disappears when you type the first closing parenthesis, while I would have expected it to stay open until you finish the argument list for max.

This works now. However, if the function is within parentheses, then the tooltip stays visible until you close the outer paranthesis. Example: 2*(max(b)+1), the tooltip for max stays visible when you complete the argument list and type the first closing parenthesis, and it only goes away after you move beyond the second closing parenthesis.

Ideally, when Spyder displays the tooltip, it saves the position of the opening parenthesis (which it may well already do), and in the test for whether to hide the calltip, it tests whether the closing parenthesis matches up with the opening parenthesis which caused the tooltip to be displayed.

But maybe this is a separate issue (it looks like it never worked like I described; it just is more apparent now that the calltip doesn't disappear after 3 secs) and should be handled by another PR.

No further comments.

@ccordoba12
Copy link
Member Author

@jitseniesen, thanks for the review. I'm aware of the problem you mention and I'll open an issue about it so we can fix it in 3.1.1 ;-)

@ccordoba12 ccordoba12 merged commit 8166487 into spyder-ide:3.x Jan 16, 2017
@ccordoba12 ccordoba12 deleted the dont-hide-calltip branch January 16, 2017 16:30
ccordoba12 added a commit that referenced this pull request Jan 16, 2017
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.

4 participants