Skip to content

Instantly share code, notes, and snippets.

@kiy0taka
Last active December 26, 2015 22:59
Show Gist options
  • Save kiy0taka/7227559 to your computer and use it in GitHub Desktop.
Save kiy0taka/7227559 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')
}
}
@kiy0taka
Copy link
Author

(cd /Applications/IntelliJ\ IDEA\ 12.app/plugins/Grails/lib/standardDsls; curl -O https://gist.github.com/kiy0taka/7227559/raw/grails-domain-dbcollection.gdsl)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment