How works usages highlighting in file? Problem with YAML

I've implemented com.intellij.openapi.application.QueryExecutorBase<PsiReference, ReferencesSearch.SearchParameters> for finding usages of YAML scalar values, but I have problem with usages highlighting in file. When I put cursor on element for which I provide find usages then editor higlights usages in the same file... but not only from this one! Editor also marks ranges from other files! (I think this is related with this problem).
scr.PNG

1 comment

Ok, I add following code to my com.intellij.openapi.application.QueryExecutorBase#processQuery implementation:

final SearchScope searchScope = queryParameters.getEffectiveSearchScope();
boolean consumeReference = false; if (searchScope instanceof LocalSearchScope) {      consumeReference = ((LocalSearchScope) searchScope).isInScope(virtualFile); } else if (searchScope instanceof GlobalSearchScope) {      consumeReference = ((GlobalSearchScope) searchScope).contains(virtualFile); } if (consumeReference) {      consumer.process(...); }


Which reslove described problem, but this is not explaining why this happens... Could someone explain how this should works (usages highlighting) or how should I process given find usage query?

0

Please sign in to leave a comment.