7
7
8
8
import com .intellij .openapi .command .WriteCommandAction ;
9
9
import com .intellij .openapi .editor .Document ;
10
- import com .intellij .openapi .editor .SelectionModel ;
11
10
import com .intellij .openapi .project .Project ;
12
11
import com .intellij .openapi .util .TextRange ;
13
12
import com .intellij .psi .PsiDocumentManager ;
19
18
import com .magento .idea .magento2plugin .actions .generation .generator .util .XmlFilePositionUtil ;
20
19
import com .magento .idea .magento2plugin .magento .files .CommonXml ;
21
20
import com .magento .idea .magento2plugin .magento .files .LayoutXml ;
22
- import org .jetbrains .annotations .NotNull ;
23
-
24
21
import java .io .IOException ;
25
22
import java .util .List ;
26
23
import java .util .Properties ;
@@ -96,7 +93,7 @@ public PsiFile generate(final XmlTag xmlTag) {
96
93
document .insertString (insertPos , textBuf );
97
94
98
95
final int endPos = insertPos + textBuf .length () - 1 ;
99
- List <TextRange > ranges = getSelectedRanges (insertPos , endPos );
96
+ final List <TextRange > ranges = getSelectedRanges (insertPos , endPos );
100
97
101
98
CodeStyleManager .getInstance (project ).reformatText (
102
99
layoutFile ,
@@ -110,19 +107,19 @@ public PsiFile generate(final XmlTag xmlTag) {
110
107
return layoutFile ;
111
108
}
112
109
113
- protected List <TextRange > getSelectedRanges (int insertPosition , int endPosition ) {
110
+ protected List <TextRange > getSelectedRanges (final int insertPosition , final int endPosition ) {
114
111
final int argumentsTagLength = 13 ;
115
112
final List <TextRange > ranges = new SmartList <>();
116
113
117
- TextRange insertRange = TextRange .create (
118
- insertPosition - argumentsTagLength ,
119
- insertPosition + 1
114
+ final TextRange insertRange = TextRange .create (
115
+ insertPosition - argumentsTagLength ,
116
+ insertPosition + 1
120
117
);
121
118
ranges .add (insertRange );
122
119
123
- TextRange endRange = TextRange .create (
124
- endPosition ,
125
- endPosition + argumentsTagLength
120
+ final TextRange endRange = TextRange .create (
121
+ endPosition ,
122
+ endPosition + argumentsTagLength
126
123
);
127
124
ranges .add (endRange );
128
125
0 commit comments