mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IPP: don't do unnecessary reformatting of field when splitting declaration and initialization
This commit is contained in:
+1
-5
@@ -37,7 +37,6 @@ public class SplitDeclarationAndInitializationIntention extends Intention {
|
||||
@Override
|
||||
public void processIntention(@NotNull PsiElement element) {
|
||||
final PsiField field = (PsiField)element.getParent();
|
||||
field.normalizeDeclaration();
|
||||
final PsiExpression initializer = field.getInitializer();
|
||||
if (initializer == null) {
|
||||
return;
|
||||
@@ -96,10 +95,7 @@ public class SplitDeclarationAndInitializationIntention extends Intention {
|
||||
}
|
||||
}
|
||||
initializer.delete();
|
||||
final CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(manager.getProject());
|
||||
codeStyleManager.reformat(field);
|
||||
codeStyleManager.reformat(field);
|
||||
codeStyleManager.reformat(classInitializer);
|
||||
CodeStyleManager.getInstance(manager.getProject()).reformat(classInitializer);
|
||||
HighlightUtil.highlightElement(addedElement,
|
||||
IntentionPowerPackBundle.message(
|
||||
"press.escape.to.remove.highlighting.message"));
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
class Array {
|
||||
String s []<caret> = {};
|
||||
String s []<caret> = {};
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
class X {
|
||||
String s <caret>= {};
|
||||
String s <caret>= {};
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
class Array {
|
||||
String[] s;
|
||||
String s [];
|
||||
|
||||
{
|
||||
s = new String[]{};
|
||||
|
||||
Reference in New Issue
Block a user