More fix around suggestions for the multi-line code.
ShinyaYoshida
bitterfoxc at gmail.com
Thu Mar 26 16:51:40 UTC 2015
Hi Jan,
Thank you for your review.
Certainly, the dependent is not good and passing the current prefix is
looks good to me. I agree with you.
Your patch looks almost good to me.
But, I think you should add a little of fix to resolve "3: Print method
documentation in multi-line code" of previous my mail:
(...)
@@ -1434,7 +1435,7 @@
String buffer = in.getCursorBuffer().buffer.toString();
int cursor = in.getCursorBuffer().cursor;
String doc;
- if (buffer.trim().startsWith("/")) {
+ if (prefix.isEmpty() && buffer.trim().startsWith("/")) {
doc = repl.commandDocumentation(buffer, cursor);
} else {
- doc = repl.analysis.documentation(buffer, cursor); // HERE
+ doc = repl.analysis.documentation(prefix + buffer, cursor +
prefix.length()) // HERE
Regards,
shinyafox(Shinya Yoshida)
2015-03-27 1:23 GMT+09:00 Jan Lahoda <jan.lahoda at oracle.com>:
> Hi Shinya,
>
> Thanks for the report and patch. Thinking about this, I was not sure if
> making ConsoleIOContext more dependent on details in the Repl class is a
> good direction. I think it may be better to simply pass the current
> "prefix" (incomplete String) into the IOContext.readLine - any particular
> IOContext may then decide what to do with the current prefix. This would
> avoid tight coupling between ConsoleIOContext and Repl classes.
>
> A patch implementing that is attached - what do you think?
>
> Thanks,
> Jan
>
>
> On 26.3.2015 14:01, ShinyaYoshida wrote:
>
>> Hi Jan,
>> Thank you for your pushing my patch.
>>
>> I have more patch around suggestions for the multi-line code.
>>
>> Please review my patch.
>> webrev: http://cr.openjdk.java.net/~shinyafox/kulla/201503262/webrev.00/
>>
>> 1. Find suggestions, considering the incompleting code:
>>
>> Currently, REPL prints all suggestions for the following code:
>>
>> ----
>> ->"".
>>
>>> [TAB]Display all 446 possibilities? (y or n)
>>>>
>>> ----
>>
>> But, it should print members of String class.
>>
>> ----
>> ->"".
>>
>>> [TAB]
>>>>
>>>
>> CASE_INSENSITIVE_ORDER String( charAt( etc...
>> ----
>>
>> 2. Don't print a command documentation in the multi-line code:
>>
>> Currently, REPL prints the command documentation in the multi-line code.
>>
>> ----
>> ->"".
>>
>>> /list all[SHIFT+TAB]
>>>>
>>> list the source you have typed
>> ----
>>
>> But, it shouldn't print the command documentation.
>>
>> 3. Print method documentation in multi-line code:
>>
>> Currently, REPL don't print the method documentation in the multi-line
>> code.
>> But, it should print the method documentation such as following:
>>
>> ----
>> ->"".
>>
>>> split([SHIFt+TAB]
>>>>
>>> java.lang.String.split(java.lang.String arg0, int arg1)
>> java.lang.String.split(java.lang.String arg0)
>> ----
>>
>> Regards,
>> shinyafox(Shinya Yoshida)
>>
>>
More information about the kulla-dev
mailing list