Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
301,700
ThreeState () { return myShouldBeAppliedToInjectionHost; }
isShouldBeAppliedToInjectionHost
301,701
void (@NotNull ThreeState shouldBeAppliedToInjectionHost) { myShouldBeAppliedToInjectionHost = shouldBeAppliedToInjectionHost; }
setShouldBeAppliedToInjectionHost
301,702
boolean () { return false; }
isSuppressAll
301,703
String () { return XmlPsiBundle.message("xml.suppressable.for.tag.title"); }
getName
301,704
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); if (PsiTreeUtil.getParentOfType(element, XmlTag.class) == null) return; myProvider.suppressForTag(element, myId); }
applyFix
301,705
PsiElement (@Nullable PsiElement context) { return PsiTreeUtil.getParentOfType(context, XmlTag.class); }
getContainer
301,706
String () { return XmlPsiBundle.message("xml.suppressable.for.file.title"); }
getName
301,707
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); myProvider.suppressForFile(element, myId); }
applyFix
301,708
PsiElement (@Nullable PsiElement context) { return context == null || !context.isValid() ? null : context.getContainingFile(); }
getContainer
301,709
String () { return XmlPsiBundle.message("xml.suppressable.all.for.file.title"); }
getName
301,710
Self (@NonNls String localName) { return withLocalName(StandardPatterns.string().equalTo(localName)); }
withLocalName
301,711
Self (@NonNls String... localNames) { return withLocalName(StandardPatterns.string().oneOf(localNames)); }
withLocalName
301,712
Self (final ElementPattern<String> localName) { return with(new PsiNamePatternCondition<>("withLocalName", localName) { @Override public String getPropertyValue(@NotNull final Object o) { return o instanceof XmlElement ? getLocalName((T)o) : null; } }); }
withLocalName
301,713
String (@NotNull final Object o) { return o instanceof XmlElement ? getLocalName((T)o) : null; }
getPropertyValue
301,714
Self (@NonNls final String namespace) { return withNamespace(StandardPatterns.string().equalTo(namespace)); }
withNamespace
301,715
Self (@NonNls final String... namespaces) { return withNamespace(StandardPatterns.string().oneOf(namespaces)); }
withNamespace
301,716
Self (final ElementPattern<String> namespace) { return with(new PatternConditionPlus<T, String>("withNamespace", namespace) { @Override public boolean processValues(T t, ProcessingContext context, PairProcessor<? super String, ? super ProcessingContext> processor) { return processor.process(getNamespace(t), context); } }); }
withNamespace
301,717
boolean (T t, ProcessingContext context, PairProcessor<? super String, ? super ProcessingContext> processor) { return processor.process(getNamespace(t), context); }
processValues
301,718
boolean (@Nullable final Object o, final ProcessingContext context) { return o instanceof XmlAttribute; }
accepts
301,719
String (XmlAttribute xmlAttribute) { return xmlAttribute.getLocalName(); }
getLocalName
301,720
String (XmlAttribute xmlAttribute) { return xmlAttribute.getNamespace(); }
getNamespace
301,721
XmlAttributePattern (final StringPattern pattern) { return with(new PatternConditionPlus<XmlAttribute, String>("withValue", pattern) { @Override public boolean processValues(XmlAttribute t, ProcessingContext context, PairProcessor<? super String, ? super ProcessingContext> processor) { return processor.process(t.getValue(), context); } }); }
withValue
301,722
boolean (XmlAttribute t, ProcessingContext context, PairProcessor<? super String, ? super ProcessingContext> processor) { return processor.process(t.getValue(), context); }
processValues
301,723
boolean (@Nullable final Object o, final ProcessingContext context) { return o instanceof XmlTag; }
accepts
301,724
String (XmlTag tag) { return tag.getLocalName(); }
getLocalName
301,725
String (XmlTag tag) { return tag.getNamespace(); }
getNamespace
301,726
Self (@NotNull @NonNls final String attributeName, @NotNull final String attributeValue) { return with(new PatternCondition<>("withAttributeValue") { @Override public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) { return Objects.equals(xmlTag.getAttributeValue(attributeName), attributeValue); } }); }
withAttributeValue
301,727
boolean (@NotNull final XmlTag xmlTag, final ProcessingContext context) { return Objects.equals(xmlTag.getAttributeValue(attributeName), attributeValue); }
accepts
301,728
Self (@NonNls final String @NotNull ... attributeNames) { return with(new PatternCondition<>("withAnyAttribute") { @Override public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) { for (String attributeName : attributeNames) { if (xmlTag.getAttribute(attributeName) != null) { return true; } } return false; } }); }
withAnyAttribute
301,729
boolean (@NotNull final XmlTag xmlTag, final ProcessingContext context) { for (String attributeName : attributeNames) { if (xmlTag.getAttribute(attributeName) != null) { return true; } } return false; }
accepts
301,730
Self (@NotNull final ElementPattern<? extends PsiMetaData> metaDataPattern) { return with(new PatternCondition<>("withDescriptor") { @Override public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) { return metaDataPattern.accepts(xmlTag.getDescriptor()); } }); }
withDescriptor
301,731
boolean (@NotNull final XmlTag xmlTag, final ProcessingContext context) { return metaDataPattern.accepts(xmlTag.getDescriptor()); }
accepts
301,732
Self (@NotNull final ElementPattern pattern) { return with(new PatternCondition<>("isFirstSubtag") { @Override public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) { final XmlTag parent = xmlTag.getParentTag(); return parent != null && pattern.accepts(parent, context) && parent.getSubTags()[0] == xmlTag; } }); }
isFirstSubtag
301,733
boolean (@NotNull final XmlTag xmlTag, final ProcessingContext context) { final XmlTag parent = xmlTag.getParentTag(); return parent != null && pattern.accepts(parent, context) && parent.getSubTags()[0] == xmlTag; }
accepts
301,734
Self (@NotNull final ElementPattern<? extends XmlTag> pattern) { return withSubTags(StandardPatterns.<XmlTag>collection().first(pattern)); }
withFirstSubTag
301,735
Self (@NotNull final ElementPattern<? extends Collection<XmlTag>> pattern) { return with(new PatternCondition<>("withSubTags") { @Override public boolean accepts(@NotNull final XmlTag xmlTag, final ProcessingContext context) { return pattern.accepts(Arrays.asList(xmlTag.getSubTags()), context); } }); }
withSubTags
301,736
boolean (@NotNull final XmlTag xmlTag, final ProcessingContext context) { return pattern.accepts(Arrays.asList(xmlTag.getSubTags()), context); }
accepts
301,737
Self (@NotNull @NonNls final String attributeName, @NotNull final String attributeValue) { return and(StandardPatterns.not(withAttributeValue(attributeName, attributeValue))); }
withoutAttributeValue
301,738
boolean (@Nullable final Object o, final ProcessingContext context) { return o instanceof XmlAttributeValue; }
accepts
301,739
XmlAttributeValuePattern (@NonNls String... names) { return names.length == 1 ? withLocalName(StandardPatterns.string().equalTo(names[0])) : withLocalName(StandardPatterns.string().oneOf(names)); }
withLocalName
301,740
XmlAttributeValuePattern (@NonNls String... names) { return withLocalName(StandardPatterns.string().oneOfIgnoreCase(names)); }
withLocalNameIgnoreCase
301,741
XmlAttributeValuePattern (ElementPattern<String> namePattern) { return with(new PsiNamePatternCondition<>("withLocalName", namePattern) { @Override public String getPropertyValue(@NotNull final Object o) { if (o instanceof XmlAttributeValue) { return getLocalName((XmlAttributeValue)o); } return null; } }); }
withLocalName
301,742
String (@NotNull final Object o) { if (o instanceof XmlAttributeValue) { return getLocalName((XmlAttributeValue)o); } return null; }
getPropertyValue
301,743
String (@NotNull XmlAttributeValue value) { final PsiElement parent = value.getParent(); if (parent instanceof XmlAttribute) { return ((XmlAttribute)parent).getLocalName(); } else if (parent instanceof XmlProcessingInstruction) { PsiElement prev = value.getPrevSibling(); if (!(prev instanceof XmlToken) || ((XmlToken)prev).getTokenType() != XmlTokenType.XML_EQ) return null; prev = prev.getPrevSibling(); if (!(prev instanceof XmlToken) || ((XmlToken)prev).getTokenType() != XmlTokenType.XML_NAME) return null; return prev.getText(); } else { return null; } }
getLocalName
301,744
XmlAttributeValuePattern (@NonNls String... names) { return names.length == 1 ? withNamespace(StandardPatterns.string().equalTo(names[0])) : withNamespace(StandardPatterns.string().oneOf(names)); }
withNamespace
301,745
XmlAttributeValuePattern (ElementPattern<String> namePattern) { return with(new PsiNamePatternCondition<>("withNamespace", namePattern) { @Override public String getPropertyValue(@NotNull final Object o) { if (o instanceof XmlAttributeValue) { final PsiElement parent = ((XmlAttributeValue)o).getParent(); if (parent instanceof XmlAttribute) { return ((XmlAttribute)parent).getNamespace(); } } return null; } }); }
withNamespace
301,746
String (@NotNull final Object o) { if (o instanceof XmlAttributeValue) { final PsiElement parent = ((XmlAttributeValue)o).getParent(); if (parent instanceof XmlAttribute) { return ((XmlAttribute)parent).getNamespace(); } } return null; }
getPropertyValue
301,747
XmlAttributeValuePattern (final StringPattern valuePattern) { return with(new PatternCondition<>("withValue") { @Override public boolean accepts(@NotNull XmlAttributeValue xmlAttributeValue, ProcessingContext context) { return valuePattern.accepts(xmlAttributeValue.getValue(), context); } }); }
withValue
301,748
boolean (@NotNull XmlAttributeValue xmlAttributeValue, ProcessingContext context) { return valuePattern.accepts(xmlAttributeValue.getValue(), context); }
accepts
301,749
boolean (@Nullable final Object o, final ProcessingContext context) { return o instanceof XmlElement; }
accepts
301,750
boolean (@Nullable final Object o, final ProcessingContext context) { return o instanceof XmlText; }
accepts
301,751
boolean (@Nullable final Object o, final ProcessingContext context) { return o instanceof XmlEntityRef; }
accepts
301,752
Self (final ElementPattern<XmlTag> rootTag) { return with(new PatternCondition<>("withRootTag") { @Override public boolean accepts(@NotNull final XmlFile xmlFile, final ProcessingContext context) { XmlDocument document = xmlFile.getDocument(); return document != null && rootTag.accepts(document.getRootTag(), context); } }); }
withRootTag
301,753
boolean (@NotNull final XmlFile xmlFile, final ProcessingContext context) { XmlDocument document = xmlFile.getDocument(); return document != null && rootTag.accepts(document.getRootTag(), context); }
accepts
301,754
XmlAttributeValuePattern (String... localNames) { return xmlAttributeValue().withLocalName(localNames); }
xmlAttributeValue
301,755
XmlAttributeValuePattern () { return XmlAttributeValuePattern.XML_ATTRIBUTE_VALUE_PATTERN; }
xmlAttributeValue
301,756
boolean (@NotNull PsiFile psiFile) { if (!EP_NAME.hasAnyExtensions()) { return false; } return ContainerUtil.exists(EP_NAME.getExtensionList(), supporter -> { for (Language language : psiFile.getViewProvider().getLanguages()) { if (supporter.isAvailable(psiFile, language)) return true; } return false; }); }
supportsTypedHandlers
301,757
boolean (@NotNull PsiFile psiFile, @NotNull Language lang) { if (!EP_NAME.hasAnyExtensions()) { return false; } return ContainerUtil.exists(EP_NAME.getExtensionList(), supporter -> supporter.isAvailable(psiFile, lang)); }
supportsTypedHandlers
301,758
XmlElementFactory (Project project) { return project.getService(XmlElementFactory.class); }
getInstance
301,759
void (@NotNull final PsiElement element) { myWalkingState.elementStarted(element); }
visitElement
301,760
void (@NotNull final PsiFile file) { if (myVisitAllFileRoots) { final FileViewProvider viewProvider = file.getViewProvider(); final List<PsiFile> allFiles = viewProvider.getAllFiles(); if (allFiles.size() > 1) { if (file == viewProvider.getPsi(viewProvider.getBaseLanguage())) { for (PsiFile lFile : allFiles) { lFile.acceptChildren(this); } return; } } } super.visitFile(file); }
visitFile
301,761
void () { myWalkingState.stopWalking(); }
stopWalking
301,762
void (@NotNull final PsiElement element) { element.acceptChildren(this); }
visitElement
301,763
void (@NotNull final PsiFile file) { if (myVisitAllFileRoots) { final FileViewProvider viewProvider = file.getViewProvider(); final List<PsiFile> allFiles = viewProvider.getAllFiles(); if (allFiles.size() > 1) { if (file == viewProvider.getPsi(viewProvider.getBaseLanguage())) { for (PsiFile lFile : allFiles) { lFile.acceptChildren(this); } return; } } } super.visitFile(file); }
visitFile
301,764
void (@NotNull XmlElement element) { visitElement(element); }
visitXmlElement
301,765
void (@NotNull XmlFile file) { visitFile(file); }
visitXmlFile
301,766
void (@NotNull XmlAttribute attribute) { visitXmlElement(attribute); }
visitXmlAttribute
301,767
void (@NotNull XmlComment comment) { visitXmlElement(comment); }
visitXmlComment
301,768
void (@NotNull XmlDecl decl) { visitXmlElement(decl); }
visitXmlDecl
301,769
void (@NotNull XmlDocument document) { visitXmlElement(document); }
visitXmlDocument
301,770
void (@NotNull XmlProlog prolog) { visitXmlElement(prolog); }
visitXmlProlog
301,771
void (@NotNull XmlText text) { visitXmlElement(text); }
visitXmlText
301,772
void (@NotNull XmlTag tag) { visitXmlElement(tag); }
visitXmlTag
301,773
void (@NotNull XmlToken token) { visitXmlElement(token); }
visitXmlToken
301,774
void (@NotNull XmlAttributeValue value) { visitXmlElement(value); }
visitXmlAttributeValue
301,775
void (@NotNull XmlDoctype xmlDoctype) { visitXmlElement(xmlDoctype); }
visitXmlDoctype
301,776
void (@NotNull XmlProcessingInstruction processingInstruction) { visitXmlElement(processingInstruction); }
visitXmlProcessingInstruction
301,777
boolean (Class hintClass) { return ReflectionUtil.isAssignable(XmlTag.class, hintClass) || ReflectionUtil.isAssignable(XmlDocument.class, hintClass); }
isClassAcceptable
301,778
boolean (Object element, PsiElement context) { if(element instanceof XmlTag psiElement){ if (!psiElement.isValid()) return false; final String ns = psiElement.getNamespace(); if (isNamespaceAcceptable(ns)) return true; final PsiFile psiFile = psiElement.getContainingFile(); if (psiFile instanceof XmlFile) { // We use file references for as dtd namespace // But we should also check PUBLIC ID for namespace XmlDocument document = ((XmlFile)psiFile).getDocument(); if (document == null) return false; final XmlProlog prolog = document.getProlog(); if (prolog != null) { final XmlDoctype doctype = prolog.getDoctype(); if (doctype != null) { final String publicId = doctype.getPublicId(); if (publicId != null) { if (isNamespaceAcceptable(publicId)) return true; } } } } } else if(element instanceof XmlDocument){ return isAcceptable(((XmlDocument) element).getRootTag(), context); } return false; }
isAcceptable
301,779
boolean (String ns) { for (String aMyValue : myNamespaces) { if (aMyValue.equals(ns)) return true; } return false; }
isNamespaceAcceptable
301,780
boolean (XmlTag tag) { return tag.getDescriptor() instanceof XmlCustomElementDescriptor descriptor && descriptor.isCustomElement(); }
isCustomElement
301,781
XmlFile (@NotNull @NonNls String namespace, @Nullable Module module, @NotNull PsiFile file) { if (file.getProject().isDefault()) return null; final boolean dumb = DumbService.getInstance(file.getProject()).isDumb(); for (XmlSchemaProvider provider: EP_NAME.getExtensionList()) { if (dumb && !DumbService.isDumbAware(provider)) { continue; } if (file instanceof XmlFile && !provider.isAvailable((XmlFile)file)) { continue; } final XmlFile schema = provider.getSchema(namespace, module, file); if (schema != null) { return schema; } } return null; }
findSchema
301,782
XmlFile (@NotNull @NonNls String namespace, @NotNull PsiFile baseFile) { final PsiDirectory directory = baseFile.getParent(); final Module module = ModuleUtilCore.findModuleForPsiElement(directory == null ? baseFile : directory); return findSchema(namespace, module, baseFile); }
findSchema
301,783
List<XmlSchemaProvider> (@NotNull XmlFile file) { return ContainerUtil.findAll(EP_NAME.getExtensionList(), xmlSchemaProvider -> xmlSchemaProvider.isAvailable(file)); }
getAvailableProviders
301,784
boolean (@NotNull final XmlFile file) { return false; }
isAvailable
301,785
Set<String> (@NotNull final XmlFile file, @Nullable final String tagName) { return Collections.emptySet(); }
getAvailableNamespaces
301,786
String (@NotNull @NonNls String namespace, @NotNull final XmlFile context) { return null; }
getDefaultPrefix
301,787
Set<String> (@NotNull @NonNls String namespace, @NotNull final XmlFile context) { return null; }
getLocations
301,788
String () { return implementationClass; }
getImplementationClassName
301,789
String (String text) { if (text == null) return null; String offensiveChars = "<>&\n"; final int textLength = text.length(); if (textLength > 0 && (Character.isWhitespace(text.charAt(0)) || Character.isWhitespace(text.charAt(textLength - 1)))) { return "<![CDATA[" + text + "]]>"; } for (int i = 0; i < offensiveChars.length(); i++) { char c = offensiveChars.charAt(i); if (text.indexOf(c) != -1) { return "<![CDATA[" + text + "]]>"; } } return text; }
getCDATAQuote
301,790
String (String text) { if (text == null) return null; String offensiveChars = "<>&"; for (int i = 0; i < offensiveChars.length(); i++) { char c = offensiveChars.charAt(i); if (text.indexOf(c) != -1) { return "<![CDATA[" + text + "]]>"; } } return text; }
getInlineQuote
301,791
CharSequence (@NonNls String tagName, @NonNls String tagValue) { StringBuilder builder = new StringBuilder(); builder.append('<').append(tagName); if (StringUtil.isEmpty(tagValue)) { builder.append("/>"); } else { builder.append('>').append(getCDATAQuote(tagValue)).append("</").append(tagName).append('>'); } return builder; }
composeTagText
301,792
String[] () { return ArrayUtilRt.toStringArray(ourCharacterEntities.keySet()); }
getCharacterEntityNames
301,793
char (String entityName) { int c = ourCharacterEntities.get(entityName); return c==-1?0:(char)c; }
getCharacterByEntityName
301,794
XmlToken (@NotNull XmlTag tag) { final ASTNode node = tag.getNode(); if (node == null) return null; ASTNode current = node.getFirstChildNode(); IElementType elementType; while (current != null && (elementType = current.getElementType()) != XmlTokenType.XML_NAME && elementType != XmlTokenType.XML_TAG_NAME) { current = current.getTreeNext(); } return current == null ? null : (XmlToken)current.getPsi(); }
getStartTagNameElement
301,795
XmlToken (@NotNull XmlTag tag) { final ASTNode node = tag.getNode(); if (node == null) return null; ASTNode current = node.getLastChildNode(); ASTNode prev = current; while (current != null) { final IElementType elementType = prev.getElementType(); if ((elementType == XmlTokenType.XML_NAME || elementType == XmlTokenType.XML_TAG_NAME) && current.getElementType() == XmlTokenType.XML_END_TAG_START) { return (XmlToken)prev.getPsi(); } prev = current; current = TemplateLanguageUtil.getSameLanguageTreePrev(current); } return null; }
getEndTagNameElement
301,796
TextRange (final @NotNull XmlTag tag) { XmlTagValue tagValue = tag.getValue(); final String text = tagValue.getText(); final String trimmed = text.trim(); final int index = text.indexOf(trimmed); final int startOffset = tagValue.getTextRange().getStartOffset() - tag.getTextRange().getStartOffset() + index; return new TextRange(startOffset, startOffset + trimmed.length()); }
getTrimmedValueRange
301,797
TextRange (@NotNull XmlTag tag) { XmlToken tagName = getStartTagNameElement(tag); return getTagRange(tagName, XmlTokenType.XML_START_TAG_START); }
getStartTagRange
301,798
TextRange (@NotNull XmlTag tag) { XmlToken tagName = getEndTagNameElement(tag); return getTagRange(tagName, XmlTokenType.XML_END_TAG_START); }
getEndTagRange
301,799
TextRange (@Nullable XmlToken tagName, IElementType tagStart) { if (tagName == null) { return null; } PsiElement s = tagName.getPrevSibling(); while (s != null && s.getNode().getElementType() != tagStart) { s = s.getPrevSibling(); } PsiElement f = tagName.getNextSibling(); while (f != null && !(f.getNode().getElementType() == XmlTokenType.XML_TAG_END || f.getNode().getElementType() == XmlTokenType.XML_EMPTY_ELEMENT_END)) { f = f.getNextSibling(); } if (s != null && f != null) { return new TextRange(s.getTextRange().getStartOffset(), f.getTextRange().getEndOffset()); } return null; }
getTagRange