Skip to content

Instantly share code, notes, and snippets.

import com.intellij.patterns.PsiJavaPatterns
import com.intellij.patterns.PlatformPatterns
def ctx = context(
ctype: PsiJavaPatterns.psiClass().withName(PlatformPatterns.string().matches(/.*/))
)
contributor(ctx) {
def path = ""
try {
path = psiClass.containingFile.originalFile.virtualFile.path
} catch (Exception e) {}
if (path =~ ".*/grails-app/domain/.*") {
property(name:'collection', type:'com.mongodb.DBCollection')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment