mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-CR-29223 Support creating fields and constants from Java to Groovy (IDEA-186327)
This commit is contained in:
+2
-2
@@ -41,9 +41,9 @@ internal fun JvmModifier.toPsiModifier(): String = when (this) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiled classes, type parameters are not considered classes.
|
||||
* Compiled classes, type parameters, light classes(except GroovyScriptClass) are not considered classes.
|
||||
*
|
||||
* @return Java PsiClass or `null` if the receiver is not a Java PsiClass
|
||||
* @return GrTypeDefinition or `null` if the receiver is not a Groovy type definition.
|
||||
*/
|
||||
internal fun JvmClass.toGroovyClassOrNull(): GrTypeDefinition? {
|
||||
if (this !is GrTypeDefinition) return null
|
||||
|
||||
+3
-6
@@ -1,5 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package org.jetbrains.plugins.groovy.fixes
|
||||
|
||||
import com.intellij.psi.impl.source.PostprocessReformattingAspect
|
||||
@@ -46,9 +45,7 @@ class CreateConstantFromJavaUsageTest extends GrHighlightingTestBase {
|
||||
doTest()
|
||||
}
|
||||
|
||||
void testSuperInterfaceInheritor() {
|
||||
doTest( "Create constant field 'bar' in 'I'", 0)
|
||||
void testUppercaseInSuperInterface() {
|
||||
doTest( "Create constant field 'BAR' in 'I'", 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+1
-3
@@ -1,5 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package org.jetbrains.plugins.groovy.fixes
|
||||
|
||||
import com.intellij.psi.impl.source.PostprocessReformattingAspect
|
||||
@@ -41,7 +40,7 @@ class CreateFieldFromJavaUsageTest extends GrHighlightingTestBase {
|
||||
doTest()
|
||||
}
|
||||
|
||||
void testConstant() {
|
||||
void testUppercaseField() {
|
||||
doTest()
|
||||
}
|
||||
|
||||
@@ -73,7 +72,6 @@ class CreateFieldFromJavaUsageTest extends GrHighlightingTestBase {
|
||||
doTest()
|
||||
}
|
||||
|
||||
|
||||
void testParametricMethod() {
|
||||
doTest()
|
||||
}
|
||||
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
class Generic<T> {
|
||||
|
||||
public List<String>[] foo
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class Usage {
|
||||
void usage() {
|
||||
II.bar<caret>;
|
||||
II.BAR<caret>;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user