![](/img/trans.png)
[英]Groovy-Grails Tool Suite (GGTS) content assist not recognizing basic groovy
[英]Groovy Grails Tool Suite: `static mapping` code block breaks syntax highlighting and content assist
將static mapping
代碼塊添加到grails域類時,內容輔助和語法突出顯示對該域類不再起作用。 這不僅影響.groovy域類文件,而且還影響工作區的其余部分。
重現步驟:
Test1
和Test2
位於同一包中。 測試1.groovy
package org.test
class Test1 {
Test2 someOtherObject
String someProperty
def doSomethingWithSomeProperty(){
someOtherObject.someMethod.replaceAll(/hello/, '$1 friend')
someProperty
}
}
測試1.groovy
package org.test
class Test2 {
String getSomeMethod(){
return 'hello'
}
}
到目前為止,一切都應該正常工作。 在Test1
someProperty和someMethod用藍色突出顯示,因為它們都是屬性或隱式調用的get方法。
現在,如果將static mapping
代碼塊添加到Test2
,則Test1
中someMethod
調用的語法突出顯示將從藍色變為黑色斜體。 同樣,內容輔助功能不再起作用。 帶下划線的replaceAll是因為實際上無法識別someMethod
。
這已經限制了可用性,但是如果您向Test1
添加另一個static mapping
代碼塊,則將不再能夠識別Test
方法。 刪除該塊后,一切都會再次正常運行。
我將優先級設置為“ major”,因為這乍看之下似乎微不足道,但是這會顯着降低所有工作流程的速度。 如果您沒有內容幫助告訴您錯別字,則錯字會更頻繁地發生。 如果這不是主要錯誤,則將其設置為次要。
我已經為此提交了一個問題 ,但是如果有人知道解決方法,請告訴我。
編輯:對不起,我忘了添加版本和操作環境信息:
操作系統:Windows 7 x64
IDE:GGTS 3.5.1
Grails:2.4.x
編輯2:無法與grails 1.3.7。
聽起來您在使用groovy eclipse插件時遇到問題。 您最好改為在此處提交錯誤: http : //jira.codehaus.org/browse/GRECLIPSE
GGTS只是已經安裝了Spring和Groovy插件的日食。
您可以嘗試更新到最新的開發人員快照,以查看是否可以解決問題。 只需使用您正在使用的Eclipse版本的更新站點即可。
http://groovy.codehaus.org/Eclipse+Plugin#EclipsePlugin-DevelopmentSnapshotBuilds
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.