RFR 9: JDK-8177076: jshell tool: usability of completion

John Rose john.r.rose at oracle.com
Fri Mar 31 23:57:06 UTC 2017


On Mar 27, 2017, at 1:39 AM, Jan Lahoda <jan.lahoda at oracle.com> wrote:
> 
> Hello,
> 
> I'd like to ask for a review of a patch that merges shift-tab and tab completions, and changes the fix shortcut to shift-tab:
> Bug: https://bugs.openjdk.java.net/browse/JDK-8177076
> Webrev: http://cr.openjdk.java.net/~jlahoda/8177076/webrev.00/
> 
> Any feedback is welcome,
>     Jan


A couple of comments (on webrev.03):

This help string has the wrong whitespace:

+        a variable declaration whose type is based on the type of the expression.\n\t\t\
+Shift-<tab> i\n\t\t\

The first \n\t\t\ should be \n\n.

Help strings should not mention <fix> anymore:

+Invalid <fix> character.  Use "i" for auto-import or "v" for variable creation.  For more information see:\n\
+   /help shortcuts

I suggest:  Unexpected character after Shift-Tab.  Use "i" …

I built your patch and tried it out.  I like the new behavior very much.
The "Shift-Tab i" command is more friendly.

Thanks!

I noticed a couple of oddities.

First of all, "/help /set <Tab>" prints the "/set" subcommands, but "/help set <Tab>" does not.

jshell> /help /set <Tab>
editor       feedback     format       mode         prompt       start        truncation   
jshell> /help set <Tab>
get information about jshell   <==== YES, I THOUGHT I WAS DOING THAT?


Second, when completing inside help subcommands, the "todo" list is packed with generic
"help on help", which promises information but isn't that useful.  If you are already saying
"/help intro <Tab>" it doesn't seem very helpful to back up to the same help text as
"/help <Tab><Tab>".

A further example of the odd help-doc is below.

— John

jshell> /help /set tr<Tab>
===REDRAW===>
jshell> /help /set truncation<Tab>
<press tab again to see synopsis>

jshell> /help /set truncation<Tab>
get information about jshell   <==== NOT A SYNOPSIS OF "truncation"

<press tab again to see full documentation>

jshell> /help /set truncation<Tab>
Display information about jshell.   <==== NOT FULL DOC OF "truncation"
/help
    List the jshell commands and help subjects.

/help <command>
    Display information about the specified command. The slash must be included.
    Only the first few letters of the command are needed -- if more than one
    each will be displayed.  Example:  /help /li

/help <subject>
    Display information about the specified help subject. Example: /help intro

jshell> 



More information about the kulla-dev mailing list