Skip to content

Commit bba4cae

Browse files
committed
rearrange querybuilder completion condition checks, to do all the stuff after method match Haehnchen#371
1 parent 91dc9d7 commit bba4cae

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/fr/adrienbrault/idea/symfony2plugin/doctrine/querybuilder/QueryBuilderCompletionContributor.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,13 @@ protected void addCompletions(@NotNull CompletionParameters completionParameters
173173
return;
174174
}
175175

176-
// $qb->andWhere('foo.id = ":foo_id"')
177-
addParameterNameCompletion(completionParameters, completionResultSet, psiElement);
176+
MethodMatcher.MethodMatchParameter methodMatchParameter = new MethodMatcher.StringParameterMatcher(psiElement.getContext(), 0)
177+
.withSignature(WHERES)
178+
.match();
179+
180+
if(methodMatchParameter == null) {
181+
return;
182+
}
178183

179184
// querybuilder parser is too slow longer values, and that dont make sense here at all
180185
// user can fire a manual completion event, when needed...
@@ -186,13 +191,8 @@ protected void addCompletions(@NotNull CompletionParameters completionParameters
186191
}
187192
}
188193

189-
MethodMatcher.MethodMatchParameter methodMatchParameter = new MethodMatcher.StringParameterMatcher(psiElement.getContext(), 0)
190-
.withSignature(WHERES)
191-
.match();
192-
193-
if(methodMatchParameter == null) {
194-
return;
195-
}
194+
// $qb->andWhere('foo.id = ":foo_id"')
195+
addParameterNameCompletion(completionParameters, completionResultSet, psiElement);
196196

197197
QueryBuilderMethodReferenceParser qb = getQueryBuilderParser(methodMatchParameter.getMethodReference());
198198
if(qb == null) {

0 commit comments

Comments
 (0)