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

Call tips - Way to hide when not mousing over #300

Closed
Gert-dev opened this issue Jul 14, 2017 · 6 comments
Closed

Call tips - Way to hide when not mousing over #300

Gert-dev opened this issue Jul 14, 2017 · 6 comments
Milestone

Comments

@Gert-dev
Copy link
Owner

Gert-dev commented Jul 14, 2017

Originally posted by @mrthebob (https://github.com/php-integrator/atom-call-tips-legacy-php56/issues/12)

The call tip tends to get in the way while I'm programming. It provides very useful information, but I often need to see things underneath it. I'd very much love it if it would work on mouse over. That is, the tip shows when I mouse over, but when the mouse isn't there - no tip, so that I can work and see everything I need.

Love the plugin. Very useful.

Thanks!

Comment 1 (Gert-dev)

Thanks for the suggestion. I've encountered the same problem and have been wondering for a while about what a good solution would be.

I believe PhpStorm doesn't immediately trigger the call tip, like php-integrator does. It seems to have some kind of more intelligent system where it only shows the tooltip when you first start typing the function (not too sure about how it works, exactly), combined with being able to manually summon it with a keyboard shortcut.

I like how it's currently always there when you need it, but I dislike how it's on top of everything. Your suggestion to use the mouse could work, but I'm afraid this will negatively affect users that rarely use the mouse.

Comment 2 (mrthetbob)

Perhaps 2 things?

1. an /option/ that is off by default that allows the mouse solution above
2. a key command to turn the tooltips off or on

Comment 3 (Gert-dev)

If I understand you correctly, when you move the keyboard cursor inside a function/method call, you only see the call tip if the mouse is also _on_ the same function/method call?

I think this is something that can be accomplished, but won't having your mouse on the function/method call obstruct your view of what you're typing?

Also, you would have to always move the mouse somewhere at the start of the call, as if you place it to the right, then delete an argument or a few characters (causing the mouse to now fall just outside the call), the call tip would suddenly disappear.

Comment 4 (mrthebob)

Well, not quite. I was offering two different potential solutions:

1. Mouse-only operation: call tips only appear for the function the mouse is currently hovering over. This would disregard keyboard position. Also - this would be a setting that defaults to "off". 

2. A key command that allows the user to turn on or off the call tips as they currently exists.

Another option I just thought of:

3. The plugin works as it does currently, except that when the user starts typing, the call tip disappears. When they stop typing (after a small delay), the call tips appear again.

Does all of that make sense?

Random question: how do other IDEs handle call tips?

Comment 5 (Gert-dev)

I remember how Visual Studio did it back in the day (though that was probably around 2005 or 2008): it's much the same as is currently done in this package, with the same downside.

As mentioned, I believe PhpStorm doesn't immediately trigger the call tip. It seems to have some kind of more intelligent system where it only shows the tooltip when you first start typing the function (not too sure about how it works, exactly), combined with being able to manually summon it with a keyboard shortcut.

I like how PhpStorm handles it, but having to request this information manually every time feels a bit counter-intuitive for call tips. It seems to make them a bit unnecessary as you already have the same information, and more, available via tooltips that display on mouse hover or, in 3.0, are triggered via a keyboard combination.

Maybe there is a better solution available that we haven't thought of. I see that [this package](https://atom.io/packages/go-signature-statusbar) experiments with moving the call tips to the status bar. This would certainly solve the problem of it obfuscating code as well as keeping it available at all times. However, I'd likely have to severely limit the available information, as signatures can be virtually infinite in length and the status bar has limited space.

Comment 6 (mrthebob)

That's an interesting possibility. What if... it were in the status bar,
but you could click on it to have it open up a panel that contained more
information for longer signatures? Kind of like the linter package?
@VentyCZ
Copy link

VentyCZ commented Jul 15, 2017

image

Yes, it's quite annoying (like in the example) while you're writing an anonymous function.

I'd, at least, appreciate an ESC to close!

@Gert-dev
Copy link
Owner Author

Gert-dev commented Jul 17, 2017

Inside anonymous functions was one place where I wanted to forcibly disable the call tip from the function/method call "higher up" (such as in the case you are displaying). Unfortunately, php-parser doesn't allow fetching the body (i.e. the positions of the opening and closing parantheses) separately from the entire closure with all its contained statements, so disabling it would mean you won't get call tips anywhere for the closure (not even on the function keyword, which I'd still like to show).

It's not a solution to the entire problem in this ticket, but it would help minimize annoyance :-).

Gert-dev added a commit that referenced this issue Oct 19, 2017
This replaces our own implementation with the one from atom-ide-ui. Next
to having a consistent UI with other IDE packages and benefitting from
improvements made over there, they also offer several advantages over
our own implementation:

  - It is configured here to automatically trigger (!) when the
    paranthesis is typed. To add to that, it automatically remains open
    as long as the user continues typing and doesn't move outside the
    function call. This means it will never pop up automatically unless
    either typing a new function call or explicitly requesting it.
  - You can easily close it by pressing escape (#300) or moving outside
    of the function call, so it gets in the way much less often.
  - It also displays, next to the active parameter's documentation, the
    documentation of the function itself (mostly deals with #301).
  - It displays above the function call, so it doesn't overlap with
    autocompletion (#311)
  - You can drag them out of the way.
  - You can attach keyboard triggers to them.

Finally, this code is pretty much ready for use on our end, but there
are some minor issues I'd like to see ironed out in atom-ide-ui before
releasing this:

  - The API is currently still experimental
  - The styling is currently a bit barebones; the name of the active
    parameter is not displayed.
  - HTML in descriptions is being escaped (same issue as
    facebookarchive/atom-ide-ui#99)

References #300
References #301
References #311
@ricpelo
Copy link

ricpelo commented Jan 20, 2018

I have the same problem. Could it be possible to use ESC key to hide the signature help? It might be useful as a workaround meanwhile atom-ide-ui integration is fully completed :).

@Gert-dev
Copy link
Owner Author

Gert-dev commented Jan 25, 2018

Sounds like a good idea. I've decided to try and merge the ide-ui integration in the upcoming version (I think I can work around the HTML being escaped in the signature help), which supports closing via the escape key :-).

@ricpelo
Copy link

ricpelo commented Jan 25, 2018

Great news! Thanks a lot :).

@Gert-dev Gert-dev added this to the 3.2 milestone Jan 27, 2018
@Gert-dev
Copy link
Owner Author

Gert-dev commented Feb 1, 2018

Closing this as 3.2 has been released. Tooltips as well as signature help now use atom-ide-ui's implementation, so they can be closed with the escape key and are a lot better at not getting in your way in general :-).

@Gert-dev Gert-dev closed this as completed Feb 1, 2018
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

3 participants