mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
invalid access due to reformat inside
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
abstract class Main {
|
||||
|
||||
private static String notification;
|
||||
|
||||
public static void main(String notification) throws Exception {
|
||||
Main.notification = notification;
|
||||
System.out.println(
|
||||
"Too large notification " + Main.notification +
|
||||
" of " + notification.getClass() +
|
||||
"\nListener=" + notification.substring(0));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -115,6 +115,14 @@ public class InplaceIntroduceFieldTest extends AbstractJavaInplaceIntroduceTest
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testNormalizeDeclarationWithDisabledFormatting() throws Exception {
|
||||
doTest(new Pass<AbstractInplaceIntroducer>() {
|
||||
@Override
|
||||
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testEscapePosition() throws Exception {
|
||||
doTestEscape();
|
||||
|
||||
+12
-6
@@ -38,6 +38,7 @@ import com.intellij.psi.PsiNamedElement;
|
||||
import com.intellij.psi.SmartPointerManager;
|
||||
import com.intellij.psi.SmartPsiElementPointer;
|
||||
import com.intellij.psi.codeStyle.SuggestedNameInfo;
|
||||
import com.intellij.psi.impl.source.PostprocessReformattingAspect;
|
||||
import com.intellij.refactoring.rename.NameSuggestionProvider;
|
||||
import com.intellij.refactoring.rename.PreferrableNameSuggestionProvider;
|
||||
import com.intellij.refactoring.rename.inplace.InplaceRefactoring;
|
||||
@@ -67,8 +68,8 @@ public abstract class InplaceVariableIntroducer<E extends PsiElement> extends In
|
||||
|
||||
public InplaceVariableIntroducer(PsiNamedElement elementToRename,
|
||||
Editor editor,
|
||||
Project project,
|
||||
String title, E[] occurrences,
|
||||
final Project project,
|
||||
String title, E[] occurrences,
|
||||
@Nullable E expr) {
|
||||
super(editor, elementToRename, project);
|
||||
myTitle = title;
|
||||
@@ -78,12 +79,17 @@ public abstract class InplaceVariableIntroducer<E extends PsiElement> extends In
|
||||
final ASTNode astNode = LanguageTokenSeparatorGenerators.INSTANCE.forLanguage(expr.getLanguage())
|
||||
.generateWhitespaceBetweenTokens(node.getTreePrev(), node);
|
||||
if (astNode != null) {
|
||||
new WriteCommandAction<Object>(project, "Normalize declaration") {
|
||||
PostprocessReformattingAspect.getInstance(project).disablePostprocessFormattingInside(new Runnable() {
|
||||
@Override
|
||||
protected void run(@NotNull Result<Object> result) throws Throwable {
|
||||
node.getTreeParent().addChild(astNode, node);
|
||||
public void run() {
|
||||
new WriteCommandAction<Object>(project, "Normalize declaration") {
|
||||
@Override
|
||||
protected void run(@NotNull Result<Object> result) throws Throwable {
|
||||
node.getTreeParent().addChild(astNode, node);
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
}.execute();
|
||||
});
|
||||
}
|
||||
myExpr = expr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user