Skip to content

Code Completion #12

Open
Open

Description

@Qtrain

I know that code completion works in JShell. Is there any way to get it working in the notebooks?

Activity

  1. dsblank commented on Nov 17, 2015

    @dsblank
    Collaborator

    With MetaKernel, it already does code completion for variables, methods, and classes. That is possible because /vars, /methods, and /classes are commands. If there were a way to ask for code completions in general, then you could do it for any string. This would be one benefit of writing a kernel in Java. Without doing that, you need a way to get that info from the command line.

  2. Qtrain commented on Nov 17, 2015

    @Qtrain
    Author

    @dsblank Ah! That makes sense. I was trying to complete Sys to System. This would def be a nice feature.

  3. Bachmann1234 commented on Nov 18, 2015

    @Bachmann1234
    Owner

    Does JShell support code completion? This project is not using (http://geophile.com/jshell/) Its using the Java 9 Repel which is a completely different shell. I dont think the Java 9 Repel (also called jshell annoyingly) supports code completion.

    I could be wrong. I am not export on this stuff honestly. This project has honestly gotten more attention than I expected

  4. Qtrain commented on Nov 18, 2015

    @Qtrain
    Author

    Wait, this uses Kulla which is JShell??

    Edit: I think, perhaps, I may have been spreading the wrong info. I don't think that's the kulla jar, which is the link you provided (I think?) In any case I think we are all using the kulla jar which contains JShell (or is hell i don't know haha).

  5. Bachmann1234 commented on Nov 18, 2015

    @Bachmann1234
    Owner

    So Kulla is a jar that is linked to Java 9s repel which is called jshell (http://openjdk.java.net/projects/kulla/)

    In the issue you opened earlier you linked this project (http://geophile.com/jshell/) but its not the same thing. Or at least I am fairly sure its not.

    Big thing is kulla only works on Java 9 while the link above works on Java 1x. and has not been updated since 2000

    I mean, perhaps im the confused one. :-P

  6. Qtrain commented on Nov 18, 2015

    @Qtrain
    Author

    Ha yes indeed and I am the perpetrator of such misinformation. I have given myself 40 lashings as penance.

  7. Bachmann1234 commented on Nov 18, 2015

    @Bachmann1234
    Owner

    hey man, No worries. alrighty im gonna close this one as "Outside the scope"

  8. Qtrain commented on Nov 18, 2015

    @Qtrain
    Author

    Au Contraire my friend, kulla does support code completion.

  9. dsblank commented on Nov 18, 2015

    @dsblank
    Collaborator

    I think code completion could be done. Currently there are two completions in kulla/JShell:

    • TAB, turns Sys into System, and System.o into System.out
    • SHIFT+TAB turns System.out.println( into this output:
    -> System.out.println(
    java.io.PrintStream.println(boolean arg0)
    java.io.PrintStream.println(char arg0)
    java.io.PrintStream.println(int arg0)
    java.io.PrintStream.println(long arg0)
    java.io.PrintStream.println(float arg0)
    java.io.PrintStream.println(double arg0)
    java.io.PrintStream.println(char[] arg0)
    java.io.PrintStream.println(java.lang.String arg0)
    java.io.PrintStream.println(java.lang.Object arg0)
    

    The current java9_kernel uses pexpect to send and receive commands. It should be possible to either:

    1. send a string with TAB or SHIFT+TAB and get back results
    2. change kulla to add new command(s), like /complete to do what TAB and SHIFt+TAB do
  10. Bachmann1234 commented on Nov 18, 2015

    @Bachmann1234
    Owner

    Ok OK. Reopened. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions