public interface PsiSearchHelper
getInstance(Project)
to get a search helper instance.Modifier and Type | Interface and Description |
---|---|
static class |
PsiSearchHelper.SearchCostResult |
static class |
PsiSearchHelper.SERVICE |
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).
|
static PsiSearchHelper |
getInstance(Project project) |
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) |
AsyncFuture<java.lang.Boolean> |
processElementsWithWordAsync(TextOccurenceProcessor processor,
SearchScope searchScope,
java.lang.String text,
short searchContext,
boolean caseSensitive) |
boolean |
processRequests(SearchRequestCollector request,
Processor<? super PsiReference> processor) |
AsyncFuture<java.lang.Boolean> |
processRequestsAsync(SearchRequestCollector request,
Processor<? super PsiReference> processor) |
boolean |
processUsagesInNonJavaFiles(PsiElement originalElement,
java.lang.String qName,
PsiNonJavaFileReferenceProcessor processor,
GlobalSearchScope searchScope)
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 PsiSearchHelper getInstance(Project project)
PsiElement [] findCommentsContainingIdentifier(java.lang.String identifier, SearchScope searchScope)
identifier
- the identifier to search.searchScope
- the scope in which occurrences are searched.boolean processCommentsContainingIdentifier(java.lang.String identifier, SearchScope searchScope, Processor<? super PsiElement> processor)
identifier
- the identifier to search.searchScope
- the scope in which occurrences are searched.boolean processCandidateFilesForText(GlobalSearchScope scope, short searchContext, boolean caseSensitively, java.lang.String text, Processor<? super VirtualFile> processor)
PsiFile [] findFilesWithPlainTextWords(java.lang.String word)
word
- the word to search.boolean processUsagesInNonJavaFiles(java.lang.String qName, PsiNonJavaFileReferenceProcessor processor, GlobalSearchScope searchScope)
qName
- the class name to search.processor
- the processor which accepts the references.searchScope
- the scope in which occurrences are searched.boolean processUsagesInNonJavaFiles(PsiElement originalElement, java.lang.String qName, PsiNonJavaFileReferenceProcessor processor, GlobalSearchScope searchScope)
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.searchScope
- the scope in which occurrences are searched.SearchScope getUseScope(PsiElement element)
PsiElement.getUseScope()
and also the results returned from the registered
com.intellij.psi.search.UseScopeEnlarger instances.element
- the element to return the use scope form.boolean processAllFilesWithWord(java.lang.String word, GlobalSearchScope scope, Processor<? super PsiFile> processor, boolean caseSensitively)
code
context to the specified processor.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 equalboolean processAllFilesWithWordInText(java.lang.String word, GlobalSearchScope scope, Processor<? super PsiFile> processor, boolean caseSensitively)
plain text
context to the specified processor.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 equalboolean processAllFilesWithWordInComments(java.lang.String word, GlobalSearchScope scope, Processor<? super PsiFile> processor)
comments
context to the specified processor.word
- the word to search.scope
- the scope in which occurrences are searched.processor
- the processor which accepts the references.boolean processAllFilesWithWordInLiterals(java.lang.String word, GlobalSearchScope scope, Processor<? super PsiFile> processor)
string literal
context to the specified processor.word
- the word to search.scope
- the scope in which occurrences are searched.processor
- the processor which accepts the references.boolean processRequests(SearchRequestCollector request, Processor<? super PsiReference> processor)
AsyncFuture<java.lang.Boolean> processRequestsAsync(SearchRequestCollector request, Processor<? super PsiReference> 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)
AsyncFuture<java.lang.Boolean> processElementsWithWordAsync(TextOccurenceProcessor processor, SearchScope searchScope, java.lang.String text, short searchContext, boolean caseSensitive)
PsiSearchHelper.SearchCostResult isCheapEnoughToSearch(java.lang.String name, GlobalSearchScope scope, PsiFile fileToIgnoreOccurrencesIn, ProgressIndicator progress)