JShell: three small proposal/feedback
KUBOTA Yuji
kubota.yuji at gmail.com
Tue Apr 5 10:11:31 UTC 2016
Hi all,
Thank you for your quickly responses!
>> 1. /edit display warn instead of quit by HeadlessException in headless mode
2016-04-05 1:54 GMT+09:00 Brian Goetz <brian.goetz at oracle.com>:
>> That would be good.
> I might extend this to "catch (RuntimeException e)" -- if there's any
> problem loading the editor, the show should go on.
Thanks for comments. I will extend the exception to RuntimeException,
then file it. Please wait a bit. -- I'm a beginner author :p
>> 2. /-n return the available range rather than calculated "n"
2016-04-05 1:05 GMT+09:00 Robert Field <robert.field at oracle.com>:
> How would this be useful to you? I'm thinking there might be a more
> intuitive approach.
Sorry for poor description. When I got the result "0" (or negative number)
for the first time, I could not understand what the number mean.
So I think we should display the available range instead of calculated
number by jshell.
I agree with your comment, I think that jshell should show how to
confirm previous snippets -- /list all or add /list previous to show
the list with -<n> line as below.
Example:
-> /-10
| Cannot find snippet, select -<n> between 1 - 9
| To show previous snippet with -<n>, try /list previous
-> /list previous
-9 : import java.util.*;
-8 : import java.io.*;
-7 : import java.math.*;
:
-2 : void printf(String format, Object... args) {
System.out.printf(format, args); }
-1 : printf("Add by hand")
If /list previous is acceptable, I will add it. Is it acceptable and intuitive?
>> 3. Implement /show command to confirm the current configuration
2016-04-05 2:57 GMT+09:00 John Rose <john.r.rose at oracle.com>:
> On Apr 4, 2016, at 9:05 AM, Robert Field <robert.field at oracle.com> wrote:
>>
>> Indeed, some kind of query for configuration is needed. However start can be big (though that can be saved), and format can be huge. How would prompt be displayed?
>
> Suggestions:
> a. Organize the output to be like a /history dump that shows how to recover the relevant state. (Could be verbose.)
> b. Organize the output to be like the gdb command "set show". (E.g., "set show platform".) Suggests an organization for settings too.
Thanks for comment and suggestions! Yes, especially format can be huge.
So I would like to adopt suggestion a. to enable recovering easy.
I think we might select the following two approach.
i) Adopt suggestion a. to "/show format" and "/show
[editor|start|feedback|mode|prompt] history"
ii) Adopt suggestion a. to all /show commands
i): Some commands show information with description, and others dump
history as below.
- "/show format" display the history of all /set format command.
- "/show format <mode>" display the history of /set format <specified
mode> command.
- "/show start" show current configured file name.
- "/show start history" display the history of /set start <file>.
- "/show [editor|feedback|mode|prompt]" show current configuration
with description as "start"
- "/show [editor|feedback|mode|prompt]" history" display the history
of related command as "start"
ii): /show XXX always display the history of /set XXX commands as /history
I think i) is better approach for users. Could you please tell me what
do you think about it?
Thanks for reading!
Yuji.
More information about the kulla-dev
mailing list