posit-dev / positron

Positron, a next-generation data science IDE
Other
2.31k stars 68 forks source link

ark: include function signature in hover tooltip title #361

Open kevinushey opened 1 year ago

kevinushey commented 1 year ago

We should do this up-front for both functions that have a help file, and functions which don't.

The current state:

Screenshot 2023-04-03 at 1 02 20 PM

Some comparisons:

Screenshot 2023-04-03 at 12 58 43 PM Screenshot 2023-04-03 at 12 59 15 PM
DavisVaughan commented 1 month ago

Note that newer versions of Pyright include a really nice feature that I think we should also adopt when implementing this - newlines are used liberally to make the function signature more readable. Compare these two images:

Screenshot 2024-07-17 at 7 30 58 AM

Our Jedi LSP doesn't have support for this pretty formatted view so we can't replicate in Python unfortunately, but we have full control over this on the R side and should do something similar with both color and newlines.


Another thing to note is that "parameter hints" only allows the "compact" form. I tried sprinkling in some newlines, but they just get stripped out by whatever ends up rendering this, so our pretty formatting would only apply to hover, not signature help (but that's ok):

Screenshot 2024-07-16 at 5 20 18 PM