Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
49,000
boolean (@NotNull XmlTag tag) { final String localName = tag.getLocalName(); return "apply-templates".equals(localName) && isXsltCoreTag(tag); }
isApplyTemplates
49,001
boolean (@NotNull XmlTag tag) { return tag.getAttribute("name", null) != null; }
hasNameAttribute
49,002
boolean (@NotNull XmlAttribute attribute) { return isXsltNameAttribute(attribute) && isTemplateCall(attribute.getParent()); }
isTemplateCallName
49,003
boolean (@NotNull XmlAttribute attribute) { return "name".equals(attribute.getName()) && isXsltAttribute(attribute); }
isXsltNameAttribute
49,004
boolean (@NotNull XmlAttribute attribute) { return isXsltNameAttribute(attribute) && isTemplate(attribute.getParent()); }
isTemplateName
49,005
boolean (@NotNull XmlAttribute attribute) { return isXsltNameAttribute(attribute) && isFunction(attribute.getParent()); }
isFunctionName
49,006
boolean (@NotNull XmlTag element) { return isTemplate(element, true); }
isTemplate
49,007
boolean (@NotNull XmlTag element, boolean requireName) { return "template".equals(element.getLocalName()) && (!requireName || hasNameAttribute(element)) && isXsltCoreTag(element); }
isTemplate
49,008
boolean (@NotNull PsiFile psiFile) { if (psiFile.getFileType() != XmlFileType.INSTANCE) return false; if (!(psiFile instanceof XmlFile)) return false; final XsltChecker.LanguageLevel level = getXsltLanguageLevel(psiFile); return level != XsltChecker.LanguageLevel.NONE; }
isXsltFile
49,009
boolean (@NotNull XmlTag tag) { final String localName = tag.getLocalName(); return ("stylesheet".equals(localName) || "transform".equals(localName)) && isXsltCoreTag(tag); }
isXsltRootTag
49,010
boolean (@NotNull XmlAttribute attribute) { return isXsltNameAttribute(attribute) && isTemplateCallParam(attribute.getParent()); }
isTemplateCallParamName
49,011
boolean (@NotNull XmlTag parent) { return "with-param".equals(parent.getLocalName()) && hasNameAttribute(parent) && isXsltCoreTag(parent); }
isTemplateCallParam
49,012
boolean (XmlTag tag) { XmlTag p = tag; // not really necessary, XSLT doesn't allow literal result elements on top level anyway while ((p = p.getParentTag()) != null) { if (isXsltTag(p)) { return isXsltRootTag(p); } } return false; }
isTopLevelElement
49,013
boolean (XmlAttribute xmlattribute) { if (xmlattribute == null || !isXsltAttribute(xmlattribute)) return false; final String localName = xmlattribute.getParent().getLocalName(); return isIncludeOrImport(localName) && "href".equals(xmlattribute.getName()); }
isIncludeOrImportHref
49,014
boolean (String localName) { // treat import and include the same. right now it doesn't seem necessary to distinguish them return ("import".equals(localName) || "include".equals(localName)); }
isIncludeOrImport
49,015
boolean (XmlTag tag) { if (tag == null) return false; return isIncludeOrImport(tag.getLocalName()) && isXsltCoreTag(tag) && tag.getAttribute("href", null) != null; }
isIncludeOrImport
49,016
boolean (XmlTag tag) { if (tag == null) return false; return "import".equals(tag.getLocalName()) && isXsltCoreTag(tag) && tag.getAttribute("href", null) != null; }
isImport
49,017
PsiElement (@NotNull XmlAttribute attribute) { final XmlAttributeValue valueElement = attribute.getValueElement(); if (valueElement != null) { final PsiElement firstChild = valueElement.getFirstChild(); if (firstChild != null) { final PsiElement nextSibling = firstChild.getNextSibling(); return nextSibling instanceof X...
getAttValueToken
49,018
boolean (XmlAttribute xmlattribute) { if ("mode".equals(xmlattribute.getName())) { final XmlTag parent = xmlattribute.getParent(); return isApplyTemplates(parent) || isTemplate(parent, false); } return false; }
isMode
49,019
boolean (@NotNull XmlAttribute attribute) { if (isXsltAttribute(attribute)) { final String tagName = attribute.getParent().getLocalName(); final Set<String> allowedAttrs = XPATH_AVT_MAP.get(tagName); if (allowedAttrs == null) return isExtensionAvtAttribute(attribute); return allowedAttrs.contains(attribute.getName()); ...
mayBeAVT
49,020
boolean (XmlAttribute attribute) { final String namespace = attribute.getParent().getNamespace(); return namespace.startsWith(XALAN_EXTENSION_PREFIX) && "file".equals(attribute.getName()); }
isExtensionAvtAttribute
49,021
Icon (Icon icon) { return XpathIcons.XsltFiletypeOverlay; }
createXsltIcon
49,022
boolean (QName q1, QName q2) { if (q1 == UNRESOLVED || q2 == UNRESOLVED) return false; if (q1 == ANY || q2 == ANY) return true; if (Comparing.equal(q1, q2)) return true; if (q1 instanceof ExtendedQName) { return q1.getNamespaceURI().equals(q2.getNamespaceURI()); } else if (q2 instanceof ExtendedQName) { return q2.getNa...
equal
49,023
QName (String namespace) { return new ExtendedQName(namespace); }
createAnyLocalName
49,024
boolean (@Nullable XmlTag tag, String namespace) { if (tag == null) return false; if (tag.getLocalNamespaceDeclarations().containsValue(namespace)) return true; return isNamespaceDeclared(tag.getParentTag(), namespace); }
isNamespaceDeclared
49,025
QName (@NotNull String qname, @NotNull PsiElement context) { final String[] strings = qname.split(":", 2); if (strings.length == 1) { return new QName(null, qname); } final XmlElement ctx = PsiTreeUtil.getParentOfType(context, XmlElement.class, false); if (ctx == null) return UNRESOLVED; final String uri = XsltNamespac...
createQName
49,026
QName (@NotNull XmlAttribute attribute) { final String name = attribute.getName(); if (name.indexOf(':') != -1) { return new QName(attribute.getNamespace(), attribute.getLocalName()); } else { return new QName(null, attribute.getLocalName()); } }
createQName
49,027
QName (@NotNull XmlTag tag) { if (isNamespaceDeclared(tag, tag.getNamespace())) { return new QName(tag.getNamespace(), tag.getLocalName(), tag.getNamespacePrefix()); } else { return new QName(null, tag.getLocalName()); } }
createQName
49,028
XmlTag (@NotNull PsiElement location, boolean isExpression, boolean requireName) { PsiElement p = isExpression ? location.getContainingFile().getContext() : location; while ((p = PsiTreeUtil.getParentOfType(p, XmlTag.class)) != null) { final XmlTag _p = ((XmlTag)p); if (XsltSupport.isTemplate(_p, requireName)) return _...
getTemplateTag
49,029
XmlTag (@NotNull PsiElement location, boolean isExpression) { return getTemplateTag(location, isExpression, false); }
getTemplateTag
49,030
XsltTemplate (@NotNull PsiElement location, boolean isExpression) { final XmlTag templateTag = getTemplateTag(location, isExpression); return templateTag != null ? XsltElementFactory.getInstance().wrapElement(templateTag, XsltTemplate.class) : null; }
getTemplate
49,031
PsiElement (@NotNull XmlTag xmlTag) { final PsiElement[] child = new PsiElement[1]; xmlTag.processElements(new PsiElementProcessor() { @Override public boolean execute(@NotNull PsiElement element) { if (element instanceof XmlToken) { if (((XmlToken)element).getTokenType() == XmlTokenType.XML_TAG_END) { child[0] = eleme...
findFirstRealTagChild
49,032
boolean (@NotNull PsiElement element) { if (element instanceof XmlToken) { if (((XmlToken)element).getTokenType() == XmlTokenType.XML_TAG_END) { child[0] = element.getNextSibling(); return false; } } return true; }
execute
49,033
XPathExpression (XsltElement xsltElement, String attributeName) { final XmlAttribute attribute = xsltElement.getTag().getAttribute(attributeName, null); if (attribute != null) { final PsiFile[] files = XsltSupport.getFiles(attribute); if (files.length > 0) { assert files.length == 1 : "Unexpected number of XPathFiles i...
getXPathExpression
49,034
boolean (XPathExpression x1, XPathExpression x2) { if (x1.getType() != x2.getType()) return false; // another hidden and hard-to-find goodie from the dark non-OpenAPI world return PsiEquivalenceUtil.areElementsEquivalent(x1, x2); }
areExpressionsEquivalent
49,035
XmlTag (XmlTag templateTag) { return SyntaxTraverser.psiTraverser(templateTag).filter(XmlTag.class).filter(XsltSupport::isParam).last(); }
findLastParam
49,036
TextRange (XPathElement expr) { final PsiLanguageInjectionHost host = PsiTreeUtil.getContextOfType(expr, PsiLanguageInjectionHost.class, true); assert host != null; final List<Pair<PsiElement,TextRange>> psi = InjectedLanguageManager.getInstance(host.getProject()).getInjectedPsiFiles(host); assert psi != null; for (Pai...
getRangeInsideHostingFile
49,037
TextRange (XPathElement expr) { final PsiLanguageInjectionHost host = PsiTreeUtil.getContextOfType(expr, PsiLanguageInjectionHost.class, true); assert host != null; final List<Pair<PsiElement,TextRange>> psi = InjectedLanguageManager.getInstance(host.getProject()).getInjectedPsiFiles(host); assert psi != null; for (Pai...
getRangeInsideHost
49,038
XmlTag (XmlTag templateTag) { final XmlTag[] lastParam = new XmlTag[1]; templateTag.processElements(new PsiElementProcessor() { @Override public boolean execute(@NotNull PsiElement element) { if (element instanceof XmlTag) { if ("with-param".equals(((XmlTag)element).getLocalName())) { lastParam[0] = (XmlTag)element; } ...
findLastWithParam
49,039
boolean (@NotNull PsiElement element) { if (element instanceof XmlTag) { if ("with-param".equals(((XmlTag)element).getLocalName())) { lastParam[0] = (XmlTag)element; } else { return false; } } return true; }
execute
49,040
XmlTag (final XmlTag currentUsageTag, PsiElement usageBlock, final String referenceName, XmlTag... moreUsages) { // sort tags by document order final Set<XmlTag> usages = new TreeSet<>(POSITION_COMPARATOR); usages.add(currentUsageTag); ContainerUtil.addAll(usages, moreUsages); // collect all other possible unresolved r...
findVariableInsertionPoint
49,041
void (@NotNull PsiElement element) { if (element instanceof XPathVariableReference) { visitXPathVariableReference(((XPathVariableReference)element)); } else { super.visitElement(element); } }
visitElement
49,042
void (XPathVariableReference reference) { if (referenceName.equals(reference.getReferencedName())) { if (reference.resolve() == null) { usages.add(PsiTreeUtil.getContextOfType(reference, XmlTag.class, true)); } } }
visitXPathVariableReference
49,043
void (XmlAttribute attribute) { if (XsltSupport.isXPathAttribute(attribute)) { final PsiFile[] xpathFiles = XsltSupport.getFiles(attribute); for (PsiFile xpathFile : xpathFiles) { xpathFile.accept(this); } } }
visitXmlAttribute
49,044
PsiElement (XPathExpression reference) { final XmlTag template = getTemplateTag(reference, true); final XmlTag tag = PsiTreeUtil.getContextOfType(reference, XmlTag.class, true); assert tag != null; return template != null ? template.getNavigationElement() : tag.getParentTag(); }
getUsageBlock
49,045
XmlDocument (@NotNull XmlElement element) { final XmlDocument document = PsiTreeUtil.getParentOfType(element, XmlDocument.class, false); assert document != null; return document; }
getDocument
49,046
XmlDocument (@NotNull XsltElement element) { return getDocument(element.getTag()); }
getDocument
49,047
XPathType (XmlTag element) { final XmlAttribute typeAttr = element.getAttribute("as"); final XPathType returnType; if (typeAttr != null) { final String value = typeAttr.getValue(); returnType = value != null ? XPath2Type.fromName(QNameUtil.createQName(value, element)) : null; return returnType != null ? returnType : XP...
getDeclaredType
49,048
XmlTag () { return myCall.getTag(); }
getRoot
49,049
boolean () { return false; }
isRecursive
49,050
Result (XmlTag element) { if (element.getLocalName().equals("with-param") && XsltSupport.isXsltTag(element)) { return Result.create(transform(element)); } return null; }
match
49,051
PsiElement (XmlTag element) { return element; }
transform
49,052
boolean () { return myInclude > 0; }
isInclude
49,053
boolean () { return myIsCyclic; }
isCyclic
49,054
boolean (XmlTag tag) { if (myHistory.contains(tag)) { myIsCyclic = true; return false; } myHistory.add(tag); if (XsltSupport.isVariableOrParam(tag)) { processVarOrParam(tag); } else if (XsltSupport.isTemplate(tag, false)) { processTemplate(tag); } else if (XsltSupport.isIncludeOrImport(tag)) { if (XsltSupport.isImport(...
process
49,055
void (XmlTag tag) { }
processTag
49,056
void (PsiFile psiFile, XmlTag place) { final XmlDocument document = ((XmlFile)psiFile).getDocument(); assert document != null; final XmlTag rootTag = document.getRootTag(); assert rootTag != null; myInclude++; try { rootTag.processElements(new PsiElementProcessor() { @Override public boolean execute(@NotNull PsiElement...
processExternalFile
49,057
boolean (@NotNull PsiElement element) { if (element instanceof XmlTag) { return process((XmlTag)element); } return shouldContinue(); }
execute
49,058
long () { return myFile.getModificationStamp() == myRootCount ? myCount : queryCount(); }
getModificationCount
49,059
long () { myNSDecls.clear(); myNSDecls.addAll(getNSDecls(true)); myRootCount = myFile.getModificationStamp(); return ++myCount; }
update
49,060
ArrayList<XmlAttribute> (boolean updateModCount) { final ArrayList<XmlAttribute> list = new ArrayList<>(Arrays.asList(myRootTag.getAttributes())); final Iterator<XmlAttribute> it = list.iterator(); while (it.hasNext()) { final XmlAttribute attribute = it.next(); if (!attribute.isNamespaceDeclaration() || !attribute.isV...
getNSDecls
49,061
boolean (XmlTag element) { if (XsltSupport.isTemplate(element, true)) { final XmlAttribute attribute = element.getAttribute("name", null); if (myName == null || (attribute != null && myName.equals(attribute.getValue()))) { return true; } } return false; }
matches
49,062
Result (XmlTag element) { if (matches(element)) { return Result.create(transform(element)); } return null; }
match
49,063
PsiElement (XmlTag element) { return XsltElementFactory.getInstance().wrapElement(element, XsltElement.class); }
transform
49,064
boolean () { return false; }
isRecursive
49,065
boolean (XmlTag element) { if (super.matches(element) && element.getAttribute("match", null) != null) { final XsltTemplate t = XsltElementFactory.getInstance().wrapElement(element, XsltTemplate.class); final QName mode = t.getMode(); if (mode != null) { if (QNameUtil.equal(myMode, mode)) { return true; } } else { retur...
matches
49,066
boolean (XmlTag element) { return XsltSupport.isTemplate(element, false); }
matches
49,067
boolean (String inputString) { return myNamesValidator.isIdentifier(inputString, myProject); }
checkInput
49,068
boolean (String inputString) { return checkInput(inputString); }
canClose
49,069
XmlTag () { return myRoot; }
getRoot
49,070
boolean (XmlTag tag) { if (isApplicable(tag)) { final XmlAttribute attribute = tag.getAttribute("name", null); if (attribute != null && matches(attribute)) { return true; } } return false; }
matches
49,071
boolean (XmlTag tag) { return XsltSupport.isParam(tag); }
isApplicable
49,072
boolean (XmlAttribute attribute) { final String value = attribute.getValue(); return (myName == null || myName.equals(value)) && !myExcludedNames.contains(value); }
matches
49,073
XmlTag () { return myDocument.getRootTag(); }
getRoot
49,074
Result (XmlTag element) { if (XsltSupport.isIncludeOrImport(element)) { final XmlAttribute href = element.getAttribute("href", null); if (href != null) { final PsiFile psiFile = element.getContainingFile(); assert psiFile != null; PsiFile f = psiFile.getOriginalFile(); if (f == psiFile || f.getVirtualFile() == null) f ...
match
49,075
Result (XmlTag element) { if (matches(element)) { return Result.create(transform(element)); } return null; }
matchImpl
49,076
String () { return XPathBundle.message("intention.family.name.convert.if.to.choose"); }
getFamilyName
49,077
String () { return getFamilyName(); }
getText
49,078
boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!XsltSupport.isXsltFile(file)) return false; final int offset = editor.getCaretModel().getOffset(); final PsiElement element = file.findElementAt(offset); if (element == null) return false; final XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlT...
isAvailable
49,079
boolean () { return true; }
startInWriteAction
49,080
String () { return XPathBundle.message("intention.family.name.add.optional.argument"); }
getFamilyName
49,081
String () { return getFamilyName(); }
getText
49,082
boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!XsltSupport.isXsltFile(file)) return false; final int offset = editor.getCaretModel().getOffset(); final PsiElement element = file.findElementAt(offset); if (element == null) return false; final XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlT...
isAvailableImpl
49,083
boolean (PsiElement element, XmlTag tag, int offset) { final ASTNode node = tag.getNode(); if (node != null) { final ASTNode child = XmlChildRole.START_TAG_NAME_FINDER.findChild(node); if (child != null && child.getTextRange().contains(offset)) { return true; } } // final XmlAttribute att = PsiTreeUtil.getParentOfType(...
isAvailableAt
49,084
String () { return getFamilyName(); }
getText
49,085
String () { return XPathBundle.message("intention.family.name.inline.xsl.attribute"); }
getFamilyName
49,086
boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!XsltSupport.isXsltFile(file)) return false; final int offset = editor.getCaretModel().getOffset(); final PsiElement element = file.findElementAt(offset); final XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class, false); if (tag == null) ...
isAvailable
49,087
XmlTag (XmlTag tag) { XmlTag p = tag.getParentTag(); if (p == null) { return null; } return !XsltSupport.isXsltTag(p) || "element".equals(p.getLocalName()) ? p : null; }
findParent
49,088
boolean () { return true; }
startInWriteAction
49,089
String () { return getFamilyName(); }
getText
49,090
String () { return XPathBundle.message("intention.family.name.replace.with.xsl.attribute"); }
getFamilyName
49,091
boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!XsltSupport.isXsltFile(file)) return false; final int offset = editor.getCaretModel().getOffset(); final PsiElement element = file.findElementAt(offset); final XmlAttribute attr = PsiTreeUtil.getParentOfType(element, XmlAttribute.class, false); if (...
isAvailable
49,092
boolean () { return true; }
startInWriteAction
49,093
FileAssociationsManager (Project project) { return project.getService(FileAssociationsManager.class); }
getInstance
49,094
void () { myTempCopy = true; }
markAsTempCopy
49,095
void (@NotNull Element state) { clear(); final List<Element> children = state.getChildren("file"); VirtualFilePointerManager filePointerManager = VirtualFilePointerManager.getInstance(); for (Element child : children) { final String url = child.getAttributeValue("url"); if (url != null) { final VirtualFilePointer point...
loadState
49,096
void () { clear(); }
noStateLoaded
49,097
TransactionalManager () { return new TempManager(this, myProject); }
getTempManager
49,098
void () { clear(); }
dispose
49,099
void () { final Set<VirtualFilePointer> virtualFilePointers = myAssociations.keySet(); for (VirtualFilePointer pointer : virtualFilePointers) { myAssociations.get(pointer).killAll(); } myAssociations.clear(); }
clear