Eclipse content assist not working for Java objects within Groovy files -


I have received this question and I am facing the same problem, though, it is almost three years and I The current version is using Groovy Eclipse plugin, and no syntax errors are visible which are ANTLR confusing.

I also got the Groove / Grails tool suit , and got the same result.

I have filed a simple test case under which the contents of Groovy objects, and not the static member for Java objects , But there are no Java objects' methods.

Groove class:

  package test_groovy import test_groovy.FooJava class FooGroovy {def fooJava = [2, "baz"] as FooJava Def x = 4 def FooGroovy () {// Empty Constructor} def useFooJava () {// displays only Groovy methods, not Java containing strf = fooJava.getStr () println "Str: $ {str}" // stat stable member can be found through the content def str2 = FooJava.FOO_STR println "str2: $ {str2}" // It is also not found through content def str3 = fooJava .dumpToStr () println "Str3: $ {str3}"} def fooBar () {return x + 3} static zero main (def args) {def fooGroovy = [] FooGroovy // Groovy object methods can be found through content help DeafRez = fooGroovy.fooBar () println "res: $ {res}" fooGroovy.useFooJava ()}}  < / Pre> 

Java class:

  package test_groovy; Public class FooJava {Private long time; Private string str; Public static final string FOO_STR = "foo"; Public fujwa (long time, string str) {super (); This.bar = bar; This.str = str; } Public Large Mill () {Return Time; } Public Zero Set Bar (long time) {this.bar = bar; } Public string getStr () {return str; } Public Zero setStr (string str) {this.str = str; } Return the public string dumpto (str) {new string ("Str:" + str + ", bar:" + bar); }}  

i Eclipse Kepler Service Release 2, Groiwy compiler 2.0.7 and Groovy Eclipse plugin Version 2.8.0.xx-20130703-1600-e43-Relay

Java> Editor> Content Assist> Advanced Under the Preferences menu, I've ensured that all Java options Groovy content Check-off in addition to (Java non-type, Java, Java type offer) is checked.

Since this works for some people in general, I am wondering what I can remember to do this for working with Java object methods Will get help. Thank you.

I was thinking about this, and there was an idea that I just tested to work Content-Assistance, Although at least - Groove Conditions:

It seems that the root cause of the problem is that Groovy Eclipse can not do this < Autocomplete on the Em> Java object if they have been declared using Groovy using def , that is:

 FooJava def fooJava2 = new fuse as  FooJava = [2, "baz"] (3, "bar")  

Even though both of these cases, the type is known at compile time. I suspect that there is something like this with the fact that def is essentially a nickname for object , and even if technically known, it might possibly be

If I declare it in the traditional Java way, that is: FooJava3 = New FooJava (4, "foo")

Content help then give me the FooJava object.

Therefore, I can definitely do this in the future to work on this issue, but I am surprised that there is no way to make my cake and eat it basically. Any person has got a way to get material support to work on declared items through java def syntax, Until that type is known?


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -