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

Improve tooltips by always showing the docstring of the function being called #631

Open
harryscholes opened this issue Feb 25, 2018 · 2 comments · May be fixed by #847
Open

Improve tooltips by always showing the docstring of the function being called #631

harryscholes opened this issue Feb 25, 2018 · 2 comments · May be fixed by #847

Comments

@harryscholes
Copy link

IPython

Pressing shift + tab when calling a function f displays the docstring of f:

python2

IJulia

The behaviour is different in IJulia. If a number is given as the first argument, then no tooltip is displayed:

julia2

However, if a defined variable x is supplied, then the docstring of x is shown:

julia3

Shouldn't we make the tooltip always show the docstring of the function being called?

@harryscholes harryscholes changed the title Improve tooltips by only showing the docstring for the current function Improve tooltips by always showing the docstring of the function being called Feb 25, 2018
@stevengj
Copy link
Member

Improvements to the get_token function (used to decide what to request help on) are welcome:

IJulia.jl/src/handlers.jl

Lines 153 to 160 in 397d190

function get_token(code, pos)
# given a string and a cursor position, find substring to request
# help on by:
# 1) searching backwards, skipping invalid identifier chars
# ... search forward for end of identifier
# 2) search backwards to find the biggest identifier (including .)
# 3) if nothing found, do return empty string
# TODO: detect operators?

@rongcuid rongcuid linked a pull request Jun 12, 2019 that will close this issue
@rongcuid
Copy link

Sent a pull request #847. Please review it some time.

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 a pull request may close this issue.

3 participants