File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/fr/adrienbrault/idea/symfony2plugin/templating/util Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -90,11 +90,14 @@ public boolean value(PsiElement psiElement) {
90
90
}
91
91
});
92
92
93
+ ArrayList <PhpNamedElement > arrayList = new ArrayList <PhpNamedElement >();
94
+ if (twigCompositeElement == null ) {
95
+ return arrayList ;
96
+ }
93
97
94
98
Pattern pattern = Pattern .compile ("\\ {#[\\ s]+" + Pattern .quote (variableName ) + "[\\ s]+([\\ w\\ \\ \\ [\\ ]]+)[\\ s]+#}" );
95
99
Collection <PsiComment > psiComments = PsiTreeUtil .findChildrenOfType (twigCompositeElement , PsiComment .class );
96
100
97
- ArrayList <PhpNamedElement > arrayList = new ArrayList <PhpNamedElement >();
98
101
for (PsiComment psiComment : psiComments ) {
99
102
Matcher matcher = pattern .matcher (psiComment .getText ());
100
103
if (matcher .find ()) {
@@ -129,10 +132,13 @@ public boolean value(PsiElement psiElement) {
129
132
}
130
133
});
131
134
132
- Pattern pattern = Pattern .compile (DOC_PATTERN );
135
+ HashMap <String , String > variables = new HashMap <String , String >();
136
+ if (twigCompositeElement == null ) {
137
+ return variables ;
138
+ }
133
139
134
140
// wtf in completion { | } root we have no comments in child context !?
135
- HashMap < String , String > variables = new HashMap < String , String >( );
141
+ Pattern pattern = Pattern . compile ( DOC_PATTERN );
136
142
for (PsiElement psiComment : YamlHelper .getChildrenFix (twigCompositeElement )) {
137
143
if (psiComment instanceof PsiComment ) {
138
144
Matcher matcher = pattern .matcher (psiComment .getText ());
You can’t perform that action at this time.
0 commit comments