-
Notifications
You must be signed in to change notification settings - Fork 21
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
REPL: Make use of fancy JLine (3) features #12272
Comments
auto-indentation (https://github.com/jline/jline3/wiki/Auto-Indentation-and-Pairing#auto-indentation) would be cool too — so when you're entering a multi-line thing, e.g a class body would indent automatically |
another one: according to https://github.com/jline/jline3/wiki/Language-REPL-Support , if we use the status bar feature, "the location of the error in the input area [can be] highlighted", that's pretty cool |
🤤 want! |
I also found the status bar demo a major reason to try out jline 3. I also fantasized. |
We have to do auto-indent, Jan Lahoda just mentioned it for jshell.
|
Those auto-complete groups are so nice. Can we easily get to the scaladoc |
if we want to make use of strikethrough text, note that JLine calls it "crossed out". see |
I don't intend to tackle this one myself, but perhaps a volunteer would like to. |
I guess I should make a more blanket statement about this. As per scala/scala-dev#754 , I intend to make a fresh attempt at grouping tab completions (#12281). Other than that, I don't intend to tackle anything else mentioned here in this ticket. It's all open for volunteers. |
Breifly looking through JLine's tickets and examples, there are a number of features that we could potentially make use of to brush up the REPL experience.
Their example class: https://github.com/jline/jline3/blob/master/builtins/src/test/java/org/jline/example/Example.java
I managed to get it to run with
mvn install
and then runningand providing some random args that are then suggested (
color
,argument
,mouse
, ...). Then typingtab
shows a completion matrix.There's also the
./demo/jline-repl.sh
that you can run aftermvn install
, not sure what it does :-)Some features to look at
Groups for completions. For example, we could have groups for "core members", "extension methods", "deprecated members", "inherited from AnyRef/Any". This would replace the feature that today more members show up when requesting the same completion twice. random screenshot
Show signature of method in a "status bar", or maybe in a completion "group" at the bottom that is visually different. This should replace the double
tab
feature that today shows the signature of the method in the prompt. It could also display the signature of a member when navigating through the completion matrix with the arrow keys.java -cp builtins/target/classes:builtins/target/test-classes:reader/target/classes:terminal/target/classes org.jline.example.Example status
shows a status bar with a counter at the bottom, maybe we can use that?TailTipWidgets
, I'm not exactly sure what it is, maybe the light-gray explanation that shows up next to completion items when runningorg.jline.example.Example argument
. Picture:Example
program, hittingtab
after a command is entered, a suggestion in gray then shows up on the next line. This looks like what we could use for signatures.Maybe use autosuggestion? Suggests completing the current command being entered as you type.
mouse
enables moving the cursor with mouse clicksThere is probably more in JLine that we can make use of.
The text was updated successfully, but these errors were encountered: