Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
251,600
TemplateDataModifications (int startOffset, @NotNull CharSequence textToInsert) { TemplateDataModifications modifications = new TemplateDataModifications(); modifications.addRangeToRemove(startOffset, textToInsert); return modifications; }
fromRangeToRemove
251,601
boolean (@NotNull TemplateDataModifications other) { return myOuterAndRemoveRanges.addAll(other.myOuterAndRemoveRanges); }
addAll
251,602
void (@NotNull CompositeElement parent, TreeElement anchorBefore, @NotNull OuterLanguageElement toInsert) { anchorBefore = findTopmostAnchor(anchorBefore); if (anchorBefore != null) { anchorBefore.rawInsertBeforeMe((TreeElement)toInsert); } else { parent.rawAddChildren((TreeElement)toInsert); } }
insert
251,603
TreeElement (@Nullable TreeElement anchorBefore) { while (anchorBefore != null && anchorBefore.getTreePrev() == null) { CompositeElement parent = anchorBefore.getTreeParent(); if (parent.getTreeParent() == null) break; anchorBefore = parent; } return anchorBefore; }
findTopmostAnchor
251,604
Lexer (TemplateLanguageFileViewProvider viewProvider) { return LanguageParserDefinitions.INSTANCE.forLanguage(viewProvider.getBaseLanguage()) .createLexer(viewProvider.getManager().getProject()); }
createBaseLexer
251,605
LanguageFileType (final Language language) { return new TemplateFileType(language); }
createTemplateFakeFileType
251,606
ASTNode (@NotNull ASTNode chameleon) { final CharTable charTable = SharedImplUtil.findCharTableByTree(chameleon); final FileElement fileElement = TreeUtil.getFileElement((TreeElement)chameleon); final PsiFile psiFile = (PsiFile)fileElement.getPsi(); PsiFile originalPsiFile = psiFile.getOriginalFile(); final TemplateLan...
parseContents
251,607
Language (TemplateLanguageFileViewProvider viewProvider) { return viewProvider.getTemplateDataLanguage(); }
getTemplateFileLanguage
251,608
PsiFile (final PsiFile psiFile, final Language templateLanguage, final CharSequence sourceCode, final TemplateLanguageFileViewProvider viewProvider, @NotNull TemplateDataElementType.RangeCollector rangeCollector) { CharSequence templateSourceCode = createTemplateText(sourceCode, createBaseLexer(viewProvider), rangeColl...
createTemplateFile
251,609
CharSequence (@NotNull CharSequence sourceCode, @NotNull Lexer baseLexer, @NotNull TemplateDataElementType.RangeCollector rangeCollector) { if (REQUIRES_OLD_CREATE_TEMPLATE_TEXT.getValue()) { return oldCreateTemplateText(sourceCode, baseLexer, rangeCollector); } TemplateDataModifications modifications = collectTemplate...
createTemplateText
251,610
CharSequence (@NotNull CharSequence sourceCode, @NotNull Lexer baseLexer, @NotNull RangeCollector rangeCollector) { StringBuilder result = new StringBuilder(sourceCode.length()); baseLexer.start(sourceCode); TextRange currentRange = TextRange.EMPTY_RANGE; int tokenCounter = 0; while (baseLexer.getTokenType() != null) {...
oldCreateTemplateText
251,611
TemplateDataModifications (@NotNull CharSequence sourceCode, @NotNull Lexer baseLexer) { TemplateDataModifications modifications = new TemplateDataModifications(); baseLexer.start(sourceCode); TextRange currentRange = TextRange.EMPTY_RANGE; int tokenCounter = 0; while (baseLexer.getTokenType() != null) { if (++tokenCou...
collectTemplateModifications
251,612
String (@NotNull TextRange range, @NotNull CharSequence sequence) { return "'" + StringUtil.escapeLineBreak(range.subSequence(sequence).toString()) + "' " + range; }
getRangeDump
251,613
void (@NotNull StringBuilder result, @NotNull CharSequence buf, @NotNull Lexer lexer, @NotNull TemplateDataElementType.RangeCollector collector) { result.append(buf, lexer.getTokenStart(), lexer.getTokenEnd()); }
appendCurrentTemplateToken
251,614
TemplateDataModifications (int tokenEndOffset, @NotNull CharSequence tokenText) { return TemplateDataModifications.EMPTY; }
appendCurrentTemplateToken
251,615
TokenSet () { return TokenSet.EMPTY; }
getTemplateDataInsertionTokens
251,616
boolean (@Nullable IElementType tokenType, @NotNull CharSequence tokenSequence) { return false; }
isInsertionToken
251,617
OuterLanguageElementImpl (@NotNull CharSequence internedTokenText, @NotNull IElementType outerElementType) { var factoryCreatedElement = ASTFactory.leaf(outerElementType, internedTokenText); if (factoryCreatedElement instanceof OuterLanguageElementImpl) { return (OuterLanguageElementImpl)factoryCreatedElement; } LOG.er...
createOuterLanguageElement
251,618
PsiFile (final Language language, CharSequence sourceCode, PsiManager manager) { final @NonNls LightVirtualFile virtualFile = new LightVirtualFile("foo", createTemplateFakeFileType(language), sourceCode, LocalTimeCounter.currentTime()); FileViewProvider viewProvider = new SingleRootFileViewProvider(manager, virtualFile...
createPsiFileFromSource
251,619
Language () { return language; }
getBaseLanguage
251,620
ASTNode (@NotNull ASTNode chameleon, @NotNull Language language, @NotNull Function<? super @NotNull CharSequence, ? extends @NotNull ASTNode> parser) { RangeCollectorImpl collector = chameleon.getUserData(RangeCollectorImpl.OUTER_ELEMENT_RANGES); return collector != null ? collector.applyRangeCollectorAndExpandChameleo...
parseWithOuterAndRemoveRangesApplied
251,621
String () { return ""; }
getDefaultExtension
251,622
Icon () { return null; }
getIcon
251,623
void (@NotNull TextRange newRange) {}
addOuterRange
251,624
void (@NotNull TextRange rangeToRemove) {}
addRangeToRemove
251,625
void (@NotNull CompositeElement parent, TreeElement anchorBefore, @NotNull OuterLanguageElement toInsert) { if(anchorBefore != null) { anchorBefore.rawInsertBeforeMe((TreeElement)toInsert); } else parent.rawAddChildren((TreeElement)toInsert); }
insert
251,626
Collection<PsiFileSystemItem> () { final FileReference contextRef = getContextReference(); List<PsiFileSystemItem> result = new ArrayList<>(); if (contextRef == null) { Collection<PsiFileSystemItem> defaultContexts = myFileReferenceSet.getDefaultContexts(); for (PsiFileSystemItem context : defaultContexts) { if (contex...
getContexts
251,627
void (final @NotNull String text, @NotNull PsiFileSystemItem context, final @NotNull Collection<? super ResolveResult> result, final boolean caseSensitive) { if (isAllowedEmptyPath(text) || ".".equals(text) || "/".equals(text)) { if (context instanceof FileReferenceResolver) { ResolveResult element = resolveFileReferen...
innerResolveInContext
251,628
boolean (@NotNull String name, boolean isDirectory) { return caseSensitive ? decoded.equals(name) : decoded.compareToIgnoreCase(name) == 0; }
acceptItem
251,629
boolean (@NotNull PsiFileSystemItem element) { result.add(new PsiElementResolveResult(getOriginalFile(element))); return true; }
execute
251,630
boolean (PsiDirectory context, boolean caseSensitive) { return context.getVirtualFile().isCaseSensitive() == caseSensitive; }
caseSensitivityApplies
251,631
boolean (String text) { return text.isEmpty() && isLast() && (StringUtil.isEmpty(myFileReferenceSet.getPathString()) && myFileReferenceSet.isEmptyPathAllowed() || !myFileReferenceSet.isEndingSlashNotAllowed() && myIndex > 0); }
isAllowedEmptyPath
251,632
String (@NotNull String text) { if (SystemInfo.isMac) { text = Normalizer.normalize(text, Normalizer.Form.NFC); } // strip http get parameters String _text = text; int paramIndex = text.lastIndexOf('?'); if (paramIndex >= 0) { _text = text.substring(0, paramIndex); } if (myFileReferenceSet.isUrlEncoded()) { try { retur...
decode
251,633
Object (PsiElement candidate) { return null; }
createLookupItem
251,634
PsiFileSystemItem (PsiFileSystemItem fileSystemItem) { final VirtualFile file = fileSystemItem.getVirtualFile(); if (file != null && !file.isDirectory()) { final PsiManager psiManager = fileSystemItem.getManager(); if (psiManager != null) { final PsiFile psiFile = psiManager.findFile(file); if (psiFile != null) { fileS...
getOriginalFile
251,635
void (final PsiFileSystemItem context, final PsiFileSystemItemProcessor processor) { context.processChildren(processor); }
processVariants
251,636
PsiElement () { return myFileReferenceSet.getElement(); }
getElement
251,637
PsiFileSystemItem () { ResolveResult[] resolveResults = multiResolve(false); return resolveResults.length == 1 ? (PsiFileSystemItem)resolveResults[0].getElement() : null; }
resolve
251,638
boolean (@NotNull PsiElement element) { if (element instanceof PsiDirectoryContainer) { PsiDirectory[] directories = ((PsiDirectoryContainer)element).getDirectories(); for (ResolveResult result : multiResolve(false)) { PsiElement resultElement = result.getElement(); if (resultElement instanceof PsiFileSystemItem && Con...
isReferenceTo
251,639
TextRange () { return myRange; }
getRangeInElement
251,640
String () { return myText; }
getText
251,641
boolean () { return myFileReferenceSet.isSoft(); }
isSoft
251,642
Collection<PsiFileSystemItem> (VirtualFile curVFile, Project project, FileReferenceHelper helper) { CommonProcessors.CollectProcessor<PsiFileSystemItem> processor = new CommonProcessors.CollectProcessor<>(); helper.processContexts(getFileReferenceSet(), curVFile, true, processor); return processor.getResults(); }
getContextsForBindToElement
251,643
PsiElement (String name) { return ElementManipulators.handleContentChange(getElement(), getRangeInElement(), name); }
fixRefText
251,644
int () { return myIndex; }
getIndex
251,645
boolean () { return myIndex == myFileReferenceSet.getAllReferences().length - 1; }
isLast
251,646
FileReferenceSet () { return myFileReferenceSet; }
getFileReferenceSet
251,647
FileReference () { return myFileReferenceSet.getLastReference(); }
getLastFileReference
251,648
PsiFileSystemItem () { return myContext; }
getFileSystemItem
251,649
Collection<FileTargetContext> (Collection<? extends PsiFileSystemItem> items) { return ContainerUtil.map(items, FileTargetContext::new); }
toTargetContexts
251,650
Collection<FileTargetContext> (PsiFileSystemItem item) { return Collections.singletonList(new FileTargetContext(item)); }
toTargetContexts
251,651
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FileTargetContext context = (FileTargetContext)o; return myContext.equals(context.myContext) && Arrays.equals(myPathToCreate, context.myPathToCreate); }
equals
251,652
int () { int result = Objects.hash(myContext); result = 31 * result + Arrays.hashCode(myPathToCreate); return result; }
hashCode
251,653
String (PsiFileSystemItem root, String relativePath) { return absoluteUrlNeedsStartSlash() ? "/" + relativePath : relativePath; }
getNewAbsolutePath
251,654
String () { return "/"; }
getSeparatorString
251,655
int (@NotNull CharSequence sequence, int atOffset) { return StringUtil.startsWith(sequence, atOffset, getSeparatorString()) ? getSeparatorString().length() : 0; }
findSeparatorLength
251,656
int (@NotNull CharSequence sequence, int startingFrom) { return StringUtil.indexOf(sequence, getSeparatorString(), startingFrom); }
findSeparatorOffset
251,657
Collection<PsiFileSystemItem> () { return emptyList(); }
getExtraContexts
251,658
FileReferenceSet (@NotNull PsiElement element, final boolean soft, boolean endingSlashNotAllowed, final boolean urlEncoded) { final TextRange range = ElementManipulators.getValueTextRange(element); int offset = range.getStartOffset(); String text = range.substring(element.getText()); for (final FileReferenceHelper help...
createSet
251,659
boolean () { return urlEncoded; }
isUrlEncoded
251,660
boolean () { return soft; }
isSoft
251,661
PsiElement () { return myElement; }
getElement
251,662
boolean () { return myCaseSensitive; }
isCaseSensitive
251,663
boolean () { return myEndingSlashNotAllowed; }
isEndingSlashNotAllowed
251,664
int () { return myStartInElement; }
getStartInElement
251,665
void () { List<FileReference> referencesList = reparse(myPathStringNonTrimmed, myStartInElement); myReferences = referencesList.toArray(FileReference.EMPTY); }
reparse
251,666
List<FileReference> (String str, int startInElement) { int wsHead = 0; int wsTail = 0; LiteralTextEscaper<? extends PsiLanguageInjectionHost> escaper; TextRange valueRange; CharSequence decoded; // todo replace @param str with honest @param rangeInElement; and drop the following startsWith(..) if (myElement instanceof ...
reparse
251,667
int (int offset, LiteralTextEscaper<? extends PsiLanguageInjectionHost> escaper, TextRange valueRange) { return escaper == null ? offset + valueRange.getStartOffset() : escaper.getOffsetInHost(offset, valueRange); }
offset
251,668
FileReference (int index) { return myReferences[index]; }
getReference
251,669
boolean () { return false; }
isSoft
251,670
boolean () { return false; }
isUrlEncoded
251,671
Collection<PsiFileSystemItem> () { Collection<PsiFileSystemItem> result = myDefaultContexts; if (result == null) { result = computeDefaultContexts(); myDefaultContexts = result; } return result; }
getDefaultContexts
251,672
Collection<PsiFileSystemItem> () { final PsiFile file = getContainingFile(); if (file == null) return emptyList(); Collection<PsiFileSystemItem> contexts = getCustomizationContexts(file); if (contexts != null) { return contexts; } if (isAbsolutePathReference()) { return getAbsoluteTopLevelDirLocations(file); } return g...
computeDefaultContexts
251,673
Collection<PsiFileSystemItem> (@NotNull PsiFile file) { final PsiElement context = file.getContext(); if (context != null) file = context.getContainingFile(); Collection<PsiFileSystemItem> folders = getIncludingFileContexts(file); if (folders != null) return folders; return getContextByFileSystemItem(file.getOriginalFi...
getContextByFile
251,674
Collection<PsiFileSystemItem> (@NotNull PsiFileSystemItem file) { VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile != null && FileBasedIndex.getInstance().getFileBeingCurrentlyIndexed() == null) { final FileReferenceHelper[] helpers = FileReferenceHelperRegistrar.getHelpers(); final Collection<PsiFileSy...
getContextByFileSystemItem
251,675
Collection<PsiFileSystemItem> () { PsiFile file = getContainingFile(); VirtualFile virtualFile = file == null ? null : file.getOriginalFile().getVirtualFile(); final VirtualFile parent = virtualFile == null ? null : virtualFile.getParent(); final PsiDirectory directory = parent == null ? null :file.getManager().findDir...
getParentDirectoryContext
251,676
Collection<FileTargetContext> () { PsiFile file = getContainingFile(); if (file == null) return emptyList(); Collection<FileTargetContext> customizationContexts = getTargetCustomizationContexts(file); Collection<FileTargetContext> targetContexts; if (customizationContexts != null) { targetContexts = customizationContex...
getTargetContexts
251,677
Collection<FileTargetContext> (Collection<? extends FileTargetContext> contexts) { return ContainerUtil.filter(contexts, c -> { VirtualFile file = c.getFileSystemItem().getVirtualFile(); return file != null && c.getFileSystemItem().isDirectory() && file.isInLocalFileSystem(); }); }
filterLocalFsContexts
251,678
Collection<FileTargetContext> (@NotNull PsiFile file) { boolean absolutePathReference = isAbsolutePathReference(); if (!absolutePathReference) { PsiElement context = file.getContext(); if (context != null) file = context.getContainingFile(); Collection<PsiFileSystemItem> folders = getIncludingFileContexts(file); if (fo...
getTargetContextByFile
251,679
boolean () { return myPathString.startsWith(getSeparatorString()); }
isAbsolutePathReference
251,680
boolean () { return true; }
useIncludingFileAsContext
251,681
Collection<PsiFileSystemItem> (final @NotNull PsiFile file) { final VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile == null) return emptyList(); final PsiDirectory parent = file.getParent(); final Module module = ModuleUtilCore.findModuleForPsiElement(parent == null ? file : parent); if (module == null...
getAbsoluteTopLevelDirLocations
251,682
Collection<FileTargetContext> (@NotNull FileReferenceSetParameters parameters, @NotNull PsiFile file) { VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile == null) return emptyList(); PsiDirectory parent = file.getParent(); Module module = ModuleUtilCore.findModuleForPsiElement(parent == null ? file : par...
getTargetAbsoluteTopLevelContexts
251,683
Collection<PsiFileSystemItem> (VirtualFile... files) { return toFileSystemItems(Arrays.asList(files)); }
toFileSystemItems
251,684
Collection<PsiFileSystemItem> (@NotNull Collection<? extends VirtualFile> files) { final PsiManager manager = getElement().getManager(); return ContainerUtil.mapNotNull(files, file -> file != null && file.isValid() ? manager.findDirectory(file) : null); }
toFileSystemItems
251,685
Condition<PsiFileSystemItem> () { return Conditions.alwaysTrue(); }
getReferenceCompletionFilter
251,686
boolean (final boolean relative) { return true; }
couldBeConvertedTo
251,687
boolean () { return true; }
absoluteUrlNeedsStartSlash
251,688
boolean () { return myEmptyPathAllowed; }
isEmptyPathAllowed
251,689
void (boolean emptyPathAllowed) { myEmptyPathAllowed = emptyPathAllowed; }
setEmptyPathAllowed
251,690
boolean () { return true; }
supportsExtendedCompletion
251,691
Collection<FileTargetContext> (@NotNull FileReferenceSetParameters parameters, @NotNull PsiFile file) { return getTargetAbsoluteTopLevelContexts(parameters, file); }
getTargetContexts
251,692
Collection<PsiFileSystemItem> (PsiFile file) { return getAbsoluteTopLevelDirLocations(file); }
fun
251,693
FileReferenceCompletion () { return ApplicationManager.getApplication().getService(FileReferenceCompletion.class); }
getInstance
251,694
boolean (@NotNull FileReferenceSetParameters parameters, final @NotNull VirtualFile hostFile, boolean bind, @NotNull Processor<? super PsiFileSystemItem> processor) { PsiElement element = parameters.getElement(); getContexts(element.getProject(), hostFile).forEach(processor::process); return true; }
processContexts
251,695
Collection<PsiFileSystemItem> (@NotNull Module module, @NotNull VirtualFile hostFile) { return getRoots(module); }
getRoots
251,696
Collection<PsiFileSystemItem> (@NotNull Project project, final @NotNull VirtualFile hostFile) { return emptySet(); }
getContexts
251,697
boolean (@NotNull Project project, @NotNull VirtualFile contextFile, @NotNull VirtualFile referencedFile) { //not sure about what's more correct file here, I'd say that it should be contextFile instead of referencedFile //but for backward compatibility let's keep referencedFile return isMine(project, referencedFile); }
isMine
251,698
boolean (@NotNull FileReferenceSetParameters parameters, @NotNull VirtualFile hostFile, @NotNull Processor<? super FileTargetContext> processor) { PsiElement element = parameters.getElement(); getTargetContexts(element.getProject(), hostFile, parameters.isAbsolutePathReference()).forEach(processor::process); return tru...
processTargetContexts
251,699
Collection<FileTargetContext> (@NotNull Project project, @NotNull VirtualFile hostFile, boolean isAbsoluteReference) { if (isAbsoluteReference) { ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex(); Module module = index.getModuleForFile(hostFile); if (module == null) { return emptyList(); }...
getTargetContexts