RFR: JDK-8189595: jshell tool: line redrawn on each completion

Jan Lahoda jan.lahoda at oracle.com
Sun Oct 29 14:40:36 UTC 2017


On 27.10.2017 19:14, Robert Field wrote:
> As is, there are a couple of nits: "hasSmart && hasBoth" is redundant,
> "hasBoth" implies "hasSmart".  And with the approach, the last parameter
> of the OrdinaryCompletionTask constructor is incorrectly named.
>
> However, to the extent this fix works, it works by changing the behavior
> of:
>
>      494   boolean showItems = toShow.size() > 1 || smart;
>
> But I think this is the wrong test to be making.  Rather, I think, what
> needs to be tested is whether putting the prefixStr completes the
> completion.
>
> Example, before and after the fix:
>
> jshell> int zxgrr
> zxgrr ==> 0
>
> jshell> double zxgrr() { return 0; }
> |  created method zxgrr()
>
> jshell> int x = zx<tab>
>
> Yields a completion with "grr" and a show:
>
> jshell> int x = zxgrr
> zxgrr
>
> jshell> int x = zxgr

I guess the question is what should happen if one types:
jshell> zx<tab>

It currently does:
jshell> zxgrr
zxgrr     zxgrr()

jshell> zxgrr

And I think the smart handling is consistent with that (the items are 
present, only not displayed - overall the user needs to get to full 
items by pressing <tab>).

An alternative would be:
jshell> zx<tab>
//note - not repeat
jshell> zxgrr<tab>
zxgrr zxgrr()

jshell> zxgrr

In which case for in the smart case it would be:
jshell> int x = zx<tab>
jshell> int x = zxgrr<tab>
zsgrr
jshell> int x = zxgrr

Jan

>
> -Robert
>
>
>
> On 10/26/17 10:49, Jan Lahoda wrote:
>> Hi,
>>
>> Please review fix:
>> http://cr.openjdk.java.net/~jlahoda/8189595/webrev.00/
>>
>> For bug:
>> https://bugs.openjdk.java.net/browse/JDK-8189595
>>
>> Thanks,
>>     Jan
>


More information about the kulla-dev mailing list