-
Notifications
You must be signed in to change notification settings - Fork 16
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
Allow for IJulia auto-completion #38
Comments
Definitely possible, I just don't have time to really get around to it. To me, doing a quick parsing of the standard library was fairly painless and didn't involve any dealing with the kernel, plus the fact that you get the auto-completion in julia source files instead of just the console (though now that I think about it, there's not really a reason you couldn't set it up to work in julia source as well). |
Thanks. I managed to get it to work, after reading the ipython docs. |
Also, I wonder how to keep track of auto-completion, especially when in the middle of a command, for example if the cursor is in the middle of the code written in the sublime window, so that if the user accepts the completion, it should be updated properly. This would require keeping track of the input and updating it properly, and also some what to know where the cursor is at when the auto-complete command is called. |
I'd have to look at your code to help further, so a PR may be best at this point. How are you planning on displaying the auto-completion list? Are you using a similar facility to Sublime's own autocompletion? |
I am not sure how to display the auto-completion list. For now it could be just showing the possible completions, returned by IJulia. You can check my test here https://github.com/cbecker/Sublime-IJulia/tree/autocompletiontest I am not sure how to merge everything together, seems like the best solution requires quite a bit of coding to integrate it properly in sublime |
Working on this now. @one-more-minute, how do you do auto-completion in LightTable? I notice in particular that you are able to do completions for packages. Is that all through the Base REPLCompletions machinery, or do you have your own magic you're using? |
Take a look at Jewel.jl's completions.jl, all the logic is in there. I've tried not to make it too Light Table specific, so you should be able to call |
I'm not sure I understand the inputs to |
That's right, the idea is to pick up on the right context. You can only determine what module the user is in by parsing the whole file.
OTOH if you're not worried about supporting modules other than Main, you could always just pass a single line in, e.g. Jewel.allcompletions(" Pkg.", LNR.cursor(1, 7)) |
Ah, I see. So if I pass the whole file, then the module parsing is done in the completions.jl code? |
Currently this call actually does the parsing, but really |
Any activity on this? |
(Apologies if this is already implemented but I just cannot find the way to trigger it)
Is it possible to have auto-completion working within Sublime-IJulia, like plain IJulia or julia repl? This is extremely useful in many cases when debugging or trying to find functions/symbols. More specifically, I mean for example to type
str + <equivalent to tab>
and getI know there is base function auto-completion from sublime, but I wonder if something can be done to support the 'intrinsic' auto-completion of IJulia.
The text was updated successfully, but these errors were encountered: