Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
252,400
ProgressIndicator () { ProgressIndicator progress = ProgressIndicatorProvider.getGlobalProgressIndicator(); if (progress == null) progress = new EmptyProgressIndicator(); progress.setIndeterminate(false); return progress; }
getOrCreateIndicator
252,401
Processor<PsiElement> (@NotNull StringSearcher searcher, @NotNull BulkOccurrenceProcessor processor) { return new ReadActionProcessor<>() { @Override public boolean processInReadAction(PsiElement scopeElement) { if (scopeElement instanceof PsiCompiledElement) { // can't scan text of the element return true; } return sc...
localProcessor
252,402
boolean (PsiElement scopeElement) { if (scopeElement instanceof PsiCompiledElement) { // can't scan text of the element return true; } return scopeElement.isValid() && processor.execute(scopeElement, LowLevelSearchUtil.getTextOccurrencesInScope(scopeElement, searcher), searcher); }
processInReadAction
252,403
String () { return processor.toString(); }
toString
252,404
boolean (@NotNull Map<TextIndexQuery, Collection<RequestWithProcessor>> singles, @NotNull ProgressIndicator progress, @NotNull Map<RequestWithProcessor, Processor<? super PsiElement>> localProcessors) { if (singles.isEmpty()) { return true; } if (singles.size() == 1) { Collection<RequestWithProcessor> requests = single...
processGlobalRequestsOptimized
252,405
QueryRequestsRunResult (@NotNull ProgressIndicator progress, @NotNull Map<SearchRequestCollector, Processor<? super PsiReference>> collectors) { boolean changed = false; Deque<SearchRequestCollector> queue = new LinkedList<>(collectors.keySet()); while (!queue.isEmpty()) { progress.checkCanceled(); SearchRequestCollect...
appendCollectorsFromQueryRequests
252,406
CharSequence (@NotNull Set<String> allWords) { StringBuilder result = new StringBuilder(50); for (String string : allWords) { ProgressManager.checkCanceled(); if (!string.isEmpty()) { if (result.length() > 50) { result.append("..."); break; } if (result.length() != 0) result.append(", "); result.append(string); } } ret...
concat
252,407
BulkOccurrenceProcessor (@NotNull PsiSearchRequest singleRequest, @NotNull Processor<? super PsiReference> consumer) { SearchScope searchScope = singleRequest.searchScope; boolean ignoreInjectedPsi = searchScope instanceof LocalSearchScope && ((LocalSearchScope)searchScope).isIgnoreInjectedPsi(); RequestResultProcessor...
adaptProcessor
252,408
boolean (@NotNull PsiElement scope, int @NotNull [] offsetsInScope, @NotNull StringSearcher searcher) { ProgressManager.checkCanceled(); if (wrapped instanceof RequestResultProcessor.BulkResultProcessor) { return ((RequestResultProcessor.BulkResultProcessor)wrapped).processTextOccurrences(scope, offsetsInScope, consume...
execute
252,409
String () { return consumer.toString(); }
toString
252,410
Condition<Integer> (short searchContext) { return context -> (context & searchContext) != 0; }
matchContextCondition
252,411
GlobalSearchScope (@NotNull Collection<? extends WordRequestInfo> requests) { Set<GlobalSearchScope> scopes = ContainerUtil.map2LinkedSet(requests, r -> (GlobalSearchScope)r.getSearchScope()); return GlobalSearchScope.union(scopes.toArray(GlobalSearchScope.EMPTY_ARRAY)); }
uniteScopes
252,412
void (@NotNull Map<SearchRequestCollector, Processor<? super PsiReference>> collectors, @NotNull Set<RequestWithProcessor> locals, @NotNull Map<TextIndexQuery, Collection<RequestWithProcessor>> globals, @NotNull List<? super Computable<Boolean>> customs, @NotNull Map<RequestWithProcessor, Processor<? super PsiElement>>...
distributePrimitives
252,413
void (@NotNull Collection<RequestWithProcessor> collection, @NotNull PsiSearchRequest primitive, @NotNull Processor<? super PsiReference> processor) { RequestWithProcessor singleRequest = new RequestWithProcessor(primitive, processor); for (RequestWithProcessor existing : collection) { ProgressManager.checkCanceled(); ...
registerRequest
252,414
boolean (@NotNull PsiSearchRequest single, @NotNull Processor<? super PsiReference> consumer) { EnumSet<Options> options = makeOptions(single.caseSensitive, shouldProcessInjectedPsi(single.searchScope)); return bulkProcessElementsWithWord(single.searchScope, single.word, single.searchContext, options, single.containerN...
processSingleRequest
252,415
boolean (@NotNull RequestWithProcessor another) { if (request.equals(another.request)) { Processor<? super PsiReference> myProcessor = refProcessor; if (myProcessor != another.refProcessor) { refProcessor = psiReference -> myProcessor.process(psiReference) && another.refProcessor.process(psiReference); } return true; }...
uniteWith
252,416
String () { return request.toString(); }
toString
252,417
String () { return request.word; }
getWord
252,418
SearchScope () { return request.searchScope; }
getSearchScope
252,419
short () { return request.searchContext; }
getSearchContext
252,420
boolean () { return request.caseSensitive; }
isCaseSensitive
252,421
SearchSession () { return request.getSearchSession(); }
getSearchSession
252,422
boolean (@NotNull Project project, @NotNull GlobalSearchScope scope, @NotNull Processor<? super VirtualFile> processor, TextIndexQuery @NotNull ... textIndexQueries) { if (ContainerUtil.find(textIndexQueries, query -> !query.isEmpty()) == null) return true; if (LOG.isTraceEnabled()) { List<String> words = ContainerUtil...
processFilesContainingAllKeys
252,423
boolean (@NotNull GlobalSearchScope scope, @NotNull Processor<? super VirtualFile> processor, @NotNull TextIndexQuery @NotNull [] textIndexQueries) { Collection<FileBasedIndex.AllKeysQuery<?, ?>> queries = ContainerUtil.concat(textIndexQueries, q -> q.toFileBasedIndexQueries()); return FileBasedIndex.getInstance().proc...
computeQueries
252,424
Collection<String> () { return myInitialWords; }
getInitialWords
252,425
boolean () { return myIdIndexEntries.isEmpty(); }
isEmpty
252,426
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TextIndexQuery query = (TextIndexQuery)o; return myIdIndexEntries.equals(query.myIdIndexEntries) && myTrigrams.equals(query.myTrigrams) && Objects.equals(myContext, query.myContext); }
equals
252,427
int () { return Objects.hash(myIdIndexEntries, myTrigrams, myContext); }
hashCode
252,428
TextIndexQuery (@NotNull String word, boolean caseSensitively, boolean useOnlyWeakHashToSearch, @Nullable Short context) { return fromWords(Collections.singleton(word), caseSensitively, useOnlyWeakHashToSearch, context); }
fromWord
252,429
TextIndexQuery (@NotNull String word, boolean caseSensitively, @Nullable Short context) { return fromWord(word, caseSensitively, false, context); }
fromWord
252,430
TextIndexQuery (@NotNull Collection<String> words, boolean caseSensitively, boolean useOnlyWeakHashToSearch, @Nullable Short context) { Set<IdIndexEntry> keys = CollectionFactory.createSmallMemoryFootprintSet(ContainerUtil.flatMap(words, w -> getWordEntries(w, caseSensitively))); IntSet trigrams; if (!useOnlyWeakHashTo...
fromWords
252,431
List<IdIndexEntry> (@NotNull String name, boolean caseSensitively) { List<String> words = StringUtil.getWordsInStringLongestFirst(name); if (words.isEmpty()) { String trimmed = name.trim(); if (StringUtil.isNotEmpty(trimmed)) { words = Collections.singletonList(trimmed); } } if (words.isEmpty()) return Collections.empt...
getWordEntries
252,432
void (@NotNull ReferencesSearch.SearchParameters p, @NotNull Processor<? super PsiReference> consumer) { final PsiElement refElement = p.getElementToSearch(); boolean caseSensitive = refElement.getLanguage().isCaseSensitive(); String text = null; if (refElement instanceof PsiFileSystemItem && !(refElement instanceof Sy...
processQuery
252,433
Boolean (PsiElement element, @NotNull StringSearcher searcher, int start, @NotNull ProgressIndicator progress, InjectedLanguageManager injectedLanguageManager, @NotNull TextOccurenceProcessor processor) { if (!(element instanceof PsiLanguageInjectionHost)) return null; if (injectedLanguageManager == null) return null; ...
processInjectedFile
252,434
boolean (@NotNull Project project, @NotNull PsiElement scope, @NotNull ASTNode leafNode, int offsetInLeaf, @NotNull StringSearcher searcher, boolean processInjectedPsi, @NotNull ProgressIndicator progress, @NotNull TextOccurenceProcessor processor) { final int patternLength = searcher.getPatternLength(); InjectedLangua...
processTreeUp
252,435
ASTNode (@NotNull ASTNode scopeNode, @Nullable ASTNode last, int offset) { int offsetR = offset; if (last != null) { offsetR -= last.getStartOffset() - scopeNode.getStartOffset() + last.getTextLength(); while (offsetR >= 0) { ASTNode next = last.getTreeNext(); if (next == null) { last = last.getTreeParent(); continue; ...
findNextLeafElementAt
252,436
boolean (final @NotNull TextOccurenceProcessor processor, final @NotNull PsiElement scope, final @NotNull StringSearcher searcher, boolean processInjectedPsi, @NotNull ProgressIndicator progress) { int[] occurrences = getTextOccurrencesInScope(scope, searcher); return processElementsAtOffsets(scope, searcher, processIn...
processElementsContainingWordInElement
252,437
boolean (@NotNull PsiElement scope, @NotNull StringSearcher searcher, boolean processInjectedPsi, @NotNull ProgressIndicator progress, int @NotNull [] offsetsInScope, @NotNull TextOccurenceProcessor processor) { if (offsetsInScope.length == 0) { return true; } final ASTNode scopeNode = scope.getNode(); if (scopeNode ==...
processElementsAtOffsets
252,438
boolean (@NotNull ASTNode node, int @NotNull [] offsetsInNode, @NotNull ProgressIndicator progress, @NotNull NodeTextOccurrenceProcessor processor) { final int scopeStartOffset = node.getStartOffset(); // helps to avoid full tree rescan in subsequent com.intellij.lang.ASTNode#findLeafElementAt calls (O(n) instead of O(...
processOffsets
252,439
void (@NotNull PsiElement scope, @NotNull PsiFile file, @NotNull FileViewProvider viewProvider, @NotNull CharSequence buffer, TextRange range) { String msg = "Range for element: '" + scope + "' = " + range + " is out of file '" + file + "' range: " + file.getTextRange(); msg += "; file contents length: " + buffer.lengt...
diagnoseInvalidRange
252,440
boolean (@NotNull CharSequence text, int startOffset, int endOffset, @NotNull StringSearcher searcher, @NotNull IntPredicate processor) { for (int offset : getTextOccurrences(text, startOffset, endOffset, searcher)) { if (!processor.test(offset)) { return false; } } return true; }
processTexts
252,441
boolean (@NotNull CharSequence text, @NotNull StringSearcher searcher, int index) { if (!searcher.isJavaIdentifier()) { return true; } if (index > 0) { char c = text.charAt(index - 1); if (Character.isJavaIdentifierPart(c) && c != '$') { if (!searcher.isHandleEscapeSequences() || index < 2 || StringUtil.isEscapedBacksl...
checkJavaIdentifier
252,442
PsiFile () { return myFile; }
getFile
252,443
TextRange () { return new TextRange(myStartOffset, myEndOffset); }
getTextRange
252,444
List<TextRange> () { return myAdditionalRanges; }
getAdditionalTextRanges
252,445
TodoPattern () { return myPattern; }
getPattern
252,446
int () { return myFile.hashCode()+myStartOffset+myEndOffset+myPattern.hashCode(); }
hashCode
252,447
boolean (Object obj) { if(!(obj instanceof TodoItemImpl todoItem)){ return false; } return myFile.equals(todoItem.myFile) && myStartOffset == todoItem.myStartOffset && myEndOffset == todoItem.myEndOffset && myPattern.equals(todoItem.myPattern); }
equals
252,448
void (final CharSequence charSequence, char[] charArray, final int start, final int end, final int occurrenceMask) { if (myIndexDataConsumer == null) { return; } if (charArray != null) { myIndexDataConsumer.addOccurrence(charArray, start, end, occurrenceMask); } else { myIndexDataConsumer.addOccurrence(charSequence, st...
addOccurrence
252,449
void (final IndexPattern pattern) { if (myTodoOccurrences == null) { myTodoOccurrences = new Object2IntOpenHashMap<>(); } myTodoOccurrences.mergeInt(pattern, 1, Math::addExact); }
incTodoOccurrence
252,450
int (IndexPattern pattern) { return myTodoOccurrences == null ? 0 : myTodoOccurrences.getInt(pattern); }
getOccurrenceCount
252,451
boolean () { return myNeedToDo; }
isNeedToDo
252,452
void () { if (!myOccurrenceConsumer.isNeedToDo()) return; int start = getTokenStart(); int end = getTokenEnd(); start = Math.max(start, myTodoScannedBound); if (start >= end) return; // this prevents scanning of the same comment twice CharSequence input = myCachedBufferSequence.subSequence(start, end); if (myTodoScanni...
advanceTodoItemCountsInToken
252,453
TodoScanningState (IndexPattern[] patterns) { Matcher[] matchers = new Matcher[patterns.length]; TodoScanningState todoScanningState = new TodoScanningState(patterns, matchers); for (int i = 0; i < patterns.length; ++i) { Pattern pattern = patterns[i].getOptimizedIndexingPattern(); if (pattern != null) { matchers[i] = ...
createTodoScanningState
252,454
void (CharSequence input, OccurrenceConsumer consumer, TodoScanningState todoScanningState) { todoScanningState.myOccurrences.clear(); for (int i = todoScanningState.myMatchers.length - 1; i >= 0; --i) { Matcher matcher = todoScanningState.myMatchers[i]; if (matcher == null) continue; matcher.reset(input); try { while ...
advanceTodoItemsCount
252,455
void (CharSequence chars, char @Nullable [] charsArray, int start, int end) { myOccurrenceConsumer.addOccurrence(chars, charsArray, start, end, myOccurenceMask); }
run
252,456
void (final int occurrenceMask) { myOccurrenceConsumer.addOccurrence(myCachedBufferSequence, myCachedArraySequence, getTokenStart(), getTokenEnd(), occurrenceMask); }
addOccurrenceInToken
252,457
void (final int occurrenceMask, final int offset, final int length) { myOccurrenceConsumer.addOccurrence(myCachedBufferSequence, myCachedArraySequence, getTokenStart() + offset, Math.min(getTokenStart() + offset + length, getTokenEnd()), occurrenceMask); }
addOccurrenceInToken
252,458
void (final int occurrenceMask, boolean mayHaveFileRefs, final boolean mayHaveEscapes) { myOccurenceMask = occurrenceMask; final int start = getTokenStart(); final int end = getTokenEnd(); IdTableBuilding.scanWords(this, myCachedBufferSequence, myCachedArraySequence, start, end, mayHaveEscapes); if (mayHaveFileRefs) { ...
scanWordsInToken
252,459
void (CharSequence chars, char[] cachedArraySequence, int startOffset, int endOffset) { int offset = findCharsWithinRange(chars, startOffset, endOffset, "/\\"); offset = Math.min(offset, endOffset); int start = startOffset; while(start < endOffset) { if (start != offset) { myOccurrenceConsumer.addOccurrence(chars, cach...
processPossibleComplexFileName
252,460
int (final CharSequence chars, int startOffset, int endOffset, String charsToFind) { while(startOffset < endOffset) { if (charsToFind.indexOf(chars.charAt(startOffset)) != -1) { return startOffset; } ++startOffset; } return startOffset; }
findCharsWithinRange
252,461
void (@NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) { super.start(buffer, startOffset, endOffset, initialState); myCachedBufferSequence = getBufferSequence(); myCachedArraySequence = CharArrayUtil.fromSequenceWithoutCopying(myCachedBufferSequence); }
start
252,462
boolean (@NotNull Collection<String> words, short occurenceMask, @NotNull GlobalSearchScope scope, boolean caseSensitively, @NotNull Processor<? super VirtualFile> processor) { if (myProject.isDefault()) { return true; } PsiSearchHelperImpl.TextIndexQuery query = PsiSearchHelperImpl.TextIndexQuery.fromWords(words, case...
processVirtualFilesWithAllWords
252,463
void (@NotNull String word, short occurrenceMask, @NotNull GlobalSearchScope scope, boolean caseSensitively, @NotNull Processor<? super VirtualFile> fileProcessor) { processVirtualFilesWithAllWords(Collections.singleton(word), occurrenceMask, scope, caseSensitively, fileProcessor); }
collectVirtualFilesWithWord
252,464
boolean (@NotNull Processor<? super PsiFile> psiFileProcessor, @NotNull String word, short occurrenceMask, @NotNull GlobalSearchScope scope, boolean caseSensitively) { List<VirtualFile> result = new ArrayList<>(5); Processor<VirtualFile> processor = Processors.cancelableCollectProcessor(result); collectVirtualFilesWith...
processFilesWithWord
252,465
boolean (VirtualFile virtualFile) { if (virtualFile.isValid()) { PsiFile psiFile = psiManager.findFile(virtualFile); return psiFile == null || psiFileProcessor.process(psiFile); } return true; }
processInReadAction
252,466
void (@NotNull FileContent content, @NotNull Lexer filterLexer) { filterLexer.start(content.getContentAsText()); int tokenIdx = 0; while (filterLexer.getTokenType() != null) { if (tokenIdx++ % 100 == 0) { ProgressManager.checkCanceled(); } filterLexer.advance(); } }
scanContentWithCheckCanceled
252,467
int () { return myWordHashCode; }
getWordHashCode
252,468
boolean (final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final IdIndexEntry that = (IdIndexEntry)o; if (myWordHashCode != that.myWordHashCode) return false; return true; }
equals
252,469
int () { return myWordHashCode; }
hashCode
252,470
String () { return "IdIndexEntry[hash: " + myWordHashCode +"]"; }
toString
252,471
int (@NotNull CharSequence line, int start, int end, boolean caseSensitive) { if (useStrongerHash()) { // use stronger hash return caseSensitive ? StringUtil.stringHashCode(line, start, end) : StringUtil.stringHashCodeInsensitive(line, start, end); } else { // use more compact hash if (start == end) return 0; char firs...
getWordHash
252,472
int () { return useStrongerHash() ? 1 : 0; }
getUsedHashAlgorithmVersion
252,473
boolean () { return ourUseStrongerHash; }
useStrongerHash
252,474
WordsScanner () { return createCustomFileTypeScanner(((CustomSyntaxTableFileType)fileType).getSyntaxTable()); }
createScanner
252,475
IdIndexer (@NotNull FileType fileType) { if (fileType == PlainTextFileType.INSTANCE && FileBasedIndex.IGNORE_PLAIN_TEXT_FILES) return null; return IdIndexers.INSTANCE.forFileType(fileType); }
getIndexer
252,476
IdIndexer (@NotNull WordsScanner scanner) { return new ScanningIdIndexer() { @Override protected WordsScanner createScanner() { return scanner; } }; }
createDefaultIndexer
252,477
WordsScanner () { return scanner; }
createScanner
252,478
WordsScanner (final @NotNull SyntaxTable syntaxTable) { return new DefaultWordsScanner(new CustomFileTypeLexer(syntaxTable, true), TokenSet.create(CustomHighlighterTokenType.IDENTIFIER), TokenSet.create(CustomHighlighterTokenType.LINE_COMMENT, CustomHighlighterTokenType.MULTI_LINE_COMMENT), TokenSet.create(CustomHighli...
createCustomFileTypeScanner
252,479
void (final ScanWordProcessor processor, final CharSequence chars, final int startOffset, final int endOffset) { scanWords(processor, chars, CharArrayUtil.fromSequenceWithoutCopying(chars), startOffset, endOffset, false); }
scanWords
252,480
void (final ScanWordProcessor processor, final CharSequence chars, final char @Nullable [] charArray, final int startOffset, final int endOffset, final boolean mayHaveEscapes) { int index = startOffset; final boolean hasArray = charArray != null; ScanWordsLoop: while (true) { while (true) { if (index >= endOffset) brea...
scanWords
252,481
IdIndexEntry (int n) { return new IdIndexEntry(n); }
fromInt
252,482
int (IdIndexEntry idIndexEntry) { return idIndexEntry.getWordHashCode(); }
toInt
252,483
int () { return 21 + IdIndexEntry.getUsedHashAlgorithmVersion(); }
getVersion
252,484
boolean () { return true; }
dependsOnFileContent
252,485
String (@NotNull FileTypeSpecificSubIndexer<IdIndexer> indexer) { return indexer.getSubIndexerType().getClass().getName() + ":" + indexer.getSubIndexerType().getVersion() + ":" + indexer.getFileType().getName(); }
getSubIndexerVersion
252,486
KeyDescriptor<String> () { return EnumeratorStringDescriptor.INSTANCE; }
getSubIndexerVersionDescriptor
252,487
DataExternalizer<Integer> () { return new DataExternalizer<>() { @Override public void save(final @NotNull DataOutput out, final Integer value) throws IOException { out.write(value.intValue() & UsageSearchContext.ANY); } @Override public Integer read(final @NotNull DataInput in) throws IOException { return Integer.valu...
getValueExternalizer
252,488
KeyDescriptor<IdIndexEntry> () { return myKeyDescriptor; }
getKeyDescriptor
252,489
boolean (FileType fileType) { return (fileType instanceof LanguageFileType && (fileType != PlainTextFileType.INSTANCE || !FileBasedIndex.IGNORE_PLAIN_TEXT_FILES)) || IdTableBuilding.getFileTypeIndexer(fileType) != null; }
isIndexable
252,490
boolean () { return true; }
hasSnapshotMapping
252,491
boolean () { return false; }
needsForwardIndexWhenSharing
252,492
Processor<WordOccurrence> (@NotNull CharSequence chars, @NotNull IdDataConsumer consumer) { final char[] charsArray = CharArrayUtil.fromSequenceWithoutCopying(chars); return new Processor<>() { @Override public boolean process(final WordOccurrence t) { if (charsArray != null && t.getBaseText() == chars) { consumer.addO...
createProcessor
252,493
boolean (final WordOccurrence t) { if (charsArray != null && t.getBaseText() == chars) { consumer.addOccurrence(charsArray, t.getStart(), t.getEnd(), convertToMask(t.getKind())); } else { consumer.addOccurrence(t.getBaseText(), t.getStart(), t.getEnd(), convertToMask(t.getKind())); } return true; }
process
252,494
int (final WordOccurrence.Kind kind) { if (kind == null) { return UsageSearchContext.ANY; } if (kind == WordOccurrence.Kind.CODE) return UsageSearchContext.IN_CODE; if (kind == WordOccurrence.Kind.COMMENTS) return UsageSearchContext.IN_COMMENTS; if (kind == WordOccurrence.Kind.LITERALS) return UsageSearchContext.IN_STR...
convertToMask
252,495
int () { WordsScanner scanner = createScanner(); return scanner instanceof VersionedWordsScanner ? ((VersionedWordsScanner)scanner).getVersion() : -1; }
getVersion
252,496
void (char[] chars, int start, int end, int occurrenceMask) { addOccurrence(new CharArrayCharSequence(chars), start, end, occurrenceMask); }
addOccurrence
252,497
void (CharSequence charSequence, int start, int end, int occurrenceMask) { if (end == start || occurrenceMask == 0) return; int hash = IdIndexEntry.getWordHash(charSequence, start, end, true); myResult.mergeInt(new IdIndexEntry(hash), occurrenceMask, (prev, cur) -> prev | cur); int hashNoCase = IdIndexEntry.getWordHash...
addOccurrence
252,498
void (final CharSequence chars11, char @Nullable [] charsArray, final int start, final int end) { if (charsArray != null) { consumer.addOccurrence(charsArray, start, end, UsageSearchContext.IN_PLAIN_TEXT); } else { consumer.addOccurrence(chars11, start, end, UsageSearchContext.IN_PLAIN_TEXT); } }
run
252,499
boolean (@NotNull IndexedFile file) { if (FileBasedIndex.IGNORE_PLAIN_TEXT_FILES && file.getFileType() == PlainTextFileType.INSTANCE) { return false; } VirtualFile vFile = file.getFile(); if (!vFile.isInLocalFileSystem()) { return false; } Project project = file.getProject(); if (project != null) { if (project.isDefaul...
needsTodoIndex