Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tyama/7227884 to your computer and use it in GitHub Desktop.
Save tyama/7227884 to your computer and use it in GitHub Desktop.
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