简体   繁体   中英

Groovy-Grails Tool Suite (GGTS) content assist not recognizing basic groovy

I have installed GGTS, on ubuntu and am trying to edit .Groovy files with the built in editor.

The autocomplete is extremely annoying because while it will recognize my domain objects ie my User class etc.. It doesn't recognize basic groovy, for instance I start typing "def" to define a variable then hit space and it will autocomplete to "Default", similarly if I try to type in "return" it autocompletes to "RETURN" while I am typing as soon as I hit space, which is very annoying.

Like i said it will recognize classes, so if I type def u = new User(), the User part will complete ok, but the problem is that the variable u I defined earlier isn't recgonized later in the code.

I hope you guys get my meaning... No idea how to fix it, short of not using the groovy editor and treating it as plain text. I even tried disabling content assist, but that didn't seem to work for some reason

I was having this problem in GGTS 3.4.0.RELEASE today, and getting very angry with the situation.

Somehow my workspace had the "Auto activation triggers for Java" set to "_.abcd....z" (all the lowercase letters)

Window -> Preferences Java -> Editor -> Content Assist "Auto activation triggers for Java" set to just "."

This seems to have helped dramatically.

I'm still not sure what caused my workspace to have this setting.

Make sure that you're in the Grails perspective; that can impact some of the Groovy/Grails features and how Eclipse (even GGTS) leverages them. You'll find the perspective button in the upper right. If you're in Java or Debug, odd things like this may occur.

Also, how are you creating and opening your Groovy files? Do you use the context menus or the Grails command prompt tool to issue orders like "create-controller"? If you're creating the files in some other way, try using those methods to generate them, and see if you get the same results.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM