diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/GroovyDslExecutor.groovy b/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/GroovyDslExecutor.groovy
index 3cf1d94cfaf1..3290efc2b831 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/GroovyDslExecutor.groovy
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/GroovyDslExecutor.groovy
@@ -105,8 +105,12 @@ public class GroovyDslExecutor {
return StringUtil.compareVersionNumbers(ideaVersion, ver) >= 0
}
else if (ver instanceof Map) {
- def we = ver.ide?.intellij
- return we != null && StringUtil.compareVersionNumbers(ideaVersion, we) >= 0
+ if (ver.dsl) {
+ return StringUtil.compareVersionNumbers('1.0', ver.dsl) >= 0
+ }
+ if (ver.intellij) {
+ return StringUtil.compareVersionNumbers(ideaVersion, ver.intellij) >= 0
+ }
}
return false
}
diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/dsl/DsldTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/dsl/DsldTest.groovy
index 026426453834..d2c534dad083 100644
--- a/plugins/groovy/test/org/jetbrains/plugins/groovy/dsl/DsldTest.groovy
+++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/dsl/DsldTest.groovy
@@ -127,13 +127,13 @@ def doo() { println foo }
public void testSupportsVersion() {
checkHighlighting '''
-if (supportsVersion(ide:[intellij:'9.0'])) {
+if (supportsVersion(intellij:'9.0')) {
contribute(currentType("java.lang.String")) { property name:"foo" }
} else {
contribute(currentType("java.lang.String")) { property name:"bar" }
}
-if (!supportsVersion(ide:[groovyEclipse:'9.0'])) {
+if (!supportsVersion(groovyEclipse:'9.0')) {
contribute(currentType("java.lang.String")) { property name:"goo" }
}
''',
@@ -142,7 +142,15 @@ if (!supportsVersion(ide:[groovyEclipse:'9.0'])) {
public void testAssertVersion() {
checkHighlighting '''
-assertVersion ide:[intellij:'9.0']
+assertVersion dsl:'1.0'
+contribute(currentType("java.lang.String")) { property name:"foo" }
+''',
+ 'println "".foo'
+ }
+
+ public void testAssertVersionDsl() {
+ checkHighlighting '''
+assertVersion intellij:'9.0'
contribute(currentType("java.lang.String")) { property name:"foo" }
''',
'println "".foo'
@@ -150,7 +158,15 @@ contribute(currentType("java.lang.String")) { property name:"foo" }
public void testAssertVersionFail() {
checkHighlighting '''
-assertVersion ide:[intellij:'239.0']
+assertVersion intellij:'239.0'
+contribute(currentType("java.lang.String")) { property name:"foo" }
+''',
+ 'println "".foo'
+ }
+
+ public void testAssertVersionFailDsl() {
+ checkHighlighting '''
+assertVersion dsl:'239.0'
contribute(currentType("java.lang.String")) { property name:"foo" }
''',
'println "".foo'