Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
298,600 | void (final String url, final String location, Disposable disposable) { Application app = ApplicationManager.getApplication(); app.runWriteAction(() -> getInstance().addResource(url, location)); Disposer.register(disposable, () -> app.runWriteAction(() -> getInstance().removeResource(url))); } | registerResourceTemporarily |
298,601 | boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Resource resource = (Resource)o; if (myClassLoader != resource.myClassLoader) return false; if (myClass != resource.myClass) return false; if (myFile != null ? !myFile.equals(resource.myFile) : resource.myFile != null) return false; return true; } | equals |
298,602 | int () { return myFile.hashCode(); } | hashCode |
298,603 | String () { return myFile + " for " + myClassLoader; } | toString |
298,604 | ExternalResourceManagerEx () { return (ExternalResourceManagerEx)getInstance(); } | getInstanceEx |
298,605 | void (ResourceRegistrar registrar) { ResourceRegistrarImpl impl = (ResourceRegistrarImpl)registrar; impl.addInternalResource(XmlUtil.XSLT_URI, "xslt-1_0.xsd"); impl.addInternalResource(XmlUtil.XSLT_URI, "2.0", "xslt-2_0.xsd"); impl.addInternalResource(XmlUtil.XINCLUDE_URI, "xinclude.xsd"); impl.addInternalResource(XmlUtil.XML_SCHEMA_URI, "XMLSchema.xsd"); impl.addInternalResource(XmlUtil.XML_SCHEMA_URI + ".xsd", "XMLSchema.xsd"); impl.addInternalResource("http://www.w3.org/2001/XMLSchema.dtd", "XMLSchema.dtd"); impl.addInternalResource(XmlUtil.XML_SCHEMA_INSTANCE_URI, "XMLSchema-instance.xsd"); impl.addInternalResource(XmlUtil.XML_SCHEMA_VERSIONING_URI, "XMLSchema-versioning.xsd"); impl.addInternalResource("http://www.w3.org/2001/xml.xsd", "xml.xsd"); impl.addInternalResource(XmlUtil.XML_NAMESPACE_URI, "xml.xsd"); impl.addInternalResource(XmlUtil.XHTML_URI, "xhtml1-transitional.xsd"); impl.addInternalResource("http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd", "xhtml1-strict.xsd"); impl.addInternalResource("http://www.w3.org/TR/html4/strict.dtd", "xhtml1-strict.dtd"); impl.addInternalResource(XmlUtil.HTML4_LOOSE_URI, "xhtml1-transitional.dtd"); impl.addInternalResource("http://www.w3.org/TR/html4/frameset.dtd", "xhtml1-frameset.dtd"); impl.addInternalResource("http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd", "xhtml1-strict.dtd"); impl.addInternalResource("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", "xhtml1-transitional.dtd"); impl.addInternalResource("http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd", "xhtml1-frameset.dtd"); impl.addInternalResource("http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd", "xhtml11/xhtml11.dtd"); impl.addInternalResource("urn:oasis:names:tc:entity:xmlns:xml:catalog", "catalog.xsd"); // Enterprise Plugin Repository impl.addInternalResource("http://plugins.intellij.net/plugin-repository.dtd", "plugin-repository.dtd"); // mobile impl.addInternalResource("http://www.wapforum.org/DTD/xhtml-mobile10.dtd", "xhtml-mobile/xhtml-mobile10.dtd"); impl.addInternalResource("http://www.wapforum.org/DTD/xhtml-mobile10-flat.dtd", "xhtml-mobile/xhtml-mobile10-flat.dtd"); impl.addInternalResource("http://www.wapforum.org/DTD/xhtml-mobile12.dtd", "xhtml-mobile/xhtml-mobile12.dtd"); impl.addInternalResource("http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd", "xhtml-mobile/xhtml-mobile12.dtd"); impl.addInternalResource("http://www.w3.org/1999/xlink", "xlink.dtd"); } | registerResources |
298,606 | CatalogManager () { return myManager; } | getManager |
298,607 | XmlFoldingSettings () { return ApplicationManager.getApplication().getService(XmlFoldingSettings.class); } | getInstance |
298,608 | boolean () { return myState.COLLAPSE_XML_TAGS; } | isCollapseXmlTags |
298,609 | boolean () { return myState.COLLAPSE_HTML_STYLE_ATTRIBUTE; } | isCollapseHtmlStyleAttribute |
298,610 | boolean () { return myState.COLLAPSE_ENTITIES; } | isCollapseEntities |
298,611 | boolean () { return myState.COLLAPSE_DATA_URI; } | isCollapseDataUri |
298,612 | State () { return myState; } | getState |
298,613 | void (@NotNull State state) { XmlSerializerUtil.copyBean(state, myState); } | loadState |
298,614 | boolean (final @NotNull PsiElement element) { return element instanceof XmlAttributeValue || element instanceof XmlTag || element instanceof XmlElementDecl || element instanceof XmlComment; // e.g. <!--@elvariable name="xxx" type="yyy"--> } | isReadWriteAccessible |
298,615 | boolean (final @NotNull PsiElement element) { return false; } | isDeclarationWriteAccess |
298,616 | Access (final @NotNull PsiElement referencedElement, final @NotNull PsiReference reference) { PsiElement refElement = reference.getElement(); return refElement instanceof XmlAttributeValue && (!(referencedElement instanceof XmlTag) || refElement.getParent().getParent() == referencedElement) || refElement instanceof XmlElementDecl || refElement instanceof XmlComment // e.g. <!--@elvariable name="xxx" type="yyy"--> ? Access.Write : Access.Read; } | getReferenceAccess |
298,617 | Access (final @NotNull PsiElement expression) { return expression instanceof XmlAttributeValue ? Access.Write : Access.Read; } | getExpressionAccess |
298,618 | XmlAttribute (@NotNull String name, @NotNull String quotedValue, @NotNull FileType fileType) { final XmlDocument document = createXmlDocument("<tag " + name + "=" + quotedValue + "/>", "dummy." + fileType.getDefaultExtension(), fileType); XmlTag tag = document.getRootTag(); assert tag != null; XmlAttribute[] attributes = tag.getAttributes(); LOG.assertTrue(attributes.length == 1, document.getText()); return attributes[0]; } | createAttribute |
298,619 | String (@NotNull String value, @Nullable Character quoteStyle) { if (quoteStyle != null) { if (quoteStyle == '\'') { return quoteStyle + StringUtil.replace(value, "'", "'") + quoteStyle; } else if (quoteStyle == '"') { return quoteStyle + StringUtil.replace(value, "\"", """) + quoteStyle; } } return quoteValue(value); } | quoteValue |
298,620 | String (@NotNull String value) { final char quoteChar; if (!value.contains("\"")) { quoteChar = '"'; } else if (!value.contains("'")) { quoteChar = '\''; } else { quoteChar = '"'; value = StringUtil.replace(value, "\"", """); } return quoteChar + value + quoteChar; } | quoteValue |
298,621 | XmlDocument (final @NonNls CharSequence text, final @NonNls String fileName, FileType fileType) { PsiFile fileFromText = PsiFileFactory.getInstance(myProject).createFileFromText(fileName, fileType, text); XmlFile xmlFile; if (fileFromText instanceof XmlFile) { xmlFile = (XmlFile)fileFromText; } else { xmlFile = (XmlFile)fileFromText.getViewProvider().getPsi(((LanguageFileType)fileType).getLanguage()); assert xmlFile != null; } XmlDocument document = xmlFile.getDocument(); assert document != null; return document; } | createXmlDocument |
298,622 | FileType (@Nullable PsiElement context) { if (context == null) { return XmlFileType.INSTANCE; } if (context.getLanguage().isKindOf(HTMLLanguage.INSTANCE)) { return getFileType(context.getLanguage()); } return PsiTreeUtil.getParentOfType(context, XmlTag.class, false) instanceof HtmlTag ? HtmlFileType.INSTANCE : XmlFileType.INSTANCE; } | getFileType |
298,623 | FileType (@NotNull Language language) { assert language instanceof XMLLanguage : "Tag can be created only for xml language"; FileType type = language.getAssociatedFileType(); return type == null ? XmlFileType.INSTANCE : type; } | getFileType |
298,624 | boolean (Class hintClass) { return true; } | isClassAcceptable |
298,625 | boolean (Object element, PsiElement context) { if(element != null) { String text = getTextByElement(element); for (final String value : myValue) { if (value == null || value.equals(text)) { return true; } } } return false; } | isAcceptable |
298,626 | String () { String ret = "("; for(int i = 0; i < myValue.length; i++){ ret += myValue[i]; if(i < myValue.length - 1){ ret += " | "; } } ret += ")"; return ret; } | toString |
298,627 | String (Object element) { String elementValue = null; if(element instanceof PsiNamedElement){ if (element instanceof XmlTag) { elementValue = ((XmlTag)element).getLocalName(); } else { elementValue = ((PsiNamedElement)element).getName(); } } else if (element instanceof PsiElement) { elementValue = ((PsiElement) element).getText(); } return elementValue; } | getTextByElement |
298,628 | boolean (Object element, PsiElement context) { if(element != null) { for (final String value : myValue) { if (value == null) { return true; } String elementValue = getTextByElement(element); if (elementValue == null) return false; if (elementValue.contains(value)) return true; } } return false; } | isAcceptable |
298,629 | boolean (Object element, PsiElement context) { return element instanceof XmlTag; } | isAcceptable |
298,630 | boolean (Class hintClass) { return true; } | isClassAcceptable |
298,631 | boolean (Class hintClass) { return ReflectionUtil.isAssignable(XmlToken.class, hintClass); } | isClassAcceptable |
298,632 | boolean (Object element, PsiElement context) { if(element instanceof PsiElement) { final ASTNode node = ((PsiElement)element).getNode(); return node != null && node.getElementType() == myType; } else if(element instanceof ASTNode){ return ((ASTNode)element).getElementType() == myType; } return false; } | isAcceptable |
298,633 | String () { return "token-type(" + myType + ")"; } | toString |
298,634 | boolean (Object element, PsiElement scope) { if (!(element instanceof XmlDocument)) return false; final XmlTag rootTag = ((XmlDocument)element).getRootTag(); if(rootTag == null) return false; return getFilter().isAcceptable(rootTag, (PsiElement)element); } | isAcceptable |
298,635 | String () { return "roottag(" + getFilter().toString() + ")"; } | toString |
298,636 | boolean (Class hintClass) { return ReflectionUtil.isAssignable(XmlTag.class, hintClass) || ReflectionUtil.isAssignable(XmlDocument.class, hintClass); } | isClassAcceptable |
298,637 | boolean (Object element, PsiElement context) { if(element instanceof XmlTag){ final String attributeValue = ((XmlTag)element).getAttributeValue("targetNamespace"); if(attributeValue != null){ for (String aMyValue : myValue) { if (aMyValue.equals(attributeValue)) return true; } } } else if(element instanceof XmlDocument){ return isAcceptable(((XmlDocument) element).getRootTag(), context); } return false; } | isAcceptable |
298,638 | void (String name, String value, final Map<String, String> attributesValueMap) { name = StringUtil.toLowerCase(name); super.cacheOneAttributeValue(name, value, attributesValueMap); } | cacheOneAttributeValue |
298,639 | String (String namespace) { if (XmlUtil.HTML_URI.equals(namespace)) namespace = XmlUtil.XHTML_URI; return super.getPrefixByNamespace(namespace); } | getPrefixByNamespace |
298,640 | String (String qname) { qname = StringUtil.toLowerCase(qname); return super.getAttributeValue(qname); } | getAttributeValue |
298,641 | String (String name, String namespace) { name = StringUtil.toLowerCase(name); return super.getAttributeValue(name, namespace); } | getAttributeValue |
298,642 | String (String prefix) { final String xmlNamespace = super.getNamespaceByPrefix(prefix); if (!prefix.isEmpty()) { return xmlNamespace; } if (xmlNamespace.isEmpty() || xmlNamespace.equals(XmlUtil.XHTML_URI)) { return XmlUtil.HTML_URI; } // ex.: mathML and SVG namespaces can be used inside html file return xmlNamespace; } | getNamespaceByPrefix |
298,643 | boolean (@NotNull PsiElement host) { return parseConditionalCommentBoundaries(host) != null; } | isConditionalComment |
298,644 | void (final @NotNull MultiHostRegistrar registrar, final @NotNull PsiElement host) { Pair<ASTNode, ASTNode> pair = parseConditionalCommentBoundaries(host); if (pair == null) { return; } final TextRange textRange = host.getTextRange(); final int startOffset = textRange.getStartOffset(); Language language = host.getParent().getLanguage(); ASTNode conditionalStart = pair.first; ASTNode conditionalEnd = pair.second; TextRange range = new UnfairTextRange(conditionalStart.getTextRange().getEndOffset() - startOffset, conditionalEnd.getStartOffset() - startOffset); if (range.getStartOffset() < range.getEndOffset()) { ASTNode current = conditionalStart.getTreeNext(); List<TextRange> injectionsRanges = new ArrayList<>(); while (current != conditionalEnd) { if (!(current.getPsi() instanceof OuterLanguageElement)) { injectionsRanges.add(current.getTextRange().shiftLeft(startOffset)); } current = current.getTreeNext(); } if (!injectionsRanges.isEmpty()) { registrar.startInjecting(language); for (TextRange injectionsRange : injectionsRanges) { registrar.addPlace(null, null, (PsiLanguageInjectionHost)host, injectionsRange); } registrar.doneInjecting(); } } } | getLanguagesToInject |
298,645 | boolean () { return false; } | isCaseSensitive |
298,646 | String () { return "HtmlTag:" + getName(); } | toString |
298,647 | XmlTag () { return PsiTreeUtil.getParentOfType(this, XmlTag.class); } | getParentTag |
298,648 | XmlTagDelegate () { return new HtmlTagImplDelegate(); } | createDelegate |
298,649 | void (@NotNull ASTNode child) { HtmlTagImpl.this.deleteChildInternalSuper(child); } | deleteChildInternalSuper |
298,650 | TreeElement (TreeElement first, ASTNode last, @Nullable ASTNode anchor, @Nullable Boolean before) { return HtmlTagImpl.this.addInternalSuper(first, last, anchor, before); } | addInternalSuper |
298,651 | String () { return "HtmlRawText"; } | toString |
298,652 | boolean (PsiElementProcessor processor, PsiElement place) { return XmlPsiUtil.processXmlElements(this, processor, false); } | processElements |
298,653 | boolean () { return true; } | skipValidation |
298,654 | XmlTag () { return PsiTreeUtil.findChildOfType(this, XmlTag.class); } | getRootTag |
298,655 | HtmlStubBasedTagImpl (@NotNull XmlTagStubImpl stub) { return new HtmlStubBasedTagImpl(stub, this); } | createPsi |
298,656 | HtmlStubBasedTagImpl (@NotNull ASTNode node) { return new HtmlStubBasedTagImpl(node); } | createPsi |
298,657 | XmlTagStubImpl (@NotNull HtmlStubBasedTagImpl psi, StubElement parentStub) { return new XmlTagStubImpl(psi, parentStub, this); } | createStub |
298,658 | String () { return "HtmlFile:" + getName(); } | toString |
298,659 | XmlDocument () { CompositeElement treeElement = calcTreeElement(); ASTNode node = treeElement.findChildByType(XmlElementType.HTML_DOCUMENT); return node != null ? (XmlDocument)node.getPsi() : null; } | getDocument |
298,660 | Collection<Object> (@NotNull FileReference reference) { return Collections.emptyList(); } | getVariants |
298,661 | XmlTag () { final PsiElement parent = getParent(); if (parent instanceof XmlTag) return (XmlTag)parent; return null; } | getParentTag |
298,662 | XmlTagChild () { PsiElement nextSibling = getNextSibling(); if (nextSibling instanceof XmlTagChild) return (XmlTagChild)nextSibling; return null; } | getNextSiblingInTag |
298,663 | XmlTagChild () { final PsiElement prevSibling = getPrevSibling(); if (prevSibling instanceof XmlTagChild) return (XmlTagChild)prevSibling; return null; } | getPrevSiblingInTag |
298,664 | boolean (PsiElementProcessor processor, PsiElement place) { // TODO return true; } | processElements |
298,665 | String () { String s = super.toString(); final IElementType type = getNode().getElementType(); if (type != XmlElementType.HTML_EMBEDDED_CONTENT) s += ":" + type; return s; } | toString |
298,666 | boolean () { return false; } | isCaseSensitive |
298,667 | String () { return "HtmlTag:" + getName(); } | toString |
298,668 | XmlTag () { return PsiTreeUtil.getParentOfType(this, XmlTag.class); } | getParentTag |
298,669 | XmlTagDelegate () { return new HtmlStubBasedTagImplDelegate(); } | createDelegate |
298,670 | void (@NotNull ASTNode child) { HtmlStubBasedTagImpl.this.deleteChildInternalSuper(child); } | deleteChildInternalSuper |
298,671 | TreeElement (TreeElement first, ASTNode last, @Nullable ASTNode anchor, @Nullable Boolean before) { return HtmlStubBasedTagImpl.this.addInternalSuper(first, last, anchor, before); } | addInternalSuper |
298,672 | void (XmlFile element) { element.putUserData(CachedScriptTagsKey,null); } | clearCaches |
298,673 | boolean (final XmlFile element, PsiScopeProcessor processor, ResolveState state, PsiElement lastParent, PsiElement place) { CachedValue<XmlTag[]> myCachedScriptTags = element.getUserData(CachedScriptTagsKey); if (myCachedScriptTags == null) { myCachedScriptTags = CachedValuesManager.getManager(element.getProject()) .createCachedValue(() -> { final List<XmlTag> scriptTags = new ArrayList<>(); final XmlDocument document = HtmlPsiUtil.getRealXmlDocument(element.getDocument()); if (document != null) { PsiElementProcessor psiElementProcessor = new PsiElementProcessor() { @Override public boolean execute(final @NotNull PsiElement element1) { if (element1 instanceof XmlTag tag) { if (HtmlUtil.SCRIPT_TAG_NAME.equalsIgnoreCase(tag.getName())) { final XmlElementDescriptor descriptor = tag.getDescriptor(); if (descriptor != null && HtmlUtil.SCRIPT_TAG_NAME.equals(descriptor.getName())) { scriptTags.add(tag); } } } return true; } }; XmlPsiUtil.processXmlElements(document, psiElementProcessor, true); } return new CachedValueProvider.Result<>(scriptTags.toArray(XmlTag.EMPTY), element); }, false); element.putUserData(CachedScriptTagsKey, myCachedScriptTags); } if (ProcessingDeclarationsFlag.get() != null) return true; try { ProcessingDeclarationsFlag.set(""); for (XmlTag tag : myCachedScriptTags.getValue()) { final XmlTagChild[] children = tag.getValue().getChildren(); for (XmlTagChild child : children) { if (!child.processDeclarations(processor, state, null, place)) return false; } if (tag.getAttributeValue("src") != null) { final XmlAttribute attribute = tag.getAttribute("src", null); if (attribute != null) { final PsiFile psiFile = FileReferenceUtil.findFile(attribute.getValueElement()); if (psiFile != null && psiFile.isValid()) { if (!psiFile.processDeclarations(processor, state, null, place)) { return false; } } } } } } finally { ProcessingDeclarationsFlag.set(null); } return true; } | processDeclarations |
298,674 | boolean (final @NotNull PsiElement element1) { if (element1 instanceof XmlTag tag) { if (HtmlUtil.SCRIPT_TAG_NAME.equalsIgnoreCase(tag.getName())) { final XmlElementDescriptor descriptor = tag.getDescriptor(); if (descriptor != null && HtmlUtil.SCRIPT_TAG_NAME.equals(descriptor.getName())) { scriptTags.add(tag); } } } return true; } | execute |
298,675 | IElementType () { return XmlElementType.HTML_EMBEDDED_CONTENT; } | getScriptElementType |
298,676 | void (final Map<String, HtmlElementDescriptorImpl> map, final HtmlNSDescriptorImpl htmlNSDescriptor) { htmlNSDescriptor.myCachedDecls = map; } | putValue |
298,677 | HtmlElementDescriptorImpl (XmlElementDescriptor element) { return new HtmlElementDescriptorImpl(element, myRelaxed, myCaseSensitive); } | createHtmlElementDescriptor |
298,678 | XmlElementDescriptor (@NotNull XmlTag tag) { XmlElementDescriptor xmlElementDescriptor = getElementDescriptorByName(tag.getLocalName()); if (xmlElementDescriptor == null && myRelaxed) { xmlElementDescriptor = myDelegate.getElementDescriptor(tag); } return xmlElementDescriptor; } | getElementDescriptor |
298,679 | XmlElementDescriptor (String name) { if (!myCaseSensitive) name = StringUtil.toLowerCase(name); return buildDeclarationMap().get(name); } | getElementDescriptorByName |
298,680 | PsiElement () { return myDelegate == null ? null : myDelegate.getDeclaration(); } | getDeclaration |
298,681 | String (PsiElement context) { return myDelegate == null ? "" : myDelegate.getName(context); } | getName |
298,682 | String () { return myDelegate == null ? "" : myDelegate.getName(); } | getName |
298,683 | void (PsiElement element) { myDelegate.init(element); } | init |
298,684 | TypeDescriptor (@NotNull String name, XmlTag context) { return myDelegate instanceof XmlNSTypeDescriptorProvider ? ((XmlNSTypeDescriptorProvider)myDelegate).getTypeDescriptor(name, context) : null; } | getTypeDescriptor |
298,685 | TypeDescriptor (XmlTag descriptorTag) { return myDelegate instanceof XmlNSTypeDescriptorProvider ? ((XmlNSTypeDescriptorProvider)myDelegate).getTypeDescriptor(descriptorTag) : null; } | getTypeDescriptor |
298,686 | boolean () { return delegate.isRequired(); } | isRequired |
298,687 | boolean () { return delegate.isFixed(); } | isFixed |
298,688 | boolean () { return delegate.hasIdType(); } | hasIdType |
298,689 | boolean () { return delegate.hasIdRefType(); } | hasIdRefType |
298,690 | String () { return delegate.getDefaultValue(); } | getDefaultValue |
298,691 | boolean () { return delegate.isEnumerated(); } | isEnumerated |
298,692 | String[] () { return delegate.getEnumeratedValues(); } | getEnumeratedValues |
298,693 | String (XmlElement context, String value) { if (!myCaseSensitive) value = StringUtil.toLowerCase(value); return delegate.validateValue(context, value); } | validateValue |
298,694 | PsiElement () { return delegate.getDeclaration(); } | getDeclaration |
298,695 | Collection<PsiElement> () { return delegate.getDeclarations(); } | getDeclarations |
298,696 | String (PsiElement context) { return delegate.getName(context); } | getName |
298,697 | String () { return delegate.getName(); } | getName |
298,698 | void (PsiElement element) { delegate.init(element); } | init |
298,699 | String () { return delegate.toString(); } | toString |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.