use of com.intellij.openapi.vfs.VirtualFileWithId in project intellij-community by JetBrains.
the class DomNamespaceKeyIndex method hasStubElementsWithNamespaceKey.
public boolean hasStubElementsWithNamespaceKey(final DomFileElement domFileElement, final String namespaceKey) {
final VirtualFile file = domFileElement.getFile().getVirtualFile();
if (!(file instanceof VirtualFileWithId))
return false;
final int virtualFileId = ((VirtualFileWithId) file).getId();
CommonProcessors.FindFirstProcessor<PsiFile> processor = new CommonProcessors.FindFirstProcessor<>();
StubIndex.getInstance().processElements(KEY, namespaceKey, domFileElement.getFile().getProject(), GlobalSearchScope.fileScope(domFileElement.getFile()), new IdFilter() {
@Override
public boolean containsFileId(int id) {
return id == virtualFileId;
}
}, PsiFile.class, processor);
return processor.isFound();
}
Aggregations