Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
251,700
String (@NotNull String url) { return url; }
trimUrl
251,701
Collection<PsiFileSystemItem> (@NotNull Module module) { return emptyList(); }
getRoots
251,702
boolean () { return false; }
isFallback
251,703
FileInfoManager () { return ApplicationManager.getApplication().getService(FileInfoManager.class); }
getFileInfoManager
251,704
Object (PsiElement psiElement) { if (!(psiElement instanceof PsiFile file) || !(psiElement.isPhysical())) { return psiElement; } return _getLookupItem(file, file.getName(), file.getIcon(0)); }
getFileLookupItem
251,705
LookupElementBuilder (PsiElement psiElement, String encoded, Icon icon) { if (!(psiElement instanceof PsiFile) || !(psiElement.isPhysical())) { return LookupElementBuilder.create(psiElement, encoded).withIcon(icon); } return _getLookupItem((PsiFile)psiElement, encoded, icon); }
getFileLookupItem
251,706
LookupElementBuilder (final @NotNull PsiFile file, String name, Icon icon) { LookupElementBuilder builder = LookupElementBuilder.create(file, name).withIcon(icon); final String info = _getInfo(file); if (info != null) { return builder.withTailText(String.format(" (%s)", info), true); } return builder; }
_getLookupItem
251,707
int (@Nullable PsiElement object) { if (object instanceof PsiNamedElement) { String name = ((PsiNamedElement)object).getName(); if (name != null) { return name.hashCode(); } } return Objects.hashCode(object); }
hashCode
251,708
boolean (@Nullable PsiElement o1, @Nullable PsiElement o2) { if (o1 instanceof PsiNamedElement && o2 instanceof PsiNamedElement) { return Objects.equals(((PsiNamedElement)o1).getName(), ((PsiNamedElement)o2).getName()); } return Objects.equals(o1, o2); }
equals
251,709
boolean (@NotNull PsiFileSystemItem fileSystemItem) { return new FilteringProcessor<>(filter, collector).process(FileReference.getOriginalFile(fileSystemItem)); }
execute
251,710
boolean (final @NotNull PsiFileSystemItem element1, final @NotNull PsiFileSystemItem element2) { return element2.getManager().areElementsEquivalent(element1, element2); }
areElementsEquivalent
251,711
PsiFileSystemItem (final @NotNull Project project, final @NotNull VirtualFile file) { final ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex(); VirtualFile contentRootForFile = index.getContentRootForFile(file); return contentRootForFile != null ? PsiManager.getInstance(project).findDirecto...
findRoot
251,712
Collection<PsiFileSystemItem> (final @NotNull Module module) { return ContainerUtil.mapNotNull(ModuleRootManager.getInstance(module).getContentRoots(), virtualFile -> PsiManager.getInstance(module.getProject()).findDirectory(virtualFile)); }
getRoots
251,713
Collection<PsiFileSystemItem> (final @NotNull Project project, final @NotNull VirtualFile file) { final PsiFileSystemItem item = getPsiFileSystemItem(project, file); if (item != null) { final PsiFileSystemItem parent = item.getParent(); if (parent != null) { return Collections.singleton(parent); } } return Collections....
getContexts
251,714
boolean (final @NotNull Project project, final @NotNull VirtualFile file) { return ProjectRootManager.getInstance(project).getFileIndex().isInContent(file); }
isMine
251,715
boolean () { return true; }
isFallback
251,716
boolean () { return true; }
isSoft
251,717
void (LeafElement leaf) { String leafText = leaf instanceof ForeignLeafPsiElement ? "" : leaf.getText(); catLeafs.append(leafText); TextRange leafRange = leaf.getTextRange(); StringBuilder leafEncodedText = constructTextFromHostPSI(leafRange.getStartOffset(), leafRange.getEndOffset()); if (!Comparing.equal(leafText, le...
visitLeaf
251,718
StringBuilder (int startOffset, int endOffset) { boolean firstTimer = false; PlaceInfo currentPlace = myPlaceInfos.get(shredNo); if (hostText == null) { hostText = currentPlace.myHostText; rangeInHost = currentPlace.getRelevantRangeInsideHost(); currentTextEscaper = currentPlace.myEscaper; firstTimer = true; } StringBu...
constructTextFromHostPSI
251,719
void (@NotNull LeafElement leaf, @NotNull String leafText) { PsiElement psi = leaf.getPsi(); if (psi != null) { psi.putCopyableUserData(UNESCAPED_TEXT, leafText); } }
storeUnescapedTextFor
251,720
String () { return "Shred " + (prefix.isEmpty() ? "" : "prefix='"+prefix+"' ") + (suffix.isEmpty() ? "" : "suffix='"+suffix+"' ") + "in " + host + " with range " + host.getTextRange()+" ("+host.getClass()+") "+ "inside range " + registeredRangeInsideHost; }
toString
251,721
void () { Segment hostRange = relevantRangeInHost.getPsiRange(); assert hostRange != null : "invalid host range: " + relevantRangeInHost; PsiLanguageInjectionHost host = hostElementPointer.getElement(); assert host != null && host.isValid() : "no host: " + hostElementPointer; }
assertValid
251,722
TextRange () { return calcRangeInsideHostElement(true); }
getRangeInsideHost
251,723
TextRange (boolean usePsiRange) { PsiLanguageInjectionHost host = getHost(); Segment psiRange = usePsiRange ? relevantRangeInHost.getPsiRange() : relevantRangeInHost.getRange(); TextRange textRange = psiRange == null ? null : TextRange.create(psiRange); if (host == null) { if (textRange != null) return textRange; Segme...
calcRangeInsideHostElement
251,724
String () { PsiLanguageInjectionHost host = getHost(); Segment hostRange = getHostRangeMarker(); return "Shred " + (host == null ? null : host.getTextRange()) + ": " + host + " In host range: " + (hostRange != null ? "(" + hostRange.getStartOffset() + "," + hostRange.getEndOffset() + ");" : "invalid;") + " PSI range: "...
toString
251,725
boolean () { return getHostRangeMarker() != null && getHost() != null; }
isValid
251,726
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PsiLanguageInjectionHost.Shred shred = (PsiLanguageInjectionHost.Shred)o; PsiLanguageInjectionHost host = getHost(); Segment hostRangeMarker = getHostRangeMarker(); Segment hostRangeMarker2 = shred.getHostRangeMa...
equals
251,727
int () { return rangeInDecodedPSI.hashCode(); }
hashCode
251,728
void () { }
dispose
251,729
TextRange () { return rangeInDecodedPSI; }
getRange
251,730
String () { return prefix; }
getPrefix
251,731
String () { return suffix; }
getSuffix
251,732
Object () { return myLock; }
getLock
251,733
boolean () { return myPatchingLeaves; }
getPatchingLeaves
251,734
FileViewProvider () { return cloneImpl(); }
clone
251,735
void (@NotNull PsiFile psiFile) { super.rootChanged(psiFile); rootChangedImpl(psiFile); }
rootChanged
251,736
boolean () { return isEventSystemEnabledImpl(); }
isEventSystemEnabled
251,737
boolean () { return isPhysicalImpl(); }
isPhysical
251,738
Language () { return myLanguage; }
getBaseLanguage
251,739
Set<Language> () { FileViewProvider original = myOriginalProvider; Set<Language> languages = original.getLanguages(); Language base = original.getBaseLanguage(); return ContainerUtil.map2Set(languages, (language) -> language == base ? myLanguage : language); }
getLanguages
251,740
MultiplePsiFilesPerDocumentFileViewProvider (@NotNull VirtualFile fileCopy) { FileViewProvider originalProvider = getManager().getFileManager().createFileViewProvider(fileCopy, false); assert originalProvider instanceof MultiplePsiFilesPerDocumentFileViewProvider : "Original provider " + originalProvider + " is not mul...
cloneInner
251,741
DocumentWindowImpl () { return myDocumentWindow; }
getDocument
251,742
void (@NotNull PsiFile psiFile) { myRoots.put(psiFile.getLanguage(), (PsiFileImpl)psiFile); getManager().getFileManager().setViewProvider(getVirtualFile(), this); }
forceCachedPsi
251,743
void (@NotNull Runnable runnable) { myPatchingLeaves = true; try { runnable.run(); } finally { myPatchingLeaves = false; } }
doNotInterruptMeWhileImPatchingLeaves
251,744
Language () { return ((TemplateLanguageFileViewProvider)myOriginalProvider).getTemplateDataLanguage(); }
getTemplateDataLanguage
251,745
boolean (Place oldShreds, Place newShreds) { if (oldShreds == newShreds) return true; if (oldShreds.size() != newShreds.size()) return false; for (int i = 0; i < oldShreds.size(); i++) { PsiLanguageInjectionHost.Shred oldShred = oldShreds.get(i); PsiLanguageInjectionHost.Shred newShred = newShreds.get(i); if (!oldShred...
same
251,746
InjectedFileViewProvider (@NotNull PsiManagerEx manager, @NotNull VirtualFileWindowImpl file, @NotNull DocumentWindowImpl window, @NotNull Language language) { AbstractFileViewProvider original = (AbstractFileViewProvider)manager.getFileManager().createFileViewProvider(file, false); return original instanceof TemplateL...
create
251,747
VirtualFile () { return myDelegate; }
getDelegate
251,748
DocumentWindowImpl () { return myDocumentWindow; }
getDocumentWindow
251,749
boolean () { return myDelegate.isValid() && myDocumentWindow.isValid(); }
isValid
251,750
String () { return "VirtualFileWindow in " + myDelegate.getPresentableUrl(); }
toString
251,751
boolean () { return myDelegate.isWritable(); }
isWritable
251,752
void (boolean writable) { LOG.error("Operation is not supported"); }
setWritable
251,753
Document () { return myDocumentWindow; }
getDocument
251,754
int () { int hostOffset = myHostMarker.getStartOffset(); return myDocumentWindow.hostToInjected(hostOffset) + myStartShift; }
getStartOffset
251,755
int () { int hostOffset = myHostMarker.getEndOffset(); return myDocumentWindow.hostToInjected(hostOffset) + myEndShift; }
getEndOffset
251,756
boolean () { if (!myHostMarker.isValid() || !myDocumentWindow.isValid()) return false; int startOffset = getStartOffset(); int endOffset = getEndOffset(); return startOffset <= endOffset && endOffset <= myDocumentWindow.getTextLength(); }
isValid
251,757
void (boolean greedy) { myHostMarker.setGreedyToLeft(greedy); }
setGreedyToLeft
251,758
void (boolean greedy) { myHostMarker.setGreedyToRight(greedy); }
setGreedyToRight
251,759
long () { return myHostMarker.getId(); }
getId
251,760
RangeMarkerEx () { return myHostMarker; }
getDelegate
251,761
boolean () { return myHostMarker.isGreedyToRight(); }
isGreedyToRight
251,762
boolean () { return myHostMarker.isGreedyToLeft(); }
isGreedyToLeft
251,763
void () { myHostMarker.dispose(); }
dispose
251,764
String () { return "RangeMarkerWindow" + (isGreedyToLeft() ? "[" : "(") + (isValid() ? "valid" : "invalid") + "," + getStartOffset() + "," + getEndOffset() + (isGreedyToRight() ? "]" : ")") + " " + (isValid() ? getId() : ""); }
toString
251,765
Editor (@NotNull Editor editor) { return editor instanceof EditorWindow ? ((EditorWindow)editor).getDelegate() : editor; }
getTopLevelEditor
251,766
record (@NotNull String text, long modificationStamp) { }
CachedText
251,767
int () { return 1 + StringUtil.countNewLines(getText()); }
getLineCount
251,768
int (int line) { LOG.assertTrue(line >= 0, line); if (line == 0) return 0; String hostText = myDelegate.getText(); int[] pos = new int[2]; // pos[0] = curLine; pos[1] == offset; synchronized (myLock) { for (PsiLanguageInjectionHost.Shred shred : myShreds) { Segment hostRange = shred.getHostRangeMarker(); if (hostRange ...
getLineStartOffset
251,769
int (CharSequence text, int[] pos, int line) { int offsetInside = 0; for (int i = StringUtil.indexOf(text, '\n'); i != -1; i = StringUtil.indexOf(text,'\n', offsetInside)) { int curLine = ++pos[0]; int lineLength = i + 1 - offsetInside; int offset = pos[1] += lineLength; offsetInside += lineLength; if (curLine == line)...
countNewLinesIn
251,770
int (int line) { LOG.assertTrue(line >= 0, line); if (line == getLineCount() - 1) return getTextLength(); // end >= start assertion fix for last line int startOffsetOfNextLine = getLineStartOffset(line + 1); return startOffsetOfNextLine == 0 || getText().charAt(startOffsetOfNextLine - 1) != '\n' ? startOffsetOfNextLine...
getLineEndOffset
251,771
String () { CachedText cachedText = myCachedText; if (cachedText == null || cachedText.modificationStamp() != getModificationStamp()) { myCachedText = cachedText = new CachedText(calcText(), getModificationStamp()); } return cachedText.text(); }
getText
251,772
String () { StringBuilder text = new StringBuilder(); CharSequence hostText = myDelegate.getCharsSequence(); synchronized (myLock) { for (PsiLanguageInjectionHost.Shred shred : myShreds) { Segment hostRange = shred.getHostRangeMarker(); if (hostRange != null) { text.append(shred.getPrefix()); text.append(hostText, host...
calcText
251,773
CharSequence () { return ImmutableCharSequence.asImmutable(getText()); }
getImmutableCharSequence
251,774
int () { int length = 0; synchronized (myLock) { for (PsiLanguageInjectionHost.Shred shred : myShreds) { Segment hostRange = shred.getHostRangeMarker(); if (hostRange == null) continue; length += shred.getPrefix().length(); length += hostRange.getEndOffset() - hostRange.getStartOffset(); length += shred.getSuffix().len...
getTextLength
251,775
int (int offset) { int lineNumber = 0; String hostText = myDelegate.getText(); synchronized (myLock) { for (PsiLanguageInjectionHost.Shred shred : myShreds) { String prefix = shred.getPrefix(); String suffix = shred.getSuffix(); lineNumber += StringUtil.getLineBreakCount(prefix.substring(0, Math.min(offset, prefix.leng...
getLineNumber
251,776
TextRange (int hostOffset) { synchronized (myLock) { for (PsiLanguageInjectionHost.Shred shred : myShreds) { Segment currentRange = shred.getHostRangeMarker(); if (currentRange == null) continue; TextRange textRange = ProperTextRange.create(currentRange); if (textRange.grown(1).contains(hostOffset)) return textRange; }...
getHostRange
251,777
void (int offset, @NotNull CharSequence s) { assert intersectWithEditable(new TextRange(offset, offset)) != null; if (isOneLine()) { s = StringUtil.replace(s.toString(), "\n", ""); } myDelegate.insertString(injectedToHost(offset), s); }
insertString
251,778
void (int startOffset, int endOffset) { assert intersectWithEditable(new TextRange(startOffset, startOffset)) != null; assert intersectWithEditable(new TextRange(endOffset, endOffset)) != null; List<TextRange> hostRangesToDelete; synchronized (myLock) { hostRangesToDelete = new ArrayList<>(myShreds.size()); int offset ...
deleteString
251,779
void (int startOffset, int endOffset, @NotNull CharSequence s) { Collection<StringOperation> operations = prepareReplaceString(startOffset, endOffset, s); int delta = 0; for (StringOperation stringOperation : operations) { TextRange hostRange = stringOperation.getRange(); CharSequence replace = stringOperation.getRepla...
replaceString
251,780
boolean () { return myDelegate.isWritable(); }
isWritable
251,781
long () { return isValid() ? myDelegate.getModificationStamp() : -1; }
getModificationStamp
251,782
int () { return myDelegate.getModificationSequence(); }
getModificationSequence
251,783
void () { myDelegate.fireReadOnlyModificationAttempt(); }
fireReadOnlyModificationAttempt
251,784
void (@NotNull DocumentListener listener) { myDelegate.addDocumentListener(listener); }
addDocumentListener
251,785
void (@NotNull DocumentListener listener, @NotNull Disposable parentDisposable) { myDelegate.addDocumentListener(listener, parentDisposable); }
addDocumentListener
251,786
void (@NotNull DocumentListener listener) { myDelegate.removeDocumentListener(listener); }
removeDocumentListener
251,787
RangeMarker (int startOffset, int endOffset, boolean surviveOnExternalChange) { return new RangeMarkerWindow(this, startOffset, endOffset, surviveOnExternalChange); }
createRangeMarker
251,788
void (@NotNull PropertyChangeListener listener) { myDelegate.addPropertyChangeListener(listener); }
addPropertyChangeListener
251,789
void (@NotNull PropertyChangeListener listener) { myDelegate.removePropertyChangeListener(listener); }
removePropertyChangeListener
251,790
void (boolean isReadOnly) { myDelegate.setReadOnly(isReadOnly); }
setReadOnly
251,791
RangeMarker (int startOffset, int endOffset) { ProperTextRange hostRange = injectedToHost(new ProperTextRange(startOffset, endOffset)); return myDelegate.createGuardedBlock(hostRange.getStartOffset(), hostRange.getEndOffset()); }
createGuardedBlock
251,792
void (@NotNull RangeMarker block) { myDelegate.removeGuardedBlock(block); }
removeGuardedBlock
251,793
RangeMarker (int startOffset, int endOffset) { ProperTextRange injRange = new ProperTextRange(startOffset, endOffset); // include prefixes/suffixes in guarded ranges - they can't be edited TextRange editable = ObjectUtils.notNull(intersectWithEditable(injRange), TextRange.EMPTY_RANGE); if (!injRange.equals(editable)) {...
getRangeGuard
251,794
void () { myDelegate.startGuardedBlockChecking(); }
startGuardedBlockChecking
251,795
void () { myDelegate.stopGuardedBlockChecking(); }
stopGuardedBlockChecking
251,796
void (int bufferSize) { myDelegate.setCyclicBufferSize(bufferSize); }
setCyclicBufferSize
251,797
void (@NotNull CharSequence text) { synchronized (myLock) { LOG.assertTrue(text.toString().startsWith(myShreds.get(0).getPrefix())); LOG.assertTrue(text.toString().endsWith(myShreds.get(myShreds.size() - 1).getSuffix())); if (isOneLine()) { text = StringUtil.replace(text.toString(), "\n", ""); } String[] changes = calc...
setText
251,798
boolean (int line) { return myDelegate.isLineModified(injectedToHostLine(line)); }
isLineModified
251,799
RangeMarker (@NotNull TextRange textRange) { ProperTextRange properTextRange = new ProperTextRange(textRange); return createRangeMarker(properTextRange.getStartOffset(), properTextRange.getEndOffset()); }
createRangeMarker