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

Jan Lahoda jan.lahoda at oracle.com
Tue Apr 4 13:27:03 UTC 2017


Thanks for the comments. I prepared three patches (see inline comments) 
for individual parts (so that we can skip some of them for 9 if needed), 
a complete webrev is here:
http://cr.openjdk.java.net/~jlahoda/8178013/webrev.00/

On 1.4.2017 01:57, John Rose wrote:
> On Mar 27, 2017, at 1:39 AM, Jan Lahoda <jan.lahoda at oracle.com
> <mailto: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" …

Webrev for the two above is here:
http://cr.openjdk.java.net/~jlahoda/8178013/webrev.a.00/

>
> 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?

Webrev for this is here:
http://cr.openjdk.java.net/~jlahoda/8178013/webrev.b.00/

>
>
> 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.

Webrev for this is here:
http://cr.openjdk.java.net/~jlahoda/8178013/webrev.c.00/index.html

Any comments are welcome.

Thanks,
     Jan

>
> — 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