JShell tool: remove or keep default Edit Pad editor?
Paul Sandoz
paul.sandoz at oracle.com
Tue Oct 11 00:31:35 UTC 2016
Hi Robert,
IMO i think you should drop it, for many of the reasons you have stated. I suspect we may come to regret this dependency later on.
One approach for an out of the box solution is to split out the editor functionality into a separate module and for jshell to define a service provider interface. Thereby on a full JDK distribution you can the same functionality but on a more minimal distribution it is not present. A lesser solution is to provide the service provider interface and an example implementation that is not distributed, thereby teaching institutions could still use that.
However, there is still the slippery-slope argument, where developers may come to expect a live editing window with completion and JavaDoc display etc etc. This is where IDEs can better excel with good integration with jshell, so i think we should encourage that use-case.
Paul.
> On 10 Oct 2016, at 13:22, Robert Field <robert.field at oracle.com> wrote:
>
> Within the jshell tool, you can type:
>
> /edit foo
>
> or
>
> /edit
>
> To edit a specific snippet or all active snippets.
>
> If no external editor is specified in the jshell tool with:
>
> /set editor myfavoriteeditor
>
> then a built-in default editor "Edit Pad" is used.
>
> There are several reasons Edit Pad is there:
>
> * So that the jshell tool works out-of-the-box. Particularly for newbies it is important that they can use jshell without configuring it.
>
> * So that jshell can be platform-neutral. There is no editor that would work on every platform -- or even any configuration of a platform. This is an issue for documentation.
>
> * Because of interaction issues, including potentially needed flags, set-up of an external editor can be error prone. The external editor launch may need options set. If the editor returns immediately (sometimes or always) the jshell editor setting -wait should be used.
>
> * For newbies where the barrier to entry should be low, the challenges of learning an editor can be an issue. The Edit Pad is as simple as possible.
>
> There are however also many drawbacks to having the built-in editor:
>
> * It is a module anomaly to reference Desktop from core JDK tools.
>
> * Part of the definition of the jshell tool is that it is a command line tool. The Edit Pad is not command-line.
>
> * The Edit Pad functionality is a slippery-slope. There have already been requests for additional functionality -- on several fronts: interaction with jshell, more general editing functionality, and more Java-specific functionality.
>
> * The existence of a separate window in the jshell tool is a slippery-slope. There have already been requests for windows for I/O (both for clarity of separating commands from output and to address issues of interaction between command input and program input) and requests for windows with active variable values, etc.
>
> * The core JDK tools team does not have UI design as a core competency,
>
> We would very much like your input on this issue. A (motivated) thumbs-up/down are interesting. Alternative suggestions on addressing this are very interesting.
>
> Thanks,
> Robert et. al.
>
>
More information about the kulla-dev
mailing list