开发者

Grails console autocomplete

开发者 https://www.devze.com 2023-04-05 21:51 出处:网络
In Grails 1.3.7, the console plugin has any autocomplete feature? This would be particularly interesting to people learning the language as it 开发者_运维技巧allows for the exploration of methods inj

In Grails 1.3.7, the console plugin has any autocomplete feature? This would be particularly interesting to people learning the language as it 开发者_运维技巧allows for the exploration of methods injected at runtime.


While the console does not have an autocomplete feature, one thing you can do in the console to explore native and injected methods is use the Inspect * methods from the Script menu.

My personal favorite is Inspect Last. You'd use it like this:

  1. Create a simple program, with a trailing object:

    def foo = ""
    
  2. Run this program (CTRL+R or CMD+R)

  3. Choose Script > Inspect Last

It looks like this:

Grails console autocomplete

The reason that GroovyConsole doesn't have code completion is that while you are typing, those commands have not been run. Therefore, there is no practical way to determine the methods on the object at that moment. Even full-blown IDEs like IntelliJ are limited in the kinds of code completion they can offer.

0

精彩评论

暂无评论...
验证码 换一张
取 消