Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
303,900
String () { return ACTION_ID; }
getName
303,901
ActionPresentation () { return new ActionPresentationData(XmlPsiBundle.message("html5.outline.mode"), null, AllIcons.Xml.Html5); }
getPresentation
303,902
String () { return XmlPsiBundle.message("html5.outline.mode"); }
getCheckBoxText
303,903
String () { return "FileStructurePopup"; }
getActionIdForShortcut
303,904
String () { return HTML5_OUTLINE_PROVIDER_PROPERTY; }
getPropertyName
303,905
Collection<Html5SectionTreeElement> (@NotNull final TreeElement node) { if (!(node instanceof HtmlFileTreeElement)) return Collections.emptyList(); final XmlFile xmlFile = ((HtmlFileTreeElement)node).getElement(); final XmlDocument document = xmlFile == null ? null : xmlFile.getDocument(); if (document == null) return ...
provideNodes
303,906
Collection<StructureViewTreeElement> () { return myChildrenComputable.compute(); }
getChildrenBase
303,907
String () { if (myHeader != null) { return HtmlTagTreeElement.normalizeSpacesAndShortenIfLong(myHeader); } final XmlTag tag = getElement(); return tag == null ? null : HtmlTagTreeElement.normalizeSpacesAndShortenIfLong(tag.getValue().getTrimmedText()); }
getPresentableText
303,908
String () { return HtmlUtil.getTagPresentation(getElement()); }
getLocationString
303,909
boolean () { return true; }
isSearchInLocationString
303,910
Comparator () { return new Comparator() { @Override public int compare(Object o1, Object o2) { String s1 = SorterUtil.getStringPresentation(o1); String s2 = SorterUtil.getStringPresentation(o2); if (isTagPresentation(s1, "head") && isTagPresentation(s2, "body")) return -1; if (isTagPresentation(s1, "body") && isTagPres...
getComparator
303,911
int (Object o1, Object o2) { String s1 = SorterUtil.getStringPresentation(o1); String s2 = SorterUtil.getStringPresentation(o2); if (isTagPresentation(s1, "head") && isTagPresentation(s2, "body")) return -1; if (isTagPresentation(s1, "body") && isTagPresentation(s2, "head")) return 1; return s1.compareToIgnoreCase(s2);...
compare
303,912
boolean (final String presentation, final String tagName) { // "head", "head#id", "head.cls" final String lowerCased = StringUtil.toLowerCase(presentation); return lowerCased.startsWith(tagName) && (lowerCased.length() == tagName.length() || !Character.isLetter(lowerCased.charAt(tagName.length()))); }
isTagPresentation
303,913
boolean () { return true; }
isVisible
303,914
String () { return getName(); }
toString
303,915
ActionPresentation () { return new ActionPresentationData(PlatformEditorBundle.message("action.sort.alphabetically"), PlatformEditorBundle.message("action.sort.alphabetically"), AllIcons.ObjectBrowser.Sorted); }
getPresentation
303,916
String () { return ALPHA_SORTER_ID; }
getName
303,917
void (final @NotNull String place) { myStructureViewPlace = place; }
setPlace
303,918
String () { return myStructureViewPlace; }
getPlace
303,919
StructureViewTreeElement () { return new HtmlFileTreeElement(TreeStructureUtil.isInStructureViewPopup(this), getPsiFile()); }
getRoot
303,920
void (final Section section) { myChildren.add(section); }
addChildSection
303,921
LinkedList<Section> () { return myChildren; }
getChildren
303,922
XmlTag () { return myTag; }
getTag
303,923
void (final Section section) { section.myParent = this; super.addChildSection(section); }
addChildSection
303,924
XmlTag () { return myHeader; }
getHeader
303,925
void (final XmlTag header) { myHeader = header; }
setHeader
303,926
Section () { return myParent; }
getParent
303,927
Collection<Html5SectionTreeElement> (final XmlTag rootTag) { final Html5SectionsProcessor processor = new Html5SectionsProcessor(); processRecursively(rootTag, processor); return processor.getRootSections(); }
processAndGetRootSections
303,928
void (final XmlTag tag, final Html5SectionsProcessor processor) { if (tag.getAttribute("hidden") != null) return; processor.tagEntered(tag); if (!isHeader(tag)) { for (final XmlTag subTag : tag.getSubTags()) { processRecursively(subTag, processor); } } processor.tagExited(tag); }
processRecursively
303,929
void (final XmlTag tag) { if (isSectioningContentElement(tag) || isSectioningRootElement(tag)) { if (myCurrentOutlinee != null) { myStack.push(myCurrentOutlinee); } myCurrentOutlinee = new SectionHolder(tag); myCurrentSection = new Section(tag); myCurrentOutlinee.addChildSection(myCurrentSection); } else if (myCurrentO...
tagEntered
303,930
void (final XmlTag tag) { if (!myStack.isEmpty() && myStack.peek().getTag() == tag) { assert false; } else if (!myStack.isEmpty() && isHeader(tag)) { // do nothing } else if (!myStack.isEmpty() && isSectioningContentElement(tag)) { final SectionHolder exitedSectioningContent = myCurrentOutlinee; assert exitedSectioning...
tagExited
303,931
Collection<Html5SectionTreeElement> () { final Collection<Html5SectionTreeElement> result = new ArrayList<>(); for (SectionHolder sectionHolder : myRootSectionHolders) { for (Section section : sectionHolder.getChildren()) { if ("td".equalsIgnoreCase(section.getTag().getName()) && section.getHeader() == null && section....
getRootSections
303,932
Html5SectionTreeElement (final Section section) { return new Html5SectionTreeElement(section.getTag(), createChildrenComputable(section.getChildren()), getHeaderText(section.getHeader())); }
createHtml5SectionTreeElement
303,933
Computable<Collection<StructureViewTreeElement>> (final Collection<Section> children) { return () -> { final Collection<StructureViewTreeElement> result = new ArrayList<>(); for (Section section : children) { result.add(createHtml5SectionTreeElement(section)); } return result; }; }
createChildrenComputable
303,934
String (final @Nullable XmlTag header) { if (header == null) return null; final StringBuilder buf = new StringBuilder(); if (HGROUP_ELEMENT.equalsIgnoreCase(header.getLocalName())) { for (XmlTag subTag : header.getSubTags()) { if (ArrayUtil.contains(StringUtil.toLowerCase(subTag.getLocalName()), HEADER_ELEMENTS)) { if ...
getHeaderText
303,935
void (final XmlTag tag, final StringBuilder buf, final int maximumTextLength) { if (buf.length() >= maximumTextLength) return; final String text = tag.getValue().getTrimmedText(); if (!text.isEmpty()) { buf.append(text); } else { for (XmlTag subTag : tag.getSubTags()) { appendTextRecursively(subTag, buf, maximumTextLen...
appendTextRecursively
303,936
boolean (final XmlTag tag) { return ArrayUtil.contains(StringUtil.toLowerCase(tag.getLocalName()), SECTIONING_ROOT_ELEMENTS); }
isSectioningRootElement
303,937
boolean (final XmlTag tag) { return ArrayUtil.contains(StringUtil.toLowerCase(tag.getLocalName()), SECTIONING_CONTENT_ELEMENTS); }
isSectioningContentElement
303,938
boolean (final XmlTag tag) { return ArrayUtil.contains(StringUtil.toLowerCase(tag.getLocalName()), HEADER_ELEMENTS) || HGROUP_ELEMENT.equalsIgnoreCase(tag.getLocalName()); }
isHeader
303,939
int (final @NotNull XmlTag header1, final @NotNull XmlTag header2) { return getHeaderRank(header2) - getHeaderRank(header1); }
compareHeaderRanks
303,940
int (final XmlTag header) { if (HGROUP_ELEMENT.equalsIgnoreCase(header.getLocalName())) { int minIndex = HEADER_ELEMENTS.length; for (XmlTag subTag : header.getSubTags()) { int index = ArrayUtilRt.indexOf(HEADER_ELEMENTS, StringUtil.toLowerCase(subTag.getLocalName()), 0, HEADER_ELEMENTS.length); if (index < minIndex) {...
getHeaderRank
303,941
Collection<StructureViewTreeElement> () { if (isHtml5SectionsMode()) { return Collections.emptyList(); // Html5SectionsNodeProvider will return its structure } final XmlFile xmlFile = getElement(); final XmlDocument document = xmlFile == null ? null : xmlFile.getDocument(); if (document == null) { return Collections.em...
getChildrenBase
303,942
boolean () { final XmlFile xmlFile = getElement(); if (xmlFile == null) return false; if (myInStructureViewPopup) { final String propertyName = TreeStructureUtil.getPropertyName(Html5SectionsNodeProvider.HTML5_OUTLINE_PROVIDER_PROPERTY); if (PropertiesComponent.getInstance().getBoolean(propertyName)) { return true; } }...
isHtml5SectionsMode
303,943
String () { return toString(); // root element is not visible }
getPresentableText
303,944
Collection<StructureViewTreeElement> () { final XmlTag tag = getElement(); if (tag == null || !tag.isValid()) return Collections.emptyList(); return ContainerUtil.map(tag.getSubTags(), HtmlTagTreeElement::new); }
getChildrenBase
303,945
String () { final XmlTag tag = getElement(); if (tag == null) { return StructureViewBundle.message("node.structureview.invalid"); } return HtmlUtil.getTagPresentation(tag); }
getPresentableText
303,946
String () { final XmlTag tag = getElement(); if (tag == null) { return null; } if (tag.getName().equalsIgnoreCase("img") || HtmlUtil.isScriptTag(tag)) { return getPathDescription(tag.getAttributeValue("src")); } else if (tag.getName().equalsIgnoreCase("link")) { return getPathDescription(tag.getAttributeValue("href"));...
getLocationString
303,947
String (String src) { if (StringUtil.isEmpty(src)) { return null; } else { return StringUtil.shortenPathWithEllipsis(src, MAX_TEXT_LENGTH, true); } }
getPathDescription
303,948
boolean () { return true; }
isSearchInLocationString
303,949
String (final @NotNull String text) { StringBuilder builder = normalizeSpaces(text); return builder == null ? null : shortenTextIfLong(builder); }
normalizeSpacesAndShortenIfLong
303,950
StringBuilder (@NotNull String text) { if (text.isEmpty()) { return null; } final StringBuilder buf = new StringBuilder(text.length()); for (int i = 0, length = text.length(); i < length; i++) { char c = text.charAt(i); if (c <= ' ' || Character.isSpaceChar(c)) { if (buf.length() == 0 || buf.charAt(buf.length() - 1) !=...
normalizeSpaces
303,951
String (@NotNull StringBuilder text) { if (text.length() <= MAX_TEXT_LENGTH) { return text.toString(); } int index; for (index = MAX_TEXT_LENGTH; index > MAX_TEXT_LENGTH - 20; index--) { if (!Character.isLetter(text.charAt(index))) { break; } } text.setLength(Character.isLetter(index) ? MAX_TEXT_LENGTH : index); return...
shortenTextIfLong
303,952
String () { return " "; }
getLocationPrefix
303,953
String () { return ""; }
getLocationSuffix
303,954
StructureViewBuilder (@NotNull final PsiFile psiFile) { return new TreeBasedStructureViewBuilder() { @Override @NotNull public StructureViewModel createStructureViewModel(@Nullable Editor editor) { return new XmlStructureViewTreeModel((XmlFile)psiFile, editor); } }; }
getStructureViewBuilder
303,955
StructureViewModel (@Nullable Editor editor) { return new XmlStructureViewTreeModel((XmlFile)psiFile, editor); }
createStructureViewModel
303,956
StructureViewBuilder (@NotNull final PsiFile psiFile) { if (!(psiFile instanceof XmlFile)) { return null; } StructureViewBuilder builder = getStructureViewBuilderForExtensions(psiFile); if (builder != null) { return builder; } for (XmlStructureViewBuilderProvider xmlStructureViewBuilderProvider : getStructureViewBuilde...
getStructureViewBuilder
303,957
StructureViewModel (@Nullable Editor editor) { return new XmlStructureViewTreeModel((XmlFile)psiFile, editor); }
createStructureViewModel
303,958
XmlStructureViewBuilderProvider[] () { return (XmlStructureViewBuilderProvider[])Extensions.getRootArea() .getExtensionPoint(XmlStructureViewBuilderProvider.EP_NAME).getExtensions(); }
getStructureViewBuilderProviders
303,959
StructureViewBuilder (@NotNull PsiFile psiFile) { for (Language language : XMLLanguage.INSTANCE.getLanguageExtensionsForFile(psiFile)) { PsiStructureViewFactory factory = LanguageStructureViewBuilder.INSTANCE.forLanguage(language); if (factory == null) continue; final StructureViewBuilder builder = factory.getStructure...
getStructureViewBuilderForExtensions
303,960
VcsSelection (@NotNull DataContext context) { final Editor editor = context.getData(CommonDataKeys.EDITOR); if (editor == null) return null; PsiElement psiElement = TargetElementUtil.findTargetElement(editor, TargetElementUtil.ELEMENT_NAME_ACCEPTED); if (psiElement == null || !psiElement.isValid()) { return null; } fin...
getSelection
303,961
boolean (@NotNull PsiFile psiFile) { for (PsiFile file : psiFile.getViewProvider().getAllFiles()) { Language language = file.getLanguage(); if (language.isKindOf(HTMLLanguage.INSTANCE) || language.isKindOf(XHTMLLanguage.INSTANCE)) { return true; } } return false; }
isAvailable
303,962
void (final @NotNull XmlFile xmlFile, final @NotNull Set<? super PsiFile> resultSet) { HtmlLinkUtil.processLinks(xmlFile, tag -> { final XmlAttribute attribute = tag.getAttribute("href"); if (attribute == null) { return true; } final XmlAttributeValue link = attribute.getValueElement(); if (link == null) { return true;...
fillRelatedFiles
303,963
String () { return XmlBundle.message("html.related.linked.files.group"); }
getGroupName
303,964
void (final @NotNull List<? extends PsiElement> elements, final @NotNull Collection<? super LineMarkerInfo<?>> result) { Map<LineMarkerProvider, List<PsiElement>> embeddedLineMarkersWorkItems = null; for(PsiElement element:elements) { if(element instanceof PsiWhiteSpace) continue; final Language language = element.getL...
collectSlowLineMarkers
303,965
KeyDescriptor<String> () { return EnumeratorStringDescriptor.INSTANCE; }
getKeyDescriptor
303,966
boolean (final @NotNull VirtualFile file) { return file.isInLocalFileSystem(); }
acceptInput
303,967
boolean () { return true; }
dependsOnFileContent
303,968
int () { return 1; }
getVersion
303,969
XmlAttributeDescriptor[] (XmlTag tag) { if (tag == null || !HtmlUtil.isHtml5Context(tag)) { return XmlAttributeDescriptor.EMPTY; } final List<String> currentAttrs = new ArrayList<>(); for (XmlAttribute attribute : tag.getAttributes()) { currentAttrs.add(attribute.getName()); } final Project project = tag.getProject(); ...
getAttributeDescriptors
303,970
XmlAttributeDescriptor (String attributeName, XmlTag context) { if (context != null && HtmlUtil.isCustomHtml5Attribute(attributeName) && (HtmlUtil.isHtml5Context(context) || HtmlUtil.tagHasHtml5Schema(context))) { return new AnyXmlAttributeDescriptor(attributeName); } return null; }
getAttributeDescriptor
303,971
FeatureDescriptor[] () { return new FeatureDescriptor[]{new FeatureDescriptor(XmlCompletionContributor.TAG_NAME_COMPLETION_FEATURE, "completion", "TagNameCompletion", XmlBundle.message("tag.name.completion.display.name"), 0, 1, Collections.emptySet(), 3, this)}; }
getFeatureDescriptors
303,972
Tokenizer (PsiElement element) { if (element instanceof XmlText) { return myXmlTextTokenizer; } if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_DATA_CHARACTERS && !isXmlDataCharactersParentHandledByItsStrategy(element.getParent())) { // Special case for all other XML_DATA_CHARA...
getTokenizer
303,973
boolean (@NotNull PsiElement element, @NotNull String name) { DomElement domElement = DomUtil.getDomElement(element); if (domElement != null) { if (domElement.getAnnotation(NoSpellchecking.class) != null) { return true; } } return false; }
isSuppressedFor
303,974
SuppressQuickFix[] (@NotNull PsiElement element, @NotNull String name) { return SuppressQuickFix.EMPTY_ARRAY; }
getSuppressActions
303,975
boolean (@Nullable PsiElement parent) { if (parent == null) return false; var strategy = ContainerUtil.findInstance( LanguageSpellchecking.INSTANCE.allForLanguage(parent.getLanguage()), XmlSpellcheckingStrategy.class); return strategy != null ? strategy.isXmlDataCharactersParentHandled(parent) : isXmlDataCharactersPare...
isXmlDataCharactersParentHandledByItsStrategy
303,976
boolean (@NotNull PsiElement parent) { return parent instanceof XmlText || parent.getNode().getElementType() == XmlElementType.XML_CDATA; }
isXmlDataCharactersParentHandled
303,977
boolean (PsiElement element) { PsiFile file = element.getContainingFile(); return file == null || file.getLanguage() instanceof TemplateLanguage; }
isInTemplateLanguageFile
303,978
void (@NotNull PsiElement element) { if (element.getNode().getElementType() == XmlElementType.XML_CDATA) { element.acceptChildren(this); } else if (!(element instanceof LeafPsiElement) || !isContentToken(element.getNode().getElementType())) { result.add(element.getTextRangeInParent()); } }
visitElement
303,979
boolean (IElementType tokenType) { return tokenType == XmlTokenType.XML_DATA_CHARACTERS || tokenType == XmlTokenType.XML_CDATA_START || tokenType == XmlTokenType.XML_CDATA_END || XmlTokenType.WHITESPACES.contains(tokenType); }
isContentToken
303,980
boolean (IElementType tokenType) { return tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN || tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER || tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER || XmlTokenType.WHITESPACES.contains(tokenType); }
isContentToken
303,981
void (@NotNull XmlAttributeValue element, @NotNull TokenConsumer consumer) { PsiReference[] references = element.getReferences(); for (PsiReference reference : references) { if (reference instanceof XmlEnumeratedValueReference) { if (reference.resolve() != null) { // this is probably valid enumeration value from XSD/RN...
tokenize
303,982
boolean (final String s) { for (int i = 0; i < s.length(); i++) { if (!StringUtil.isHexDigit(s.charAt(i))) { return false; } } return true; }
isHexString
303,983
Tokenizer (PsiElement element) { if (element instanceof HtmlDocumentImpl) { return myDocumentTextTokenizer; } if (element instanceof XmlAttributeValue) { if (URLUtil.isDataUri(ElementManipulators.getValueText(element))) { return EMPTY_TOKENIZER; } PsiElement parent = element.getParent(); if (parent instanceof XmlAttrib...
getTokenizer
303,984
boolean (@NotNull PsiElement parent) { return super.isXmlDataCharactersParentHandled(parent) || parent instanceof HtmlDocumentImpl; }
isXmlDataCharactersParentHandled
303,985
void (@NotNull XmlToken token) { if (token.getTokenType() == XmlTokenType.XML_DATA_CHARACTERS) { var text = token.getText(); result.add(new SpellcheckRange(text, false, token.getStartOffsetInParent(), TextRange.allOf(text))); } }
visitXmlToken
303,986
void (@NotNull PsiElement element) { if (!isContentElement(element)) { result.add(element.getTextRangeInParent()); } }
visitElement
303,987
boolean (@NotNull PsiElement element) { var tokenType = element.getNode().getElementType(); if (tokenType == XmlTokenType.XML_DATA_CHARACTERS || XmlTokenType.WHITESPACES.contains(tokenType)) { return true; } if (tokenType == XmlTokenType.XML_ENTITY_REF_TOKEN || tokenType == XmlTokenType.XML_CHAR_ENTITY_REF) { return fa...
isContentElement
303,988
String () { return "XmlTokenizerBase(splitter=" + mySplitter + ")"; }
toString
303,989
void (@NotNull T element, @NotNull TokenConsumer consumer) { List<TextRange> excludeRanges = getSpellcheckOuterContentRanges(element); for (var spellcheckRange : getSpellcheckRanges(element)) { consumer.consumeToken( element, spellcheckRange.text, spellcheckRange.useRename, spellcheckRange.offset, spellcheckRange.range...
tokenize
303,990
Splitter (List<TextRange> excludeRanges, int offset) { return new Splitter() { @Override public void split(@Nullable String text, @NotNull TextRange range, Consumer<TextRange> consumer) { mySplitter.split(text, range, tokenRange -> { if (ContainerUtil.all(excludeRanges, excludeRange -> !excludeRange.intersects(tokenRan...
createExclusionAwareSplitter
303,991
void (@Nullable String text, @NotNull TextRange range, Consumer<TextRange> consumer) { mySplitter.split(text, range, tokenRange -> { if (ContainerUtil.all(excludeRanges, excludeRange -> !excludeRange.intersects(tokenRange.shiftRight(offset)))) { consumer.consume(tokenRange); } }); }
split
303,992
boolean (char ch) { return Character.isLetterOrDigit(ch) || Character.isWhitespace(ch); }
isLetterDigitOrWhitespace
303,993
record (String text, boolean useRename, int offset, TextRange rangeToCheck) { SpellcheckRange(String text) { this(text, false); } SpellcheckRange(String text, boolean useRename) { this(text, useRename, 0, TextRange.allOf(text)); } }
SpellcheckRange
303,994
String () { return DEFAULT_HTML_TEMPLATE_PROPERTY; }
getDefaultTemplateProperty
303,995
void (@NotNull Project project, @NotNull PsiDirectory directory, CreateFileFromTemplateDialog.Builder builder) { builder .setTitle(XmlBundle.message("html.action.new.file.dialog.title")) .addKind(XmlBundle.message("html.action.new.file.item.html5.file"), HtmlFileType.INSTANCE.getIcon(), FileTemplateManager.INTERNAL_HTM...
buildDialog
303,996
String (PsiDirectory directory, @NotNull String newName, String templateName) { return XmlBundle.message("html.action.new.file.name"); }
getActionName
303,997
FormattingModel (@NotNull FormattingContext formattingContext) { final PsiFile psiFile = formattingContext.getContainingFile(); final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(psiFile); return new XmlFormattingModel( psiFile, new XmlBlock(SourceTreeToPsiMap.psiElementToTree(psiFil...
createModel
303,998
TextRange (@NotNull ASTNode node, @NotNull TextRange range) { PsiElement psiElement = node.getPsi(); if (psiElement != null && psiElement.isValid() && psiElement.getLanguage().isKindOf(HTMLLanguage.INSTANCE)) { PsiFile file = psiElement.getContainingFile(); PsiElement fileContext = file.getContext(); String contextQuot...
process
303,999
Document () { return myDocument; }
getDocument