Groups don't work on tab completion

36 views
Skip to first unread message

Brad Wood

unread,
Dec 28, 2017, 1:51:15 AM12/28/17
to jline...@googlegroups.com
I'm breaking this off into its own thread.  Here is the repro case for my issues with the "group" in tab completion candidates.  You never said how group was supposed to behave, but what I'm seeing certainly doesn't make much sense.  

Here's how to run the code:
  • Grab CommandBox CLI.  It's a binary that will run CFML code, a JVM language that CommandBox is written in.  (CommandBox is the app where I use Jline!)  You'll need the 4.0.0-snapshot build, which has JLine3 bundled
    http://integration.stg.ortussolutions.com/artifacts/ortussolutions/commandbox/4.0.0-SNAPSHOT/
    If you're on Windows, grab  commandbox-win-4.0.0-SNAPSHOT.zip and if you're on *nix, grab  commandbox-bin-4.0.0-SNAPSHOT.zip
  • Save the two attached files and place them in a directory
    • test.cfm is a script that creates JLine and generates a prompt
    • completor.cfc is my completor class
  • Run the test.cfm file like so:
    box test.cfm
  • When the prompt appears, hit the "tab" key.  
If you look at the completor, you'll see it is very simple and just adds 4 candidates.  Two of them have a group of "group1" and the other two have a group of "group2". Here is the output I see when I hit tab:

CommandBox> option_
group2
group1
option1   option2   option3   option4

The words "group1" and "group2" appear but they're just stuck up at the top and the actual candidates aren't grouped under their respective groups.  

If you want to play with CommandBox proper, just run box with no arguments and you'll get the normal shell.

Thanks!

~Brad

Developer Advocate
Ortus Solutions, Corp 

ColdBox Platform: http://www.coldbox.org 

test.cfm
completor.cfc

Brad Wood

unread,
Dec 29, 2017, 2:22:59 AM12/29/17
to jline-users
Let me know if I should create a ticket for this.

Thanks!

~Brad

Guillaume Nodet

unread,
Dec 29, 2017, 10:57:36 AM12/29/17
to jline...@googlegroups.com
Yes please. It definitely looks like a bug.

--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brad Wood

unread,
Dec 29, 2017, 2:13:22 PM12/29/17
to jline-users

Brad Wood

unread,
Jan 6, 2018, 3:17:46 PM1/6/18
to jline...@googlegroups.com
I saw that you completed the ticket so I gave it another test today.  I added a 5th option to my test as well in that had null for a group.

Inline image 1

This is an improvement for sure.  I have a few questions though.
  • What is the default ordering of the groups and can I change it?  
  • It seems like "others" should probably be at the bottom under the grouped candidates, not in the middle.
  • What do you think about some spacing or indention or something to help separate the group names from the candidates?
  • Can we change up the colors? Right now the "match what has been typed" color is the same as the group name color. Look at this screenshot:
Inline image 2

I've started typing the word "option" which matches the first part of all shown candidates but their color is the same as the group name colors so it all just sort of blend together.  Maybe we can make the group names bold, or another color entirely.

Thanks!

~Brad

Brad Wood

unread,
Jan 16, 2018, 6:11:29 PM1/16/18
to jline-users
Any feedback on my completion suggestions?

Thanks!

~Brad

Guillaume Nodet

unread,
Jan 17, 2018, 2:58:38 AM1/17/18
to jline...@googlegroups.com
Please raise issues when you'd like something to be addressed : the mailing list is fine for discussing things, but not so good to track them.
The colors are hard-coded:
The styling and sorting could definitely be made configurable somehow.


--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.

Brad Wood

unread,
Jan 17, 2018, 11:30:45 AM1/17/18
to jline...@googlegroups.com
Yes, I'm fine raising issues, but I wanted to see what was already implemented that I didn't know about.  Since there's no completion docs, I didn't want to make assumptions.

I boiled my feedback down to two main tickets:

Thanks!

~Brad

Developer Advocate
Ortus Solutions, Corp 

ColdBox Platform: http://www.coldbox.org 


Reply all
Reply to author
Forward
0 new messages