Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
301,500
void (XmlAttribute attribute) { XmlTag tag = attribute.getParent(); if (tag == null) return; final String name = attribute.getName(); PsiElement prevLeaf = PsiTreeUtil.prevLeaf(attribute); if (!(prevLeaf instanceof PsiWhiteSpace) && (!(tag instanceof HtmlTag) || !XmlUtil.hasNonEditableInjectionFragmentAt(attribute, att...
checkAttribute
301,501
void (final XmlTag tag, final String localName, final XmlAttribute attribute, @NotNull @InspectionMessage String localizedMessage) { final RemoveAttributeIntentionFix removeAttributeIntention = new RemoveAttributeIntentionFix(localName); if (tag instanceof HtmlTag) { return; } final HighlightInfoType tagProblemInfoType...
reportAttributeProblem
301,502
void (XmlTag tag, final XmlAttribute attribute) { if (skipValidation(tag)) { return; } final XmlAttribute[] attributes = tag.getAttributes(); final PsiFile containingFile = tag.getContainingFile(); final XmlExtension extension = containingFile instanceof XmlFile ? XmlExtension.getExtension(containingFile) : DefaultXmlE...
checkDuplicateAttribute
301,503
void (PsiElement value) { if (value == null) return; doCheckRefs(value, value.getReferences(), 0); }
checkReferences
301,504
void (@NotNull PsiElement value, final PsiReference @NotNull [] references, int start) { for (int i = start; i < references.length; ++i) { PsiReference reference = references[i]; ProgressManager.checkCanceled(); if (isUrlReference(reference)) continue; if (!hasBadResolve(reference, false)) { continue; } String descript...
doCheckRefs
301,505
boolean (PsiReference reference) { return reference instanceof FileReferenceOwner || reference instanceof AnchorReference || reference instanceof PsiFileReference; }
isUrlReference
301,506
boolean (final PsiReference reference, boolean checkSoft) { if (!checkSoft && reference.isSoft()) return false; if (reference instanceof PsiPolyVariantReference) { return ((PsiPolyVariantReference)reference).multiResolve(false).length == 0; } return reference.resolve() == null; }
hasBadResolve
301,507
void (boolean doJaxpTesting) { ourDoJaxpTesting = doJaxpTesting; }
setDoJaxpTesting
301,508
void (PsiElement context, String message, @NotNull ErrorType type) { addMessageWithFixes(context, message, type); }
addMessage
301,509
void (final PsiElement context, final String message, @NotNull final ErrorType type, final IntentionAction @NotNull ... fixes) { if (message != null && !message.isEmpty()) { final PsiFile containingFile = context.getContainingFile(); final HighlightInfoType defaultInfoType = type == ErrorType.ERROR ? HighlightInfoType....
addMessageWithFixes
301,510
boolean (@NotNull final PsiFile file) { if (file instanceof XmlFile) return true; for (PsiFile psiFile : file.getViewProvider().getAllFiles()) { if (psiFile instanceof XmlFile) { return true; } } return false; }
suitableForFile
301,511
void (@NotNull final PsiElement element) { element.accept(this); }
visit
301,512
boolean (@NotNull final PsiFile file, final boolean updateWholeFile, @NotNull HighlightInfoHolder holder, @NotNull Runnable action) { myHolder = holder; try { action.run(); } finally { myHolder = null; } return true; }
analyze
301,513
HighlightVisitor () { return new XmlHighlightVisitor(); }
clone
301,514
String (XmlAttributeValue value, XmlTag tag) { String unquotedValue = value.getValue(); if (tag instanceof HtmlTag) { unquotedValue = StringUtil.toLowerCase(unquotedValue); } return unquotedValue; }
getUnquotedValue
301,515
boolean (@NotNull XmlTag tag) { PsiElement parent = tag.getParent(); if (parent instanceof XmlTag) { return !skipValidation(parent) && !XmlUtil.tagFromTemplateFramework(tag); } return true; }
shouldBeValidated
301,516
HighlightDisplayLevel () { return HighlightDisplayLevel.ERROR; }
getDefaultLevel
301,517
void (@NotNull final PsiFile file, @NotNull final InspectionManager manager, @NotNull ProblemsHolder problemsHolder, @NotNull final GlobalInspectionContext globalContext, @NotNull final ProblemDescriptionsProcessor problemDescriptionsProcessor) { HighlightInfoHolder myHolder = new HighlightInfoHolder(file) { @Override ...
checkFile
301,518
boolean (@Nullable HighlightInfo info) { if (info != null) { GlobalInspectionUtil.createProblem( file, info, new TextRange(info.startOffset, info.endOffset), null, manager, problemDescriptionsProcessor, globalContext ); } return true; }
add
301,519
void () { file.accept(new XmlRecursiveElementVisitor() { @Override public void visitElement(@NotNull PsiElement element) { highlightVisitor.visit(element); super.visitElement(element); } }); }
run
301,520
void (@NotNull PsiElement element) { highlightVisitor.visit(element); super.visitElement(element); }
visitElement
301,521
String () { return getGeneralGroupName(); }
getGroupDisplayName
301,522
String () { return "XmlHighlighting"; }
getShortName
301,523
String () { return "HtmlUnknownTarget"; }
getShortName
301,524
boolean () { return true; }
isForHtml
301,525
boolean (PsiReference reference) { return !(reference instanceof AnchorReference) && notRemoteBase(reference); }
needToCheckRef
301,526
boolean (PsiReference reference) { final PsiFile file = reference.getElement().getContainingFile(); final String basePath = file instanceof XmlFile ? HtmlUtil.getHrefBase((XmlFile)file) : null; return basePath == null || !HtmlUtil.hasHtmlPrefix(basePath); }
notRemoteBase
301,527
PsiElementVisitor (@NotNull final ProblemsHolder holder, boolean isOnTheFly) { return new XmlElementVisitor() { @Override public void visitXmlAttribute(@NotNull XmlAttribute attribute) { PsiFile file = holder.getFile(); if (!(file instanceof XmlFile)) return; XmlRefCountHolder refCountHolder = XmlRefCountHolder.getRefC...
buildVisitor
301,528
void (@NotNull XmlAttribute attribute) { PsiFile file = holder.getFile(); if (!(file instanceof XmlFile)) return; XmlRefCountHolder refCountHolder = XmlRefCountHolder.getRefCountHolder((XmlFile)file); if (refCountHolder == null) return; if (!attribute.isNamespaceDeclaration()) { checkUnusedLocations(attribute, holder, ...
visitXmlAttribute
301,529
void (PsiReference[] references) { if (references.length == 0) { return; } XmlAttributeValue element = (XmlAttributeValue)references[0].getElement(); XmlAttribute attribute = (XmlAttribute)element.getParent(); if (element.getReferences().length == references.length) { // all refs to be removed attribute.delete(); retur...
removeReferencesOrAttribute
301,530
void (XmlAttribute attribute, ProblemsHolder holder, @NotNull XmlRefCountHolder refCountHolder) { if (XmlUtil.XML_SCHEMA_INSTANCE_URI.equals(attribute.getNamespace())) { if (XmlUtil.NO_NAMESPACE_SCHEMA_LOCATION_ATT.equals(attribute.getLocalName())) { if (refCountHolder.isInUse("")) return; holder.registerProblem(attrib...
checkUnusedLocations
301,531
String (XmlAttribute attribute) { return attribute.getName().contains(":") ? attribute.getLocalName() : ""; }
getDeclaredPrefix
301,532
XmlAttribute (XmlTag parent) { return parent.getAttribute(XmlUtil.NO_NAMESPACE_SCHEMA_LOCATION_ATT, XmlUtil.XML_SCHEMA_INSTANCE_URI); }
getDefaultLocation
301,533
PsiReference[] (String namespace, XmlTag tag) { XmlAttribute locationAttr = tag.getAttribute(XmlUtil.SCHEMA_LOCATION_ATT, XmlUtil.XML_SCHEMA_INSTANCE_URI); if (locationAttr == null) { return PsiReference.EMPTY_ARRAY; } XmlAttributeValue value = locationAttr.getValueElement(); return value == null ? PsiReference.EMPTY_A...
getLocationReferences
301,534
PsiReference[] (String namespace, XmlAttributeValue value) { PsiReference[] references = value.getReferences(); for (int i = 0, referencesLength = references.length; i < referencesLength; i+=2) { PsiReference reference = references[i]; if (namespace.equals(getNamespaceFromReference(reference))) { if (i + 1 < references...
getLocationReferences
301,535
String (PsiReference reference) { return reference.getRangeInElement().substring(reference.getElement().getText()); }
getNamespaceFromReference
301,536
boolean () { return true; }
isEnabledByDefault
301,537
String () { return "XmlUnusedNamespaceDeclaration"; }
getShortName
301,538
String () { return getFamilyName(); }
getName
301,539
String () { return XmlAnalysisBundle.message("xml.quickfix.remove.unused.namespace.decl"); }
getFamilyName
301,540
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { doFix(project, descriptor, true); }
applyFix
301,541
SmartPsiElementPointer<XmlTag> (Project project, ProblemDescriptor descriptor, boolean reformat) { PsiElement element = descriptor.getPsiElement(); if (element instanceof XmlAttributeValue) { element = element.getParent(); } else if (!(element instanceof XmlAttribute)) { return null; } XmlAttribute attribute = (XmlAttr...
doFix
301,542
void (Project project, SmartPsiElementPointer<? extends XmlTag> pointer) { PsiDocumentManager manager = PsiDocumentManager.getInstance(project); PsiFile file = pointer.getContainingFile(); assert file != null; Document document = file.getViewProvider().getDocument(); assert document != null; manager.commitDocument(docu...
reformatStartTag
301,543
void (Project project, XmlAttribute attribute, XmlTag parent) { if (!attribute.isNamespaceDeclaration()) { SchemaPrefix schemaPrefix = DefaultXmlExtension.DEFAULT_EXTENSION.getPrefixDeclaration(parent, myPrefix); if (schemaPrefix != null) { attribute = schemaPrefix.getDeclaration(); } else { // declaration was already ...
doRemove
301,544
void (PsiReference ref) { PsiElement element = ref.getElement(); PsiFile file = element.getContainingFile(); TextRange range = ref.getRangeInElement().shiftRight(element.getTextRange().getStartOffset()); Document document = file.getViewProvider().getDocument(); assert document != null; PsiDocumentManager.getInstance(fi...
removeReferenceText
301,545
boolean (Object obj) { return obj instanceof RemoveNamespaceDeclarationFix && Objects.equals(myPrefix, ((RemoveNamespaceDeclarationFix)obj).myPrefix) && (myLocationFix || ((RemoveNamespaceDeclarationFix)obj).myLocationFix); }
equals
301,546
int () { return myPrefix == null ? 0 : myPrefix.hashCode(); }
hashCode
301,547
String () { return XmlAnalysisBundle.message("xml.intention.remove.unused.namespace.location"); }
getName
301,548
void (Project project, XmlAttribute attribute, XmlTag parent) { if (StringUtil.isEmpty(myPrefix)) { attribute.delete(); } else { XmlAttributeValue value = attribute.getValueElement(); if (value == null) { return; } PsiReference[] references = getLocationReferences(myPrefix, value); removeReferencesOrAttribute(reference...
doRemove
301,549
boolean (Object obj) { return this == obj; }
equals
301,550
PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { Pattern pattern = Pattern.compile(regexp); return new XmlElementVisitor() { @Override public void visitXmlTag(@NotNull XmlTag tag) { if (checkDeprecated(tag.getDescriptor(), pattern)) { ASTNode nameNode = XmlChildRole.START_TAG_NAME_FINDER.findChi...
buildVisitor
301,551
void (@NotNull XmlTag tag) { if (checkDeprecated(tag.getDescriptor(), pattern)) { ASTNode nameNode = XmlChildRole.START_TAG_NAME_FINDER.findChild(tag.getNode()); if (nameNode != null) { holder.registerProblem(nameNode.getPsi(), XmlAnalysisBundle.message("xml.inspections.the.tag.is.marked.as.deprecated"), ProblemHighlig...
visitXmlTag
301,552
void (@NotNull XmlAttribute attribute) { if (checkDeprecated(attribute.getDescriptor(), pattern)) { holder.registerProblem(attribute.getNameElement(), XmlAnalysisBundle.message( "xml.inspections.the.attribute.is.marked.as.deprecated"), ProblemHighlightType.LIKE_DEPRECATED); } }
visitXmlAttribute
301,553
OptPane () { return pane( string("regexp", XmlAnalysisBundle.message("xml.options.label.regexp"), 30, new RegexValidator()) ); }
getOptionsPane
301,554
boolean (@Nullable PsiMetaData metaData, Pattern pattern) { if (metaData == null) return false; if (metaData instanceof XmlDeprecationOwnerDescriptor) { return ((XmlDeprecationOwnerDescriptor)metaData).isDeprecated(); } PsiElement declaration = metaData.getDeclaration(); if (!(declaration instanceof XmlTag tag)) return...
checkDeprecated
301,555
boolean (XmlTag tag, Pattern pattern) { if (tag == null) return false; if ("documentation".equals(tag.getLocalName())) { String text = tag.getValue().getTrimmedText(); return pattern.matcher(text).matches(); } for (XmlTag subTag : tag.getSubTags()) { if (checkTag(subTag, pattern)) return true; } return false; }
checkTag
301,556
PsiElementVisitor (@NotNull final ProblemsHolder holder, final boolean isOnTheFly) { return new XmlElementVisitor() { private Boolean isXml; private boolean isXmlFile(XmlElement element) { if (isXml == null) { final PsiFile file = element.getContainingFile(); isXml = file instanceof XmlFile && !InjectedLanguageManager....
buildVisitor
301,557
boolean (XmlElement element) { if (isXml == null) { final PsiFile file = element.getContainingFile(); isXml = file instanceof XmlFile && !InjectedLanguageManager.getInstance(element.getProject()).isInjectedFragment(file); } return isXml.booleanValue(); }
isXmlFile
301,558
void (final @NotNull XmlToken token) { if (isXmlFile(token) && token.getTokenType() == XmlTokenType.XML_NAME) { PsiElement element = token.getPrevSibling(); while(element instanceof PsiWhiteSpace) element = element.getPrevSibling(); if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.X...
visitXmlToken
301,559
void (final @NotNull XmlAttribute attribute) { if (!isXmlFile(attribute)) { return; } final String namespace = attribute.getNamespace(); if (attribute.isNamespaceDeclaration() || XmlUtil.XML_SCHEMA_INSTANCE_URI.equals(namespace)) { return; } XmlTag tag = attribute.getParent(); if (tag == null) return; XmlElementDescrip...
visitXmlAttribute
301,560
void (@NotNull XmlAttributeValue value) { PsiReference[] references = value.getReferences(); for (PsiReference reference : references) { if (reference instanceof SchemaPrefixReference) { if (!XML.equals(((SchemaPrefixReference)reference).getNamespacePrefix()) && reference.resolve() == null) { holder.registerProblem(ref...
visitXmlAttributeValue
301,561
void (final XmlElement element, final XmlTag context, String namespacePrefix, final XmlToken token, final ProblemsHolder holder, boolean isOnTheFly) { if (namespacePrefix.isEmpty() && (!(element instanceof XmlTag) || !(element.getParent() instanceof XmlDocument)) || XML.equals(namespacePrefix)) { return; } final String...
checkUnboundNamespacePrefix
301,562
void (final XmlElement element, final @InspectionMessage String localizedMessage, final TextRange range, final ProblemHighlightType highlightType, final LocalQuickFix fix, final ProblemsHolder holder) { XmlToken nameToken = XmlTagUtil.getStartTagNameElement((XmlTag)element); if (nameToken != null) { holder.registerProb...
reportTagProblem
301,563
boolean () { return true; }
isEnabledByDefault
301,564
String () { return "XmlUnboundNsPrefix"; }
getShortName
301,565
PsiElement (PsiElement element) { if (element instanceof XmlTag tag) { XmlAttribute attribute = tag.getAttribute(IdReferenceProvider.ID_ATTR_NAME, null); if (!myIdAttrsOnly) { if (attribute == null) { attribute = tag.getAttribute(IdReferenceProvider.NAME_ATTR_NAME, null); } if (attribute == null) { attribute = tag.getA...
getIdValueElement
301,566
String (final PsiElement element) { if (element instanceof XmlTag tag) { String s = tag.getAttributeValue(IdReferenceProvider.ID_ATTR_NAME); if (!myIdAttrsOnly) { if (s == null) s = tag.getAttributeValue(IdReferenceProvider.NAME_ATTR_NAME); if (s == null) s = tag.getAttributeValue(IdReferenceProvider.STYLE_ID_ATTR_NAME...
getIdValue
301,567
XmlAttribute (@NotNull XmlTag tag) { for (ImplicitIdRefProvider idRefProvider : ImplicitIdRefProvider.EXTENSION_POINT_NAME.getExtensionList()) { XmlAttribute value = idRefProvider.getIdRefAttribute(tag); if (value != null) return value; } return null; }
getImplicitIdRefAttr
301,568
XmlAttributeValue (@NotNull XmlTag tag) { for (ImplicitIdRefProvider idRefProvider : ImplicitIdRefProvider.EXTENSION_POINT_NAME.getExtensionList()) { XmlAttribute value = idRefProvider.getIdRefAttribute(tag); if (value != null) return value.getValueElement(); } return null; }
getImplicitIdRefValueElement
301,569
String (@NotNull XmlTag tag) { XmlAttributeValue attribute = getImplicitIdRefValueElement(tag); return attribute != null ? attribute.getValue() : null; }
getImplicitIdRefValue
301,570
boolean (final XmlTag subTag) { return subTag.getAttributeValue(IdReferenceProvider.ID_ATTR_NAME) != null || subTag.getAttributeValue(IdReferenceProvider.FOR_ATTR_NAME) != null || getImplicitIdRefValue(subTag) != null || (subTag.getAttributeValue(IdReferenceProvider.NAME_ATTR_NAME) != null && !subTag.getName().contains...
isAcceptableTagType
301,571
List<PsiElement> (PsiFile file) { final List<PsiElement> result = new ArrayList<>(); file.accept(new XmlRecursiveElementVisitor(true) { @Override public void visitXmlTag(@NotNull XmlTag tag) { if (isAcceptableTagType(tag)) result.add(tag); super.visitXmlTag(tag); } @Override public void visitComment(@NotNull final PsiC...
doCompute
301,572
void (@NotNull XmlTag tag) { if (isAcceptableTagType(tag)) result.add(tag); super.visitXmlTag(tag); }
visitXmlTag
301,573
void (@NotNull final PsiComment comment) { if (isDeclarationComment(comment)) result.add(comment); super.visitComment(comment); }
visitComment
301,574
void (final @NotNull XmlComment comment) { if (isDeclarationComment(comment)) result.add(comment); super.visitComment(comment); }
visitXmlComment
301,575
Key<CachedValue<List<PsiElement>>> () { return ourCachedIdsValueKey; }
getKey
301,576
boolean (@NotNull final PsiComment comment) { return comment.getText().contains("@declare id="); }
isDeclarationComment
301,577
String (@NotNull final PsiComment comment) { return XmlDeclareIdInCommentAction.getImplicitlyDeclaredId(comment); }
getImplicitIdValue
301,578
void (PsiElementProcessor<? super PsiElement> processor) { final PsiFile psiFile = getElement().getContainingFile(); process(processor, psiFile); }
process
301,579
void (final PsiElementProcessor<? super PsiElement> processor, PsiFile file) { for (PsiElement e : ourCachedIdsCache.compute(file)) { if (!processor.execute(e)) return; } }
process
301,580
PsiElement () { final PsiElement[] result = new PsiElement[1]; process(new PsiElementProcessor<>() { final String canonicalText = getCanonicalText(); @Override public boolean execute(@NotNull final PsiElement element) { final String idValue = getIdValue(element); if (idValue != null && idValue.equals(canonicalText)) { ...
resolve
301,581
boolean (@NotNull final PsiElement element) { final String idValue = getIdValue(element); if (idValue != null && idValue.equals(canonicalText)) { result[0] = getIdValueElement(element); return false; } return true; }
execute
301,582
boolean (@NotNull final PsiElement element) { String value = getIdValue(element); if (value != null) { result.add(value); } return true; }
execute
301,583
boolean () { return false; }
isSoft
301,584
String[] () { return new String[]{FOR_ATTR_NAME, ID_ATTR_NAME, NAME_ATTR_NAME,STYLE_ID_ATTR_NAME}; }
getIdForAttributeNames
301,585
ElementFilter () { return new ElementFilter() { @Override public boolean isAcceptable(Object element, PsiElement context) { final PsiElement grandParent = ((PsiElement)element).getParent().getParent(); if (grandParent instanceof XmlTag tag) { if (!tag.getNamespacePrefix().isEmpty()) { return true; } } return false; } @...
getIdForFilter
301,586
boolean (Object element, PsiElement context) { final PsiElement grandParent = ((PsiElement)element).getParent().getParent(); if (grandParent instanceof XmlTag tag) { if (!tag.getNamespacePrefix().isEmpty()) { return true; } } return false; }
isAcceptable
301,587
boolean (Class hintClass) { return true; }
isClassAcceptable
301,588
boolean () { final XmlAttributeDescriptor descriptor = ((XmlAttribute)parentElement).getDescriptor(); return descriptor != null && !descriptor.hasIdRefType(); }
isSoft
301,589
boolean (@NotNull PsiElement element) { for (PsiElement child = element.getFirstChild(); child != null; child = child.getNextSibling()) { if (child instanceof OuterLanguageElement) { return true; } } return false; }
hasOuterLanguageElement
301,590
boolean () { return mySoft; }
isSoft
301,591
CachedValue<XmlRefCountHolder> (final XmlFile file, final Object p) { return CachedValuesManager.getManager(file.getProject()).createCachedValue(() -> { final XmlRefCountHolder holder = new XmlRefCountHolder(); final Language language = file.getViewProvider().getBaseLanguage(); final PsiFile psiFile = file.getViewProvi...
compute
301,592
XmlRefCountHolder (@NotNull XmlFile file) { return CACHE.get(xmlRefCountHolderKey, file, null).getValue(); }
getRefCountHolder
301,593
boolean (@NotNull final XmlAttributeValue value) { return myPossiblyDuplicateIds.contains(value); }
isDuplicateIdAttributeValue
301,594
boolean (@Nullable final PsiElement element) { return !myDoNotValidateParentsList.contains(element); }
isValidatable
301,595
boolean (@NotNull final String idRef) { return myId2AttributeListMap.get(idRef) != null || myAdditionallyDeclaredIds.contains(idRef); }
hasIdDeclaration
301,596
boolean (@NotNull final XmlAttributeValue value) { return myIdReferences.contains(value); }
isIdReferenceValue
301,597
void (@NotNull final String id, @NotNull final XmlAttributeValue attributeValue, final boolean soft) { List<Pair<XmlAttributeValue, Boolean>> list = myId2AttributeListMap.get(id); if (list == null) { list = new ArrayList<>(); myId2AttributeListMap.put(id, list); } else if (!soft) { final boolean html = HtmlUtil.isHtmlF...
registerId
301,598
void (@NotNull final String id) { myAdditionallyDeclaredIds.add(id); }
registerAdditionalId
301,599
void (@NotNull final XmlAttributeValue value) { myIdReferences.add(value); }
registerIdReference