Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
299,500 | boolean (@NotNull String tagName) { return HTML5_TAGS_SET.contains(tagName); } | isHtml5Tag |
299,501 | boolean (String attributeName) { return attributeName.startsWith(HTML5_DATA_ATTR_PREFIX); } | isCustomHtml5Attribute |
299,502 | boolean (XmlAttributeDescriptor descriptor) { // common html attributes are defined mostly in common.rnc, core-scripting.rnc, etc // while own tag attributes are defined in meta.rnc final PsiElement declaration = descriptor.getDeclaration(); final PsiFile file = declaration != null ? declaration.getContainingFile() : n... | isOwnHtmlAttribute |
299,503 | boolean (@NotNull XmlTag context) { XmlElementDescriptor descriptor = context.getDescriptor(); XmlNSDescriptor nsDescriptor = descriptor != null ? descriptor.getNSDescriptor() : null; return isHtml5Schema(nsDescriptor); } | tagHasHtml5Schema |
299,504 | boolean (@Nullable XmlNSDescriptor nsDescriptor) { XmlFile descriptorFile = nsDescriptor != null ? nsDescriptor.getDescriptorFile() : null; String descriptorPath = descriptorFile != null ? descriptorFile.getVirtualFile().getPath() : null; return Objects.equals(Html5SchemaProvider.getHtml5SchemaLocation(), descriptorPat... | isHtml5Schema |
299,505 | String (@NotNull String line) { if (startsWithTag(line)) { int tagStart = line.indexOf("<"); if (tagStart >= 0) { tagStart++; for (int i = tagStart; i < line.length(); i ++) { char ch = line.charAt(i); if (!(Character.isAlphabetic(ch) || (i > tagStart && (Character.isDigit(ch) || ch == '-' )))) { return line.substring(... | getStartTag |
299,506 | boolean (@NotNull String line) { if (line.trim().startsWith("<")) { return HTML_TAG_PATTERN.matcher(line).matches(); } return false; } | startsWithTag |
299,507 | Charset (@NotNull CharSequence content) { // check for <meta http-equiv="charset=CharsetName" > or <meta charset="CharsetName"> and return Charset // because we will lightly parse and explicit charset isn't used very often do quick check for applicability int charPrefix = StringUtil.indexOf(content, CHARSET); do { if (... | detectCharsetFromMetaTag |
299,508 | String (@NotNull CharSequence content) { final Ref<String> charsetNameRef = new Ref<>(); try { new HtmlBuilderDriver(content).build(new XmlBuilder() { final @NonNls Set<String> inTag = new HashSet<>(); boolean metHttpEquiv; boolean metHtml5Charset; @Override public void doctype(final @Nullable CharSequence publicId, fi... | tryFetchCharsetFromFileContent |
299,509 | void (final @Nullable CharSequence publicId, final @Nullable CharSequence systemId, final int startOffset, final int endOffset) { } | doctype |
299,510 | ProcessingOrder (final CharSequence localName, final String namespace, final int startOffset, final int endOffset, final int headerEndOffset) { @NonNls String name = StringUtil.toLowerCase(localName.toString()); inTag.add(name); if (!inTag.contains("head") && !"html".equals(name)) terminate(); return ProcessingOrder.TA... | startTag |
299,511 | void () { throw TerminateException.INSTANCE; } | terminate |
299,512 | void (final CharSequence localName, final String namespace, final int startoffset, final int endoffset) { final @NonNls String name = StringUtil.toLowerCase(localName.toString()); if ("meta".equals(name) && (metHttpEquiv || metHtml5Charset) && contentAttributeValue != null) { String charsetName; if (metHttpEquiv) { int... | endTag |
299,513 | void (final CharSequence localName, final CharSequence v, final int startoffset, final int endoffset) { final @NonNls String name = StringUtil.toLowerCase(localName.toString()); if (inTag.contains("meta")) { @NonNls String value = StringUtil.toLowerCase(v.toString()); if (name.equals("http-equiv")) { metHttpEquiv |= va... | attribute |
299,514 | void (final CharSequence display, final CharSequence physical, final int startoffset, final int endoffset) { } | textElement |
299,515 | void (final CharSequence ref, final int startOffset, final int endOffset) { } | entityRef |
299,516 | void (@NotNull String message, int startOffset, int endOffset) { } | error |
299,517 | boolean (@NonNls String tagName) { return "br".equalsIgnoreCase(tagName); } | isTagWithoutAttributes |
299,518 | boolean (@NotNull PsiFile file) { return isHtmlFile(file) || file.getViewProvider() instanceof TemplateLanguageFileViewProvider; } | hasHtml |
299,519 | boolean (@NotNull PsiFile file) { return XmlTypedHandlersAdditionalSupport.supportsTypedHandlers(file); } | supportsXmlTypedHandlers |
299,520 | boolean (@NotNull String url) { return url.startsWith("http://") || url.startsWith("https://") || url.startsWith("//") || //Protocol-relative URL url.startsWith("ftp://"); } | hasHtmlPrefix |
299,521 | boolean (@NotNull PsiElement element) { Language language = element.getLanguage(); return language.isKindOf(HTMLLanguage.INSTANCE) || language.isKindOf(XHTMLLanguage.INSTANCE); } | isHtmlFile |
299,522 | boolean (@NotNull VirtualFile file) { FileType fileType = file.getFileType(); return fileType == HtmlFileType.INSTANCE || fileType == XHtmlFileType.INSTANCE; } | isHtmlFile |
299,523 | boolean (PsiElement element) { if (element == null) { return false; } final PsiFile containingFile = element.getContainingFile(); if (containingFile != null) { if (containingFile instanceof HtmlCompatibleFile) { return true; } final XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class, false); if (tag instanc... | isHtmlTagContainingFile |
299,524 | boolean (@Nullable XmlTag tag) { return tag != null && tag.getLocalName().equalsIgnoreCase(SCRIPT_TAG_NAME); } | isScriptTag |
299,525 | String (PsiElement context) { return myTagName; } | getName |
299,526 | String () { return myTagName; } | getDefaultName |
299,527 | boolean (final String namespace, final XmlTag context) { return true; } | allowElementsFromNamespace |
299,528 | Iterable<String> (@Nullable String classAttributeValue) { // comma is useduse as separator because class name cannot contain comma but it can be part of JSF classes attributes return classAttributeValue != null ? StringUtil.tokenize(classAttributeValue, " \t,") : Collections.emptyList(); } | splitClassNames |
299,529 | boolean (@NotNull PsiElement element) { PsiElement child = element.getFirstChild(); while (child != null) { if (child instanceof CompositeElement) { return containsOuterLanguageElements(child); } if (child instanceof OuterLanguageElement) { return true; } child = child.getNextSibling(); } return false; } | containsOuterLanguageElements |
299,530 | List<XmlAttributeValue> (final @NotNull XmlFile file) { final List<XmlAttributeValue> result = new ArrayList<>(); file.acceptChildren(new XmlRecursiveElementWalkingVisitor() { @Override public void visitXmlTag(@NotNull XmlTag tag) { XmlAttribute attribute = null; if ("link".equalsIgnoreCase(tag.getName())) { attribute ... | getIncludedPathsElements |
299,531 | void (@NotNull XmlTag tag) { XmlAttribute attribute = null; if ("link".equalsIgnoreCase(tag.getName())) { attribute = tag.getAttribute("href"); } else if ("script".equalsIgnoreCase(tag.getName()) || "img".equalsIgnoreCase(tag.getName())) { attribute = tag.getAttribute("src"); } if (attribute != null) result.add(attribu... | visitXmlTag |
299,532 | void (@NotNull PsiElement element) { if (element.getLanguage() instanceof XMLLanguage) { super.visitElement(element); } } | visitElement |
299,533 | XmlTag () { return (XmlTag)getParent(); } | getParentTag |
299,534 | XmlTagChild () { return null; } | getNextSiblingInTag |
299,535 | XmlTagChild () { return null; } | getPrevSiblingInTag |
299,536 | String () { return getOriginal().getText(); } | getText |
299,537 | String () { return getOriginal().getValue(); } | getValue |
299,538 | int (int offset) { return getOriginal().physicalToDisplay(offset); } | physicalToDisplay |
299,539 | int (int offset) { return getOriginal().displayToPhysical(offset); } | displayToPhysical |
299,540 | boolean (@NotNull XmlFile file) { return file.getFileType() == HtmlFileType.INSTANCE || file.getFileType() == XHtmlFileType.INSTANCE; } | overrideNamespaceFromDocType |
299,541 | boolean (Class<? extends PsiElement> elementClass) { return ReflectionUtil.isAssignable(XmlElement.class, elementClass); } | canResolveTo |
299,542 | String () { String name = getElement() instanceof XmlTag ? "tag" : "attribute"; return myDescriptor.isFixed() ? XmlPsiBundle.message("xml.inspections.should.have.fixed.value", StringUtil.capitalize(name), myDescriptor.getDefaultValue()) : XmlPsiBundle.message("xml.inspections.wrong.value", name); } | getUnresolvedMessagePattern |
299,543 | List<XmlEnumeratedValueReference> () { if (myDescriptor.isList()) return super.getReferences(); return Collections.singletonList(createReference(null, 0)); } | getReferences |
299,544 | boolean () { T t = myRef.get(); if (t != null) { return t.isValid(); } return myOriginal.retrieve() != null; } | isValid |
299,545 | boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IncludedXmlElement element = (IncludedXmlElement)o; if (!myParent.equals(element.myParent)) return false; if (!myOriginal.equals(element.myOriginal)) return false; return true; } | equals |
299,546 | int () { int result = myOriginal.hashCode(); result = 31 * result + myParent.hashCode(); return result; } | hashCode |
299,547 | T () { T element = myRef.get(); if (element != null) { return element; } element = (T)myOriginal.retrieve(); if (element == null) { throw new PsiInvalidElementAccessException(this); } myRef = new SoftReference<>(element); return element; } | getOriginal |
299,548 | T () { return getOriginal(); } | getNavigationElement |
299,549 | PsiFile () { return myParent.getContainingFile(); } | getContainingFile |
299,550 | PsiElement () { return myParent; } | getParent |
299,551 | String () { return getClass().getSimpleName(); } | toString |
299,552 | boolean (final PsiElementProcessor processor, PsiElement place) { final IncludedXmlElement<T> self = this; return getOriginal().processElements(new PsiElementProcessor() { @SuppressWarnings("unchecked") @Override public boolean execute(@NotNull PsiElement element) { if (element instanceof XmlTag) { XmlTag theirParent =... | processElements |
299,553 | boolean (@NotNull PsiElement element) { if (element instanceof XmlTag) { XmlTag theirParent = ((XmlTag)element).getParentTag(); PsiElement parent = getOriginal().equals(theirParent) ? (XmlTag)self : theirParent; return processor.execute(new IncludedXmlTag((XmlTag)element, parent)); } if (element instanceof XmlAttribute... | execute |
299,554 | boolean (XmlElement element, PsiElementProcessor<? super PsiElement> processor, boolean deepFlag) { return processXmlElements(element, processor, deepFlag, false); } | processXmlElements |
299,555 | boolean (XmlElement element, PsiElementProcessor<? super PsiElement> processor, boolean deepFlag, boolean wideFlag) { if (element == null) return true; PsiFile baseFile = element.isValid() ? element.getContainingFile() : null; return processXmlElements(element, processor, deepFlag, wideFlag, baseFile); } | processXmlElements |
299,556 | boolean (final XmlElement element, final PsiElementProcessor<? super PsiElement> processor, final boolean deepFlag, final boolean wideFlag, final PsiFile baseFile) { return processXmlElements(element, processor, deepFlag, wideFlag, baseFile, true); } | processXmlElements |
299,557 | boolean (final XmlElement element, final PsiElementProcessor<? super PsiElement> processor, final boolean deepFlag, final boolean wideFlag, final PsiFile baseFile, boolean processIncludes) { return AstLoadingFilter.forceAllowTreeLoading(baseFile, () -> new XmlElementProcessor(baseFile, processor).processXmlElements(ele... | processXmlElements |
299,558 | boolean (final XmlElement element, final PsiElementProcessor<? super PsiElement> processor, final boolean deepFlag) { final XmlPsiUtil.XmlElementProcessor p = new XmlPsiUtil.XmlElementProcessor(element.getContainingFile(), processor); for (PsiElement child = element.getFirstChild(); child != null; child = child.getNext... | processXmlElementChildren |
299,559 | boolean (@NotNull PsiElement element) { if (element instanceof XmlElement && predicate.matches(element.getNode().getElementType())) { result.set((XmlElement)element); return false; } return true; } | execute |
299,560 | boolean (PsiElement element, boolean deepFlag, boolean wideFlag, boolean processIncludes) { if (deepFlag) if (!processor.execute(element)) return false; PsiElement startFrom = element.getFirstChild(); if (element instanceof XmlEntityRef ref) { if (!visitedEntities.add(ref.getText())) return true; PsiElement newElement ... | processXmlElements |
299,561 | boolean (PsiElement child, boolean deepFlag, boolean wideFlag, boolean processIncludes) { if (deepFlag) { if (!processXmlElements(child, true, wideFlag, processIncludes)) { return false; } } else { if (child instanceof XmlEntityRef) { if (!processXmlElements(child, false, wideFlag, processIncludes)) return false; } els... | processElement |
299,562 | PsiElement (PsiFile targetFile, XmlEntityRef ref) { XmlEntityDecl.EntityContextType type = getContextType(ref); { final XmlEntityDecl entityDecl = ref.resolve(targetFile); if (entityDecl != null) return parseEntityDecl(entityDecl, targetFile, type, ref); } PsiElement e = ref; while (e != null) { if (e.getUserData(XmlEl... | parseEntityRef |
299,563 | PsiElement (final XmlEntityDecl entityDecl, final PsiFile targetFile, final XmlEntityDecl.EntityContextType type, final XmlEntityRef entityRef) { CachedValue<PsiElement> value = entityRef.getUserData(PARSED_DECL_KEY); if (value == null) { value = CachedValuesManager.getManager(entityDecl.getProject()).createCachedValue... | parseEntityDecl |
299,564 | boolean (final @NotNull @NonNls String s) { return ourSystemColors.contains(s); } | isSystemColorName |
299,565 | boolean (final @NotNull @NonNls String s) { return ourStandardColors.contains(s); } | isStandardColor |
299,566 | Color (String text) { if (StringUtil.isEmptyOrSpaces(text)) { return null; } String hexValue = text.charAt(0) == '#' ? text : getHexCodeForColorName(StringUtil.toLowerCase(text)); if (hexValue != null) { return ColorUtil.fromHex(hexValue, null); } return null; } | getColor |
299,567 | void (final @NotNull MetaDataRegistrar registrar) { { registrar.registerMetaData( new AndFilter( new NamespaceFilter(XmlUtil.SCHEMA_URIS), new ClassFilter(XmlDocument.class) ), SchemaNSDescriptor.class ); registrar.registerMetaData( new AndFilter(XmlTagFilter.INSTANCE, new NamespaceFilter(XmlUtil.SCHEMA_URIS), new XmlT... | contributeMetaData |
299,568 | boolean (String attributeName) { return knownAttributes.contains(attributeName.toLowerCase(Locale.US)); } | isKnownAttributeDescriptor |
299,569 | boolean (Exception ex) { if (ex instanceof ProcessCanceledException) throw (ProcessCanceledException)ex; if (ex instanceof XmlResourceResolver.IgnoredResourceException) throw (XmlResourceResolver.IgnoredResourceException)ex; if (ex instanceof FileNotFoundException || ex instanceof MalformedURLException || ex instanceof... | filterValidationException |
299,570 | void () { myHandler.doParse(); } | startProcessing |
299,571 | boolean () { return false; } | isStopOnUndeclaredResource |
299,572 | boolean (final SAXParseException e) { String error = myHandler.buildMessageString(e); if (ourErrorsSet.contains(error)) return false; ourErrorsSet.add(error); return true; } | isUniqueProblem |
299,573 | void (ErrorReporter errorReporter) { myErrorReporter = errorReporter; } | setErrorReporter |
299,574 | VirtualFile (SAXParseException ex) { String publicId = ex.getPublicId(); String systemId = ex.getSystemId(); if (publicId == null) { if (systemId != null) { if (systemId.startsWith("file:/")) { VirtualFile file = VirtualFileManager.getInstance() .findFileByUrl(systemId.startsWith("file://") ? systemId : systemId.replac... | getProblemFile |
299,575 | String (SAXParseException ex) { String msg = "(" + ex.getLineNumber() + ":" + ex.getColumnNumber() + ") " + ex.getMessage(); final VirtualFile file = getProblemFile(ex); if ( file != null && !file.equals(myFile.getVirtualFile())) { msg = file.getName() + ":" + msg; } return msg; } | buildMessageString |
299,576 | boolean (XmlFile file) { return true; } | isAvailable |
299,577 | void (XmlFile file) { myProject = file.getProject(); myFile = file; myXmlResourceResolver = new XmlResourceResolver(myFile, myProject, myErrorReporter); myXmlResourceResolver.setStopOnUnDeclaredResource( myErrorReporter.isStopOnUndeclaredResource() ); try { try { myParser = createParser(); } catch (Exception e) { filte... | doValidate |
299,578 | void (Exception exception) { if (!myErrorReporter.filterValidationException(exception)) { LOG.error(exception); } } | filterAppException |
299,579 | void () { try { InputSource inputSource = new InputSource(new StringReader(myFile.getText())); inputSource.setSystemId(myFile.getVirtualFile().getUrl().replace("file:", "file:/")); myParser.parse(inputSource, new DefaultHandler() { @Override public void warning(SAXParseException e) throws SAXException { if (myErrorRepo... | doParse |
299,580 | InputSource (String publicId, String systemId) { final PsiFile psiFile = myXmlResourceResolver.resolve(null, systemId); if (psiFile == null) return null; return new InputSource(new StringReader(psiFile.getText())); } | resolveEntity |
299,581 | XMLGrammarPool (XmlFile file, boolean forceChecking) { final XMLGrammarPool previousGrammarPool = getGrammarPool(file); XMLGrammarPool grammarPool = null; // check if the pool is valid if (!forceChecking && !isValidationDependentFilesOutOfDate(file)) { grammarPool = previousGrammarPool; } if (grammarPool == null) { inv... | getGrammarPool |
299,582 | boolean (XmlFile myFile) { final VirtualFile[] files = myFile.getUserData(DEPENDENT_FILES_KEY); final Long grammarPoolTimeStamp = myFile.getUserData(GRAMMAR_POOL_TIME_STAMP_KEY); String[] ns = myFile.getUserData(KNOWN_NAMESPACES_KEY); if (!Arrays.equals(ns, getNamespaces(myFile))) { return true; } if (grammarPoolTimeSt... | isValidationDependentFilesOutOfDate |
299,583 | void (XmlFile file) { file.putUserData(ENTITIES_KEY, null); } | invalidateEntityManager |
299,584 | String[] (XmlFile file) { XmlTag rootTag = file.getRootTag(); if (rootTag == null) return ArrayUtilRt.EMPTY_STRING_ARRAY; return ContainerUtil.mapNotNull(rootTag.getAttributes(), attribute -> attribute.getValue(), ArrayUtilRt.EMPTY_STRING_ARRAY); } | getNamespaces |
299,585 | long (final VirtualFile[] files, Project myProject) { long timestamp = 0; for(VirtualFile file:files) { if (file == null || !file.isValid()) break; final PsiFile psifile = PsiManager.getInstance(myProject).findFile(file); if (psifile != null && psifile.isValid()) { timestamp += psifile.getViewProvider().getModification... | calculateTimeStamp |
299,586 | boolean () { XmlDocument document = myFile.getDocument(); if (document == null) return false; XmlProlog prolog = document.getProlog(); if (prolog == null) return false; XmlDoctype doctype = prolog.getDoctype(); if (doctype == null) return false; return true; } | hasDtdDeclaration |
299,587 | boolean () { XmlDocument document = myFile.getDocument(); if (document == null) return false; return (document.getProlog()!=null && document.getProlog().getDoctype()!=null); } | needsDtdChecking |
299,588 | boolean () { XmlDocument document = myFile.getDocument(); if (document == null) return false; XmlTag rootTag = document.getRootTag(); if (rootTag == null) return false; XmlAttribute[] attributes = rootTag.getAttributes(); for (XmlAttribute attribute : attributes) { if (attribute.isNamespaceDeclaration()) return true; }... | needsSchemaChecking |
299,589 | String (final InputStream is) { return computeNamespace(new InputStreamReader(is, StandardCharsets.UTF_8)).getNamespace(); } | computeNamespace |
299,590 | XsdNamespaceBuilder (@NotNull Reader reader) { try (reader) { XsdNamespaceBuilder xsdBuilder = new XsdNamespaceBuilder(); NanoXmlBuilder builder = xsdBuilder.new NanoBuilder(); NanoXmlUtil.parse(reader, builder); HashSet<String> tags = new HashSet<>(xsdBuilder.getTags()); tags.removeAll(xsdBuilder.myReferencedTags); xs... | computeNamespace |
299,591 | void (String name, String nsPrefix, String nsURI) { myCurrentDepth--; myCurrentTag = null; } | endElement |
299,592 | int (@NotNull XsdNamespaceBuilder o) { return Comparing.compare(myNamespace, o.myNamespace); } | compareTo |
299,593 | boolean (@NotNull String tagName) { return myTags.contains(tagName); } | hasTag |
299,594 | int (@Nullable String tagName, @Nullable String version) { int rate = 0; if (tagName != null && myTags.contains(tagName)) { rate |= 0x02; } if (version != null && version.equals(myVersion)) { rate |= 0x01; } return rate; } | getRating |
299,595 | String () { return myNamespace; } | getNamespace |
299,596 | String () { return myVersion; } | getVersion |
299,597 | List<String> () { return myTags; } | getTags |
299,598 | List<String> () { return myRootTags; } | getRootTags |
299,599 | List<String> () { return myAttributes; } | getAttributes |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.