mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SSR: give script a different name from the var name, so it doesn't hide the var
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ public class ScriptSupport {
|
||||
File scriptFile = new File(text);
|
||||
GroovyShell shell = new GroovyShell();
|
||||
try {
|
||||
script = scriptFile.exists() ? shell.parse(scriptFile) : shell.parse(text, name);
|
||||
script = scriptFile.exists() ? shell.parse(scriptFile) : shell.parse(text, name + "_script.groovy");
|
||||
} catch (Exception ex) {
|
||||
Logger.getInstance(getClass().getName()).error(ex);
|
||||
throw new RuntimeException(ex);
|
||||
|
||||
+3
-2
@@ -1186,6 +1186,7 @@ public class StructuralSearchTest extends StructuralSearchTestCase {
|
||||
findMatchesCount(source2,
|
||||
"[script(\"" +
|
||||
"import com.intellij.psi.*\n" +
|
||||
"__context__ instanceof PsiElement &&" +
|
||||
"a instanceof PsiClass &&" +
|
||||
"b instanceof PsiTypeElement &&" +
|
||||
"c instanceof PsiField &&" +
|
||||
@@ -1195,8 +1196,8 @@ public class StructuralSearchTest extends StructuralSearchTestCase {
|
||||
"g instanceof PsiTypeElement &&" +
|
||||
"h instanceof PsiLocalVariable &&" +
|
||||
"i instanceof PsiPolyadicExpression &&" +
|
||||
"j instanceof PsiReferenceExpression" +
|
||||
"\n\")]" +
|
||||
"j instanceof PsiReferenceExpression\n" +
|
||||
"\")]" +
|
||||
"class '_a {" +
|
||||
" '_b '_c = '_d;" +
|
||||
" '_e '_f() {" +
|
||||
|
||||
Reference in New Issue
Block a user