-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Show method table for foo( + tab at repl #4361
Conversation
I just noticed a small issue here: |
Sounds good, once the kinks are worked out! I should call |
Really cool! |
Yes, definitely a nice feature. It would be great to factor out a lot of the common functionality in the REPL and IJulia – and of course replace readline with @loladiro's REPL.jl. |
This should work now. I also made it so the readline's built-in filename completion doesn't get called for things like It sure would be nice if all of this C completion code could be replaced with REPLCompletions.jl, although readline doesn't seem to support specifying what subset of a string should be replaced except via word break characters, which isn't ideal. If REPL.jl is close on the horizon, maybe this is enough for now. |
Nice improvement. I tested it on OSX and it works fine. |
This does weird stuff for me when I hit tab multiple times. |
Can you post what you're typing and what you're seeing? I'm not getting any weirdness. |
|
Since we don't need to actually replace any text, it's easier to call rl_display_match_list directly than to go through readline completion
@StefanKarpinski Hmm, I can get this to happen, but only on OS X. I can also get it to happen on master with long completion lists (e.g. |
Honestly, I'm pretty ok with merging and then figuring it out because this is so useful even a little bit broken. |
I bet that's related to #3652. The way we use readline leaves it unable to handle large completions correctly. |
I would be inclined to say that we should just merge this and wait for a re-implemented repl. |
The implementation does not show methods of operators (like |
buf = IOBuffer() | ||
show_method_table(buf, methods(fn), -1, false) | ||
println(buf) | ||
takebuf_string(buf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you both print buf
, and return it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buf
is an IO
, so that adds a newline to the end of buf
without printing anything to stdout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
I have made a PR at simonster#1 to fix the operator issue. |
Note that tab-tooltip doesn't work for operators in IJulia, apparently because IPython doesn't recognize |
Ah, yes probably. But this is one of the things we need to address in a more deeper way. Right now, the tooltip is populated with the response to
I can add We'll probably move toward Especially I suppose that you guys, might want tooltip on |
Yes, sending the whole cell to the front-end, along with the cursor position, would be the most flexible thing. Until that happens, I wouldn't suggest that IPython worry about tooltips for |
Added support for method(\t syntax for operators
Show method table for foo( + tab at repl
@JeffBezanson I have problem when compiling julia after this commit, I'm using Mingw64 on Win7 |
Ok I pushed a possible fix. Could you try again? |
Thanks for the quick response. It's fixed now. |
This supersedes #4357.