public class PsiSearchHelperImpl extends java.lang.Object implements PsiSearchHelper
Modifier and Type | Class and Description |
---|---|
static class |
PsiSearchHelperImpl.Options |
PsiSearchHelper.SearchCostResult, PsiSearchHelper.SERVICE
Constructor and Description |
---|
PsiSearchHelperImpl(Project project) |
PsiSearchHelperImpl(PsiManagerEx psiManager)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
PsiElement [] |
findCommentsContainingIdentifier(java.lang.String identifier,
SearchScope searchScope)
Searches the specified scope for comments containing the specified identifier.
|
PsiFile [] |
findFilesWithPlainTextWords(java.lang.String word)
Returns the list of files which contain the specified word in "plain text"
context (for example, plain text files or attribute values in XML files).
|
SearchScope |
getUseScope(PsiElement element)
Returns the scope in which references to the specified element are searched.
|
PsiSearchHelper.SearchCostResult |
isCheapEnoughToSearch(java.lang.String name,
GlobalSearchScope scope,
PsiFile fileToIgnoreOccurrencesIn,
ProgressIndicator progress) |
boolean |
processAllFilesWithWord(java.lang.String word,
GlobalSearchScope scope,
Processor<? super PsiFile> processor,
boolean caseSensitively)
Passes all files containing the specified word in
code
context to the specified processor. |
boolean |
processAllFilesWithWordInComments(java.lang.String word,
GlobalSearchScope scope,
Processor<? super PsiFile> processor)
Passes all files containing the specified word in
comments
context to the specified processor. |
boolean |
processAllFilesWithWordInLiterals(java.lang.String word,
GlobalSearchScope scope,
Processor<? super PsiFile> processor)
Passes all files containing the specified word in
string literal
context to the specified processor. |
boolean |
processAllFilesWithWordInText(java.lang.String word,
GlobalSearchScope scope,
Processor<? super PsiFile> processor,
boolean caseSensitively)
Passes all files containing the specified word in
plain text
context to the specified processor. |
boolean |
processCandidateFilesForText(GlobalSearchScope scope,
short searchContext,
boolean caseSensitively,
java.lang.String text,
Processor<? super VirtualFile> processor)
Given a text, scope and other search flags, runs the processor on all indexed files that contain all words from the text.
|
boolean |
processCommentsContainingIdentifier(java.lang.String identifier,
SearchScope searchScope,
Processor<? super PsiElement> processor)
Processes the specified scope and hands comments containing the specified identifier over to the processor.
|
boolean |
processElementsWithWord(TextOccurenceProcessor processor,
SearchScope searchScope,
java.lang.String text,
short searchContext,
boolean caseSensitive) |
boolean |
processElementsWithWord(TextOccurenceProcessor processor,
SearchScope searchScope,
java.lang.String text,
short searchContext,
boolean caseSensitive,
boolean processInjectedPsi) |
boolean |
processElementsWithWord(TextOccurenceProcessor processor,
SearchScope searchScope,
java.lang.String text,
short searchContext,
java.util.EnumSet<PsiSearchHelperImpl.Options> options,
java.lang.String containerName) |
AsyncFuture<java.lang.Boolean> |
processElementsWithWordAsync(TextOccurenceProcessor processor,
SearchScope searchScope,
java.lang.String text,
short searchContext,
boolean caseSensitively) |
static boolean |
processFilesConcurrentlyDespiteWriteActions(Project project,
java.util.List<? extends VirtualFile> files,
ProgressIndicator progress,
java.util.concurrent.atomic.AtomicBoolean stopped,
Processor<? super VirtualFile> localProcessor) |
boolean |
processRequests(SearchRequestCollector collector,
Processor<? super PsiReference> processor) |
AsyncFuture<java.lang.Boolean> |
processRequestsAsync(SearchRequestCollector collector,
Processor<? super PsiReference> processor) |
boolean |
processUsagesInNonJavaFiles(PsiElement originalElement,
java.lang.String qName,
PsiNonJavaFileReferenceProcessor processor,
GlobalSearchScope initialScope)
Passes all occurrences of the specified fully qualified class name in plain text context in the
use scope of the specified element to the specified processor.
|
boolean |
processUsagesInNonJavaFiles(java.lang.String qName,
PsiNonJavaFileReferenceProcessor processor,
GlobalSearchScope searchScope)
Passes all occurrences of the specified full-qualified class name in plain text context
to the specified processor.
|
static boolean |
shouldProcessInjectedPsi(SearchScope scope) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInstance
public PsiSearchHelperImpl(Project project)
@Deprecated public PsiSearchHelperImpl(PsiManagerEx psiManager)
PsiSearchHelperImpl(Project)
public SearchScope getUseScope(PsiElement element)
PsiSearchHelper
PsiElement.getUseScope()
and also the results returned from the registered
com.intellij.psi.search.UseScopeEnlarger instances.getUseScope
in interface PsiSearchHelper
element
- the element to return the use scope form.public PsiElement [] findCommentsContainingIdentifier(java.lang.String identifier, SearchScope searchScope)
PsiSearchHelper
findCommentsContainingIdentifier
in interface PsiSearchHelper
identifier
- the identifier to search.searchScope
- the scope in which occurrences are searched.public boolean processCommentsContainingIdentifier(java.lang.String identifier, SearchScope searchScope, Processor<? super PsiElement> processor)
PsiSearchHelper
processCommentsContainingIdentifier
in interface PsiSearchHelper
identifier
- the identifier to search.searchScope
- the scope in which occurrences are searched.public boolean processElementsWithWord(TextOccurenceProcessor processor, SearchScope searchScope, java.lang.String text, short searchContext, boolean caseSensitive)
processElementsWithWord
in interface PsiSearchHelper
public boolean processElementsWithWord(TextOccurenceProcessor processor, SearchScope searchScope, java.lang.String text, short searchContext, boolean caseSensitive, boolean processInjectedPsi)
processElementsWithWord
in interface PsiSearchHelper
public AsyncFuture<java.lang.Boolean> processElementsWithWordAsync(TextOccurenceProcessor processor, SearchScope searchScope, java.lang.String text, short searchContext, boolean caseSensitively)
processElementsWithWordAsync
in interface PsiSearchHelper
public boolean processElementsWithWord(TextOccurenceProcessor processor, SearchScope searchScope, java.lang.String text, short searchContext, java.util.EnumSet<PsiSearchHelperImpl.Options> options, java.lang.String containerName)
public static boolean shouldProcessInjectedPsi(SearchScope scope)
public static boolean processFilesConcurrentlyDespiteWriteActions(Project project, java.util.List<? extends VirtualFile> files, ProgressIndicator progress, java.util.concurrent.atomic.AtomicBoolean stopped, Processor<? super VirtualFile> localProcessor)
public boolean processCandidateFilesForText(GlobalSearchScope scope, short searchContext, boolean caseSensitively, java.lang.String text, Processor<? super VirtualFile> processor)
PsiSearchHelper
processCandidateFilesForText
in interface PsiSearchHelper
public PsiFile [] findFilesWithPlainTextWords(java.lang.String word)
PsiSearchHelper
findFilesWithPlainTextWords
in interface PsiSearchHelper
word
- the word to search.public boolean processUsagesInNonJavaFiles(java.lang.String qName, PsiNonJavaFileReferenceProcessor processor, GlobalSearchScope searchScope)
PsiSearchHelper
processUsagesInNonJavaFiles
in interface PsiSearchHelper
qName
- the class name to search.processor
- the processor which accepts the references.searchScope
- the scope in which occurrences are searched.public boolean processUsagesInNonJavaFiles(PsiElement originalElement, java.lang.String qName, PsiNonJavaFileReferenceProcessor processor, GlobalSearchScope initialScope)
PsiSearchHelper
processUsagesInNonJavaFiles
in interface PsiSearchHelper
originalElement
- the element whose use scope is used to restrict the search scope,
or null if the search scope is not restricted.qName
- the class name to search.processor
- the processor which accepts the references.initialScope
- the scope in which occurrences are searched.public boolean processAllFilesWithWord(java.lang.String word, GlobalSearchScope scope, Processor<? super PsiFile> processor, boolean caseSensitively)
PsiSearchHelper
code
context to the specified processor.processAllFilesWithWord
in interface PsiSearchHelper
word
- the word to search.scope
- the scope in which occurrences are searched.processor
- the processor which accepts the references.caseSensitively
- if words differing in the case only should not be considered equalpublic boolean processAllFilesWithWordInText(java.lang.String word, GlobalSearchScope scope, Processor<? super PsiFile> processor, boolean caseSensitively)
PsiSearchHelper
plain text
context to the specified processor.processAllFilesWithWordInText
in interface PsiSearchHelper
word
- the word to search.scope
- the scope in which occurrences are searched.processor
- the processor which accepts the references.caseSensitively
- if words differing in the case only should not be considered equalpublic boolean processAllFilesWithWordInComments(java.lang.String word, GlobalSearchScope scope, Processor<? super PsiFile> processor)
PsiSearchHelper
comments
context to the specified processor.processAllFilesWithWordInComments
in interface PsiSearchHelper
word
- the word to search.scope
- the scope in which occurrences are searched.processor
- the processor which accepts the references.public boolean processAllFilesWithWordInLiterals(java.lang.String word, GlobalSearchScope scope, Processor<? super PsiFile> processor)
PsiSearchHelper
string literal
context to the specified processor.processAllFilesWithWordInLiterals
in interface PsiSearchHelper
word
- the word to search.scope
- the scope in which occurrences are searched.processor
- the processor which accepts the references.public boolean processRequests(SearchRequestCollector collector, Processor<? super PsiReference> processor)
processRequests
in interface PsiSearchHelper
public AsyncFuture<java.lang.Boolean> processRequestsAsync(SearchRequestCollector collector, Processor<? super PsiReference> processor)
processRequestsAsync
in interface PsiSearchHelper
public PsiSearchHelper.SearchCostResult isCheapEnoughToSearch(java.lang.String name, GlobalSearchScope scope, PsiFile fileToIgnoreOccurrencesIn, ProgressIndicator progress)
isCheapEnoughToSearch
in interface PsiSearchHelper