Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
304,800
boolean (final XmlTag xmlTag) { PsiElement prev = xmlTag.getPrevSibling(); if (prev == null) return false; ASTNode prevNode = SourceTreeToPsiMap.psiElementToTree(prev); while (prevNode != null && containsWhiteSpacesOnly(prevNode)) { prevNode = prevNode.getTreePrev(); } if (prevNode == null) return false; if (!(SourceTr...
insertLineBreakBeforeTag
304,801
boolean (XmlTag tag) { return false; }
insertLineBreakAfterTagBegin
304,802
boolean (final ASTNode node) { if (node == null) return false; if (node.getElementType() == TokenType.WHITE_SPACE) return true; if (node instanceof LeafElement) return false; ASTNode child = node.getFirstChildNode(); while (child != null) { if (!containsWhiteSpacesOnly(child)) return false; child = child.getTreeNext();...
containsWhiteSpacesOnly
304,803
boolean (final XmlTag xmlTag) { return checkName(xmlTag, myHtmlCodeStyleSettings.HTML_ELEMENTS_TO_REMOVE_NEW_LINE_BEFORE); }
removeLineBreakBeforeTag
304,804
boolean (XmlTag tag, String option) { return checkName(tag, option, true); }
checkName
304,805
boolean (XmlTag tag, String option, boolean ignoreCase) { if (option == null) return false; for (String name : getTagNames(option)) { String optionName = name.trim(); String tagName = tag.getName(); if (ignoreCase ? optionName.equalsIgnoreCase(tagName) : optionName.equals(tagName)) return true; } return false; }
checkName
304,806
String[] (final String option) { String[] splits = myCachedSplits.get(option); if (splits == null) { splits = option.split(","); myCachedSplits.put(option, splits); } return splits; }
getTagNames
304,807
boolean (final XmlTag tag) { XmlTag current = tag; while (current != null) { if (checkName(current, myHtmlCodeStyleSettings.HTML_KEEP_WHITESPACES_INSIDE) || "jsp:attribute".equals(current.getName())) { return true; } current = current.getParentTag(); } return false; }
keepWhiteSpacesInsideTag
304,808
WrapType (final XmlTag xmlTag) { return shouldBeWrapped(xmlTag) ? WrapType.ALWAYS : WrapType.NORMAL; }
getWrappingTypeForTagEnd
304,809
WrapType (final XmlTag tag) { if (shouldBeWrapped(tag)) { return WrapType.ALWAYS; } if (!isInlineTag(tag)) { if (checkName(tag, myHtmlCodeStyleSettings.HTML_DONT_ADD_BREAKS_IF_INLINE_CONTENT)) { if (hasInlineContentOnly(tag)) return WrapType.NORMAL; } return WrapType.ALWAYS; } return WrapType.NORMAL; }
getWrappingTypeForTagBegin
304,810
boolean (final XmlTag tag) { final XmlTag[] tags = tag.getSubTags(); for (XmlTag xmlTag : tags) { if (!isInlineTag(xmlTag)) return false; if (!hasInlineContentOnly(xmlTag)) return false; } return true; }
hasInlineContentOnly
304,811
boolean (final XmlTag tag) { return checkName(tag, myHtmlCodeStyleSettings.HTML_INLINE_ELEMENTS); }
isInlineTag
304,812
boolean (final XmlTag tag) { return false; }
shouldBeWrapped
304,813
boolean (XmlTag tag) { return isInlineTag(tag); }
isTextElement
304,814
int (final XmlTag tag) { return myHtmlCodeStyleSettings.HTML_TEXT_WRAP; }
getTextWrap
304,815
int () { return myHtmlCodeStyleSettings.HTML_ATTRIBUTE_WRAP; }
getAttributesWrap
304,816
boolean () { return myHtmlCodeStyleSettings.HTML_ALIGN_ATTRIBUTES; }
getShouldAlignAttributes
304,817
boolean () { return myHtmlCodeStyleSettings.HTML_ALIGN_TEXT; }
getShouldAlignText
304,818
boolean () { return myHtmlCodeStyleSettings.HTML_KEEP_WHITESPACES; }
getShouldKeepWhiteSpaces
304,819
boolean () { return myHtmlCodeStyleSettings.HTML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE; }
getShouldAddSpaceAroundEqualityInAttribute
304,820
boolean () { return myHtmlCodeStyleSettings.HTML_SPACE_AFTER_TAG_NAME; }
getShouldAddSpaceAroundTagName
304,821
int () { return myHtmlCodeStyleSettings.HTML_KEEP_BLANK_LINES; }
getKeepBlankLines
304,822
boolean () { return myHtmlCodeStyleSettings.HTML_KEEP_LINE_BREAKS; }
getShouldKeepLineBreaks
304,823
boolean () { return myHtmlCodeStyleSettings.HTML_KEEP_LINE_BREAKS_IN_TEXT; }
getShouldKeepLineBreaksInText
304,824
boolean () { return true; }
getKeepWhiteSpacesInsideCDATA
304,825
int () { return XmlCodeStyleSettings.WS_AROUND_CDATA_PRESERVE; }
getWhiteSpaceAroundCDATAOption
304,826
CodeStyleSettings () { return myRootSettings; }
getSettings
304,827
boolean () { return myHtmlCodeStyleSettings.HTML_SPACE_INSIDE_EMPTY_TAG; }
addSpaceIntoEmptyTag
304,828
boolean () { return true; }
shouldSaveSpacesBetweenTagAndText
304,829
TextRange () { return calculateTextRange(mySubBlocks); }
getTextRange
304,830
List<Block> () { return mySubBlocks; }
getSubBlocks
304,831
Spacing (@Nullable Block child1, @NotNull Block child2) { if (child1 instanceof ReadOnlyBlock || child2 instanceof ReadOnlyBlock) { return Spacing.getReadOnlySpacing(); } if (!(child1 instanceof AbstractXmlBlock) || !(child2 instanceof AbstractXmlBlock)) { return null; } ASTNode node1 = ((AbstractBlock)child1).getNode(...
getSpacing
304,832
boolean (final ASTNode node) { return node.getElementType() == XmlElementType.XML_ENTITY_REF || node.getElementType() == XmlTokenType.XML_CHAR_ENTITY_REF; }
isEntityRef
304,833
boolean (final ASTNode node1, final ASTNode node2) { if (node1.getElementType() == XmlTokenType.XML_START_TAG_START && node1.textContains('%')) return true; if (node2.getElementType() == XmlTokenType.XML_EMPTY_ELEMENT_END && node2.textContains('%')) return true; return myXmlFormattingPolicy.getShouldAddSpaceAroundTagNa...
shouldAddSpaceAroundTagName
304,834
boolean (final boolean firstIsTag, final boolean secondIsTag, final boolean firstIsText, final boolean secondIsText) { return (firstIsText && secondIsText) || (firstIsTag && secondIsTag) || (firstIsTag && secondIsText) || (firstIsText && secondIsTag); }
isSpaceInText
304,835
boolean () { return (myXmlFormattingPolicy.keepWhiteSpacesInsideTag(getTag()) || myXmlFormattingPolicy.getShouldKeepWhiteSpaces()); }
keepWhiteSpaces
304,836
boolean (final ASTNode node) { final ASTNode parent = node.getTreeParent(); return parent != null && isTextNode(parent.getElementType()) || node.getElementType() == XmlTokenType.XML_DATA_CHARACTERS ; }
isTextFragment
304,837
ChildAttributes (final int newChildIndex) { if (isOuterLanguageBlock()) return ChildAttributes.DELEGATE_TO_NEXT_CHILD; final List<Block> subBlocks = getSubBlocks(); final int prevBlockIndex = newChildIndex - 1; if (prevBlockIndex >= 0 && prevBlockIndex < subBlocks.size()) { final Block prevBlock = subBlocks.get(newChil...
getChildAttributes
304,838
boolean (final Block block) { if (block instanceof XmlBlock) { return isAttributeElementType(((XmlBlock)block).getNode().getElementType()); } return false; }
isAttributeBlock
304,839
boolean () { return getSubBlocks().get(getSubBlocks().size() - 1).isIncomplete(); }
isIncomplete
304,840
boolean () { return isAttributeBlock(getSubBlocks().get(getSubBlocks().size() - 1)); }
endsWithAttribute
304,841
boolean (@NotNull ASTNode astNode) { return astNode.getElementType() == XmlElementType.XML_TAG && isTextOnlyTag(astNode) && isTextNotEndingWithLineBreaks(astNode.getTreePrev()) && isTextNotStartingWithLineBreaks(astNode.getTreeNext()); }
isInlineTag
304,842
boolean (@Nullable ASTNode astNode) { if (astNode != null && isTextNode(astNode.getElementType())) { ASTNode lastChild = astNode.getLastChildNode(); if (lastChild != null) { return !(lastChild.getPsi() instanceof PsiWhiteSpace) || !CharArrayUtil.containLineBreaks(lastChild.getChars()); } } return false; }
isTextNotEndingWithLineBreaks
304,843
boolean (@Nullable ASTNode astNode) { if (astNode != null && isTextNode(astNode.getElementType())) { ASTNode firstChild = astNode.getFirstChildNode(); if (firstChild != null) { return !(firstChild.getPsi() instanceof PsiWhiteSpace) || !CharArrayUtil.containLineBreaks(firstChild.getChars()); } } return false; }
isTextNotStartingWithLineBreaks
304,844
boolean (@NotNull ASTNode tagNode) { ASTNode child = tagNode.getFirstChildNode(); boolean checkContent = false; while (child != null) { IElementType childType = child.getElementType(); if (checkContent) { if (childType == XmlTokenType.XML_END_TAG_START) { return true; } else if (!isTextNode(childType)) return false; } ...
isTextOnlyTag
304,845
void (@NotNull XmlFormattingPolicy xmlFormattingPolicy) { myProcessJsp = xmlFormattingPolicy.myProcessJsp; myRootToBlockMap.putAll(xmlFormattingPolicy.myRootToBlockMap); myProcessJavaTree = xmlFormattingPolicy.processJavaTree(); }
copyFrom
304,846
Block (@NotNull Pair<PsiElement, Language> root) { if (!myRootToBlockMap.containsKey(root)) { myRootToBlockMap.put(root, createBlockFor(root)); } return myRootToBlockMap.get(root); }
getOrCreateBlockFor
304,847
Block (final Pair<? extends PsiElement, ? extends Language> root) { final FormattingModelBuilder builder = LanguageFormatting.INSTANCE.forContext(root.getSecond(), root.getFirst()); if (builder != null) { final Block result = builder.createModel(FormattingContext.create(root.getFirst(), getSettings())).getRootBlock(); ...
createBlockFor
304,848
XmlFormattingPolicy (@NotNull XmlBlock result) { return result.getPolicy(); }
getPolicy
304,849
void () { myProcessJsp = false; }
doNotProcessJsp
304,850
void (final Map<Pair<PsiElement, Language>, Block> rootToBlockMap) { myRootToBlockMap = rootToBlockMap; }
setRootModels
304,851
int (XmlTag xmlTag) { return 0; }
getBlankLinesBeforeTag
304,852
Indent () { return Indent.getNoneIndent(); }
getTagEndIndent
304,853
boolean () { return myProcessJsp; }
processJsp
304,854
void (final ASTNode node, final Block rootBlock) { myRootToBlockMap.put(Pair.create(node.getPsi(), node.getPsi().getLanguage()), rootBlock); }
setRootBlock
304,855
FormattingDocumentModel () { return myDocumentModel; }
getDocumentModel
304,856
boolean () { return true; }
allowWrapBeforeText
304,857
boolean () { return myProcessJavaTree; }
processJavaTree
304,858
void () { myProcessJavaTree = false; }
dontProcessJavaTree
304,859
boolean () { return false; }
isKeepSpacesAroundInlineTags
304,860
List<Block> () { ASTNode child = myNode.getFirstChildNode(); final Wrap attrWrap = Wrap.createWrap(getWrapType(myXmlFormattingPolicy.getAttributesWrap()), false); final Wrap textWrap = Wrap.createWrap(getWrapType(myXmlFormattingPolicy.getTextWrap(getTag())), true); final Wrap tagBeginWrap = createTagBeginWrapping(getTa...
buildChildren
304,861
boolean (IElementType elementType) { return false; }
isTagListEnd
304,862
boolean (IElementType elementType) { return false; }
isTagListStart
304,863
boolean (final ArrayList<Block> localResult) { return false; }
isJspResult
304,864
void (@NotNull ASTNode injectionHost, @NotNull List<Block> result, @NotNull List<Block> withInjections, @NotNull List<Block> regularBlocks) { int i = 0; int j = 0; int injectionHostOffset = injectionHost.getStartOffset(); // Since there are possible injections without formatter blocks (i.e. whitespace only block), // w...
combineRegularBlocksWithInjected
304,865
Indent () { return myXmlFormattingPolicy.indentChildrenOf(getTag()) ? Indent.getNormalIndent() : Indent.getNoneIndent(); }
getChildrenIndent
304,866
ASTNode (final List<Block> list, final @NotNull ASTNode textNode, final Wrap wrap, final Alignment alignment) { ASTNode child = textNode.getFirstChildNode(); return createXmlTextBlocks(list, textNode, child, wrap, alignment); }
createXmlTextBlocks
304,867
ASTNode (final List<Block> list, final ASTNode textNode, ASTNode child, final Wrap wrap, final Alignment alignment) { while (child != null) { if (!AbstractXmlBlock.containsWhiteSpacesOnly(child) && child.getTextLength() > 0) { final Indent indent = getChildrenIndent(); child = processChild(list, child, wrap, alignment,...
createXmlTextBlocks
304,868
Block (@NotNull ArrayList<@NotNull Block> localResult) { return createSyntheticBlock(localResult, getChildrenIndent()); }
createTagContentNode
304,869
Block (@NotNull ArrayList<@NotNull Block> localResult, @Nullable Indent childrenIndent) { return new SyntheticBlock(localResult, this, Indent.getNoneIndent(), myXmlFormattingPolicy, childrenIndent); }
createSyntheticBlock
304,870
Block (@NotNull ArrayList<@NotNull Block> localResult) { return createSyntheticBlock(localResult, null); }
createTagDescriptionNode
304,871
Spacing (@Nullable Block child1, @NotNull Block child2) { if (isPreserveSpace()) return Spacing.getReadOnlySpacing(); if (child1 instanceof AbstractSyntheticBlock && child2 instanceof AbstractSyntheticBlock) { return getSpacing((AbstractSyntheticBlock)child1, (AbstractSyntheticBlock)child2); } return null; }
getSpacing
304,872
Spacing (final AbstractSyntheticBlock syntheticBlock1, final AbstractSyntheticBlock syntheticBlock2) { if (syntheticBlock2.startsWithCDATA() || syntheticBlock1.endsWithCDATA()) { return Spacing.getReadOnlySpacing(); } if (syntheticBlock1.containsCDATA() && syntheticBlock2.isTagDescription() || syntheticBlock1.isTagDesc...
getSpacing
304,873
boolean () { return myXmlFormattingPolicy.insertLineBreakBeforeTag(getTag()); }
insertLineBreakBeforeTag
304,874
int () { return myXmlFormattingPolicy.getBlankLinesBeforeTag(getTag()); }
getBlankLinesBeforeTag
304,875
boolean () { return myXmlFormattingPolicy.removeLineBreakBeforeTag(getTag()); }
removeLineBreakBeforeTag
304,876
boolean () { return myXmlFormattingPolicy.isTextElement(getTag()); }
isTextElement
304,877
ChildAttributes (final int newChildIndex) { if (isAfterAttribute(newChildIndex)) { List<Block> subBlocks = getSubBlocks(); Block subBlock = subBlocks.get(newChildIndex - 1); int prevSubBlockChildrenCount = subBlock.getSubBlocks().size(); return subBlock.getChildAttributes(prevSubBlockChildrenCount); } else { if (myXmlF...
getChildAttributes
304,878
boolean (final int newChildIndex) { List<Block> subBlocks = getSubBlocks(); int index = newChildIndex - 1; Block prevBlock = index < subBlocks.size() ? subBlocks.get(index) : null; return prevBlock instanceof SyntheticBlock && ((SyntheticBlock)prevBlock).endsWithAttribute(); }
isAfterAttribute
304,879
Indent () { return myIndent; }
getIndent
304,880
boolean () { return false; }
insertLineBreakBeforeTag
304,881
boolean () { return false; }
removeLineBreakBeforeTag
304,882
boolean () { return true; }
isTextElement
304,883
List<Block> () { return myInjectedBlock.getSubBlocks(); }
buildChildren
304,884
TextRange () { return myInjectedBlock.getTextRange(); }
getTextRange
304,885
ChildAttributes (final int newChildIndex) { return myInjectedBlock.getChildAttributes(newChildIndex); }
getChildAttributes
304,886
TextRange () { if (myTextRange != null && !(isCDATAStart() || isCDATAEnd())) { return myTextRange; } else { return super.getTextRange(); } }
getTextRange
304,887
List<Block> () { // // Fix for EA-19269: // Split XML attribute value to the value itself and delimiters (needed for the case when it contains // template language tags inside). // if (myNode.getElementType() == XmlElementType.XML_ATTRIBUTE_VALUE) { return splitAttribute(myNode, myXmlFormattingPolicy); } if (myNode.get...
buildChildren
304,888
boolean () { if (isTextNode(myNode.getElementType())) { if (myXmlFormattingPolicy.getShouldKeepWhiteSpaces()) { return true; } else { final ASTNode treeParent = myNode.getTreeParent(); final XmlTag tag = getTag(treeParent); if (tag != null) { if (myXmlFormattingPolicy.keepWhiteSpacesInsideTag(tag)) { return true; } } }...
shouldKeepWhitespaces
304,889
List<Block> (ASTNode node, XmlFormattingPolicy formattingPolicy) { final ArrayList<Block> result = new ArrayList<>(3); ASTNode child = node.getFirstChildNode(); while (child != null) { if (child.getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER || child.getElementType() == XmlTokenType.XML_ATTRIBUTE_...
splitAttribute
304,890
void (ASTNode node, List<Block> result) { if (node instanceof OuterLanguageElement) { processChild(result, node, null, null, null); return; } ASTNode child = node.getFirstChildNode(); if (child == null && !(node instanceof PsiWhiteSpace) && node.getElementType() != TokenType.ERROR_ELEMENT && node.getTextLength() > 0) {...
createLeafBlocks
304,891
boolean (ASTNode node) { if (node instanceof OuterLanguageElement) { return true; } ASTNode child = node.getFirstChildNode(); while (child != null) { if (child instanceof OuterLanguageElement) { return true; } if (containsOuterLanguageElement(child)) return true; child = child.getTreeNext(); } return false; }
containsOuterLanguageElement
304,892
List<Block> () { if (myNode.getElementType() != XmlElementType.XML_COMMENT) return EMPTY; final ArrayList<Block> result = new ArrayList<>(3); ASTNode child = myNode.getFirstChildNode(); boolean hasOuterLangElements = false; while (child != null) { if (child instanceof OuterLanguageElement) { hasOuterLangElements = true...
splitComment
304,893
Spacing (Block child1, @NotNull Block child2) { if (!(child1 instanceof AbstractBlock) || !(child2 instanceof AbstractBlock)) { return null; } final IElementType elementType = myNode.getElementType(); final ASTNode node1 = ((AbstractBlock)child1).getNode(); final IElementType type1 = node1.getElementType(); final ASTNo...
getSpacing
304,894
Spacing (final IElementType type1, final IElementType type2) { if (type1 == XmlTokenType.XML_EQ || type2 == XmlTokenType.XML_EQ) { int spaces = myXmlFormattingPolicy.getShouldAddSpaceAroundEqualityInAttribute() ? 1 : 0; return Spacing .createSpacing(spaces, spaces, 0, myXmlFormattingPolicy.getShouldKeepLineBreaks(), my...
getSpacesInsideAttribute
304,895
Spacing (final IElementType type1, final IElementType type2) { if (type1 == XmlTokenType.XML_DATA_CHARACTERS && type2 == XmlTokenType.XML_DATA_CHARACTERS) { return Spacing .createSpacing(1, 1, 0, myXmlFormattingPolicy.getShouldKeepLineBreaksInText(), myXmlFormattingPolicy.getKeepBlankLines()); } else { return createDef...
getSpacesInsideText
304,896
Indent () { if (myNode.getElementType() == XmlElementType.XML_PROLOG || myNode.getElementType() == XmlElementType.XML_DOCTYPE || SourceTreeToPsiMap.treeElementToPsi(myNode) instanceof XmlDocument) { return Indent.getNoneIndent(); } return myIndent; }
getIndent
304,897
boolean () { return false; }
insertLineBreakBeforeTag
304,898
boolean () { return false; }
removeLineBreakBeforeTag
304,899
boolean () { return isTextNode(myNode.getElementType()) || myNode.getElementType() == XmlTokenType.XML_DATA_CHARACTERS || myNode.getElementType() == XmlTokenType.XML_CHAR_ENTITY_REF || myNode.getElementType() == XmlElementType.XML_ENTITY_REF; }
isTextElement