Groovy Shell doesn't support any commands?
IntelliJIDEA 12.1.3 Community Edition
Windows 7 64bit
I just started using IntelliJ and wanted to be able to use the Groovy Shell to interactively try various java (and Groovy) things, but the Groovy Shell doesn't support any commands?
If I start groovysh from the command line, I can enter the "help" command to see all sort of commands that the Groovy Shell supports:
Available commands:
help (\h ) Display this help message
? (\? ) Alias to: help
exit (\x ) Exit the shell
quit (\q ) Alias to: exit
import (\i ) Import a class into the namespace
display (\d ) Display the current buffer
clear (\c ) Clear the buffer and reset the prompt counter.
show (\S ) Show variables, classes or imports
inspect (\n ) Inspect a variable or the last result with the GUI object browser
purge (\p ) Purge variables, classes, imports or preferences
edit (\e ) Edit the current buffer
load (\l ) Load a file or URL into the buffer
. (\. ) Alias to: load
save (\s ) Save the current buffer to a file
record (\r ) Record the current session to a file
history (\H ) Display, manage and recall edit-line history
alias (\a ) Create an alias
set (\= ) Set (or list) preferences
register (\rc) Registers a new command with the shell
It would be nice to be able to use the following commands in IntelliJ's version of the Groovy Shell: show, inspect, purge, alias, set, register.
However, when I use Tools -> Groovy Shell from within IntelliJ I get:
groovy.lang.MissingPropertyException: No such property: help for class: ideaGroovyConsole
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at ideaGroovyConsole.run(ideaGroovyConsole.groovy:1)
at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:257)
at groovy.lang.GroovyShell.run(GroovyShell.java:481)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:231)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:64)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
at console.run(console.txt:25)
at groovy.ui.GroovyMain.processReader(GroovyMain.java:531)
at groovy.ui.GroovyMain.processFiles(GroovyMain.java:441)
at groovy.ui.GroovyMain.run(GroovyMain.java:341)
at groovy.ui.GroovyMain.process(GroovyMain.java:329)
at groovy.ui.GroovyMain.processArgs(GroovyMain.java:118)
at groovy.ui.GroovyMain.main(GroovyMain.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:106)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)
Why doesn't this work?
请先登录再写评论。
Hello,
I've created an issue http://youtrack.jetbrains.com/issue/IDEA-107520. Feel free to vote.
Max Medvedev