mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't use simple names in psi element factory. They can overload real variables
This commit is contained in:
+3
-3
@@ -260,7 +260,7 @@ public class GroovyPsiElementFactoryImpl extends GroovyPsiElementFactory {
|
||||
}
|
||||
|
||||
public GrClosableBlock createClosureFromText(String closureText, PsiElement context) throws IncorrectOperationException {
|
||||
GroovyFile psiFile = createGroovyFile("def foo = " + closureText, false, context);
|
||||
GroovyFile psiFile = createGroovyFile("def __hdsjfghk_sdhjfshglk_foo = " + closureText, false, context);
|
||||
final GrStatement st = psiFile.getStatements()[0];
|
||||
LOG.assertTrue(st instanceof GrVariableDeclaration, closureText);
|
||||
final GrExpression initializer = ((GrVariableDeclaration)st).getVariables()[0].getInitializerGroovy();
|
||||
@@ -282,7 +282,7 @@ public class GroovyPsiElementFactoryImpl extends GroovyPsiElementFactory {
|
||||
public GrParameter createParameter(String name, @Nullable String typeText, @Nullable String initializer, @Nullable GroovyPsiElement context)
|
||||
throws IncorrectOperationException {
|
||||
StringBuilder fileText = new StringBuilder();
|
||||
fileText.append("def foo(");
|
||||
fileText.append("def dsfsadfnbhfjks_weyripouh_huihnrecuio(");
|
||||
if (typeText != null) {
|
||||
fileText.append(typeText).append(" ");
|
||||
} else {
|
||||
@@ -433,7 +433,7 @@ public class GroovyPsiElementFactoryImpl extends GroovyPsiElementFactory {
|
||||
@NotNull
|
||||
@Override
|
||||
public GrAnnotation createAnnotationFromText(@NotNull @NonNls String annotationText, @Nullable PsiElement context) throws IncorrectOperationException {
|
||||
return createMethodFromText(annotationText + " void foo() {}", context).getModifierList().getAnnotations()[0];
|
||||
return createMethodFromText(annotationText + " void ___shdjklf_pqweirupncp_foo() {}", context).getModifierList().getAnnotations()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user