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

Editor: Popup showing function arguments only displayed for 3 seconds #2644

Closed
joshburnett opened this issue Aug 26, 2015 · 12 comments
Closed

Comments

@joshburnett
Copy link

Description

In the editor, when I type the name of a function and a left parenthesis, Spyder displays a helpful popup showing the function's arguments. Unfortunately, this is only displayed for 3 seconds, and then disappears. It would be helpful if this popup stayed visible for longer, possibly until I type the closing parenthesis or move the text cursor off of the line.

What steps will reproduce the problem?

  1. Type the name of a function, followed by the left parenthesis
  2. The helpful popup appears
  3. Wait 3 seconds
  4. The helpful popup disappears, and I am sad

Version and main components

  • Spyder Version: 3.0.0b1 (happens in 2.3.x as well)
  • Python Version: 2.7.10
  • Qt Versions: 4.8.6, PyQt4 (API v2) 4.10.4 on Windows

Optional dependencies

pyflakes >=0.5.0:  0.9.2 (OK)
pep8 >=0.6      :  1.6.2 (OK)
pygments >=1.6  :  2.0.2 (OK)
IPython >=3.0   :  3.2.0 (OK)
zmq >=13.0.0    :  14.7.0 (OK)
pandas >=0.13.1 :  0.16.2 (OK)
sphinx >=0.6.6  :  1.3.1 (OK)
rope >=0.9.4    :  0.9.4 (OK)
jedi >=0.8.1    :  0.8.1 (OK)
matplotlib >=1.0:  1.4.3 (OK)
sympy >=0.7.3   :  0.7.6 (OK)
pylint >=0.25   :  None (NOK)

@ccordoba12
Copy link
Member

If you put the mouse over the popup before it disappears, it will remain visible until you do a right-click over the popup or move the mouse somewhere else.

@joshburnett
Copy link
Author

So the user is happily typing away, and has to move their hands to the mouse and put it over the popup in the next three seconds, or the helpful info goes away? That seems less than ideal.

I would argue that it should be treated the same as the code completion popup, which gets left in place indefinitely, unless the user dismisses it by hitting ESC.

Finally, if the info is not going to be left there indefinitely, it should at least be for longer than three seconds. Three seconds isn't generally enough time for me to even read the function definition, let along process it and make use of the information. It's hardly even enough time for me to move the mouse over the popup to keep it from disappearing, unless I'm planning ahead that I'm going to do it.

@akhouribhanu
Copy link

Same problem I am facing..

@ccordoba12
Copy link
Member

ccordoba12 commented Jul 15, 2016

I don't think this is a problem per se (at least in my mind ;-) I still think we should not maintain the tooltip in view all the time.

@ccordoba12 ccordoba12 reopened this Jul 15, 2016
@ccordoba12 ccordoba12 added this to the wishlist milestone Jul 15, 2016
@ccordoba12
Copy link
Member

I mean, having the tooltip visible seems to me very distracting. But we could add an option for users who prefer that.

@joshburnett, @akhouribhanu, what do you think?

@akhouribhanu
Copy link

@ccordoba12 : Definitely, there should be an option to customise. As you wrote earlier, as long as you keep your mouse over menu, it will be visible. But, as soon as you start typing code, It will be gone. As you know, there are many parameters/arguments available with a function, and one cannot memorise it all after looking it once. When you are in middle of writing a function, and you are stuck as you forget the parameter/arguments you are suppose to use.

@ccordoba12
Copy link
Member

@akhouribhanu, ok, I understand the use case better now. Then perhaps it'd be better to add a close button to the tooltip.

@goanpeca, @jitseniesen, what do you think about this one?

@goanpeca
Copy link
Member

goanpeca commented Jul 15, 2016

Actually @ccordoba12 I do agree with the user suggestion, I have find myself deleting the ( and retyping it to get the info.

We could try to leave it there until the cursor changes to a different line (after going to the end of the line and pressing enter... or moving the cursor with the arrows up or down).

This would leave the tooltip for the needed time :-), while typing in the same line. Maybe is not perfect, but having a close button completely defeats the purpose of a mouse free interaction (which the user and I myself prefer)

Update

Or using Esc as the user suggests!

@jitseniesen
Copy link
Member

@goanpeca wrote down exactly what I thought: leave the tooltip until the corresponding closing parenthesis is typed (or the user moves the cursor past the automatically inserted closing parenthesis), or the cursor is moved to another line, or the user presses Esc, or another tooltip is displayed.

Not sure what to do if the argument list spans more than one line; does the tooltip move down or is it closed?

PS: Visual Studio displays the argument that you are currently at in bold in the tooltip, which I think is pretty neat.

@ccordoba12 ccordoba12 modified the milestones: v3.0rc1, wishlist Jul 15, 2016
@ccordoba12
Copy link
Member

These are all very good suggestions. I'll create a PR to test how this works :-)

@Nodd, I think this would require some changes in your spyder_vim plugin because if a tooltip is visible, users will need to press Esc twice now: one time to hide the tooltip and another one to enter command mode.

Visual Studio displays the argument that you are currently at in bold in the tooltip

Interesting idea, but for another PR ;-)

@Nodd
Copy link
Contributor

Nodd commented Jul 16, 2016

@ccordoba12 If the problem is just pressing Esc I think it's fine. But I'm afraid that it could be more problematic because the same shortcut would be used for 2 different things in the same context (the editor). And using something else than Esc for vim is not realistic either. Maybe it will depend on how the tooltip thing will be implemented.

@ccordoba12
Copy link
Member

ccordoba12 commented Jul 16, 2016

So I tried VS Code, which maintains the tooltip open until the user decides to close it (by typing Up or Down arrows), and it works quite nicely!!

So now I fully agree with you guys, and you can expect a PR at the end of this week ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants