Forked from kiy0taka/grails-domain-dbcollection.gdsl
Created
October 30, 2013 06:13
-
-
Save tyama/7227884 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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