Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
298,500
ASTNode (IElementType root, PsiBuilder builder) { return new DtdParsing(root, XmlEntityDecl.EntityContextType.GENERIC_XML, builder).parse(); }
parse
298,501
IFileElementType () { return XmlElementType.DTD_FILE; }
getFileNodeType
298,502
Lexer (Project project) { return new DtdLexer(false); }
createLexer
298,503
XmlCodeFoldingSettings () { return XmlFoldingSettings.getInstance(); }
getFoldingSettings
298,504
boolean (@NotNull PsiElement element) { return element instanceof XmlElementDecl || element instanceof XmlAttributeDecl || element instanceof XmlEntityDecl || element instanceof XmlTag || element instanceof XmlAttributeValue || element instanceof PsiFile || element instanceof XmlComment; }
canFindUsagesFor
298,505
String (@NotNull PsiElement element) { if (element instanceof XmlTag) { final PsiMetaData metaData = ((XmlTag)element).getMetaData(); if (metaData != null && metaData.getDeclaration() instanceof XmlTag) { return ((XmlTag)metaData.getDeclaration()).getName(); } return XmlPsiBundle.message("xml.terms.xml.tag"); } if (element instanceof XmlElementDecl) { return XmlPsiBundle.message("xml.terms.tag"); } else if (element instanceof XmlAttributeDecl) { return XmlPsiBundle.message("xml.terms.attribute"); } else if (element instanceof XmlAttributeValue) { return XmlPsiBundle.message("xml.terms.attribute.value"); } else if (element instanceof XmlEntityDecl) { return XmlPsiBundle.message("xml.terms.entity"); } else if (element instanceof XmlAttribute) { return XmlPsiBundle.message("xml.terms.attribute"); } else if (element instanceof XmlComment) { return XmlPsiBundle.message("xml.terms.variable"); } throw new IllegalArgumentException("Cannot get type for " + element); }
getType
298,506
String (@NotNull PsiElement element) { return HelpID.FIND_OTHER_USAGES; }
getHelpId
298,507
String (@NotNull PsiElement element) { if (element instanceof XmlTag) { return ((XmlTag)element).getName(); } if (element instanceof XmlAttributeValue) { return ((XmlAttributeValue)element).getValue(); } if (element instanceof PsiNamedElement) { return ((PsiNamedElement)element).getName(); } return element.getText(); }
getDescriptiveName
298,508
String (@NotNull PsiElement element, boolean useFullName) { if (element instanceof XmlTag xmlTag) { final PsiMetaData metaData = xmlTag.getMetaData(); final String name = metaData != null ? DescriptiveNameUtil.getMetaDataName(metaData) : xmlTag.getName(); String presentableName = metaData == null ? "<" + name + ">" : name; return XmlPsiBundle.message("xml.find.usages.presentable.name.of.containing.file", presentableName, xmlTag.getContainingFile().getName()); } if (element instanceof XmlAttributeValue) { return ((XmlAttributeValue)element).getValue(); } if (element instanceof PsiNamedElement) { return ((PsiNamedElement)element).getName(); } return element.getText(); }
getNodeText
298,509
Lexer (Project project) { return new XmlLexer(); }
createLexer
298,510
IFileElementType () { return XmlElementType.XML_FILE; }
getFileNodeType
298,511
TokenSet () { return XmlTokenType.WHITESPACES; }
getWhitespaceTokens
298,512
TokenSet () { return XmlTokenType.COMMENTS; }
getCommentTokens
298,513
TokenSet () { return TokenSet.EMPTY; }
getStringLiteralElements
298,514
PsiParser (final Project project) { return new XmlParser(); }
createParser
298,515
PsiElement (ASTNode node) { if (node.getElementType() instanceof XmlStubBasedElementType) { //noinspection rawtypes return ((XmlStubBasedElementType)node.getElementType()).createPsi(node); } throw new IncorrectOperationException("I dont know how to create XML PSI for this node: "+node+" ("+node.getClass()+")"); }
createElement
298,516
PsiFile (@NotNull FileViewProvider viewProvider) { return new XmlFileImpl(viewProvider, XmlElementType.XML_FILE); }
createFile
298,517
SpaceRequirements (ASTNode left, ASTNode right) { return canStickTokensTogether(left, right); }
spaceExistenceTypeBetweenTokens
298,518
SpaceRequirements (final ASTNode left, final ASTNode right) { if (left.getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN || right.getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN) { return SpaceRequirements.MUST_NOT; } if (left.getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER && right.getElementType() == XmlTokenType.XML_NAME) { return SpaceRequirements.MUST; } if (left.getElementType() == XmlTokenType.XML_NAME && right.getElementType() == XmlTokenType.XML_NAME) { return SpaceRequirements.MUST; } if (left.getElementType() == XmlTokenType.XML_TAG_NAME && right.getElementType() == XmlTokenType.XML_NAME) { return SpaceRequirements.MUST; } return SpaceRequirements.MAY; }
canStickTokensTogether
298,519
CompositeElement (final @NotNull IElementType type) { if (type == XML_TAG) { return new XmlTagImpl(); } if (type == XML_CONDITIONAL_SECTION) { return new XmlConditionalSectionImpl(); } if (type == HTML_TAG) { return new HtmlTagImpl(); } if (type == XML_TEXT) { return new XmlTextImpl(); } if (type == XML_PROCESSING_INSTRUCTION) { return new XmlProcessingInstructionImpl(); } if (type == XML_DOCUMENT) { return new XmlDocumentImpl(); } if (type == HTML_DOCUMENT) { return new HtmlDocumentImpl(); } if (type == XML_PROLOG) { return new XmlPrologImpl(); } if (type == XML_DECL) { return new XmlDeclImpl(); } if (type == XML_ATTRIBUTE) { return new XmlAttributeImpl(); } if (type == XML_ATTRIBUTE_VALUE) { return new XmlAttributeValueImpl(); } if (type == XML_COMMENT) { return new XmlCommentImpl(); } if (type == XML_DOCTYPE) { return new XmlDoctypeImpl(); } if (type == XML_MARKUP_DECL) { return new XmlMarkupDeclImpl(); } if (type == XML_ELEMENT_DECL) { return new XmlElementDeclImpl(); } if (type == XML_ENTITY_DECL) { return new XmlEntityDeclImpl(); } if (type == XML_ATTLIST_DECL) { return new XmlAttlistDeclImpl(); } if (type == XML_ATTRIBUTE_DECL) { return new XmlAttributeDeclImpl(); } if (type == XML_NOTATION_DECL) { return new XmlNotationDeclImpl(); } if (type == XML_ELEMENT_CONTENT_SPEC) { return new XmlElementContentSpecImpl(); } if (type == XML_ELEMENT_CONTENT_GROUP) { return new XmlElementContentGroupImpl(); } if (type == XML_ENTITY_REF) { return new XmlEntityRefImpl(); } if (type == XML_ENUMERATED_TYPE) { return new XmlEnumeratedTypeImpl(); } if (type == XML_CDATA) { return new CompositePsiElement(XML_CDATA) {}; } if (type instanceof ITemplateDataElementType) { return new XmlFileElement(type, null); } return null; }
createComposite
298,520
LazyParseableElement (@NotNull ILazyParseableElementType type, CharSequence text) { if (type == XML_FILE) { return new XmlFileElement(type, text); } if (type == DTD_FILE) { return new XmlFileElement(type, text); } if (type == XHTML_FILE) { return new XmlFileElement(type, text); } if (type == HTML_FILE) { return new HtmlFileElement(text); } if (type instanceof ITemplateDataElementType) { return new XmlFileElement(type, text); } return null; }
createLazy
298,521
LeafElement (final @NotNull IElementType type, @NotNull CharSequence text) { if (type instanceof IXmlLeafElementType) { if (type == XML_REAL_WHITE_SPACE) { return new PsiWhiteSpaceImpl(text); } return new XmlTokenImpl(type, text); } return null; }
createLeaf
298,522
SyntaxHighlighter () { return new XmlFileHighlighter(); }
createHighlighter
298,523
void (@NotNull CompositeElement parent, TreeElement anchorBefore, @NotNull OuterLanguageElement toInsert) { if(anchorBefore != null) { //[mike] //Nasty hack. Is used not to insert OuterLanguageElements before the first token of tag. //See GeneralJspParsingTest.testHtml6 if (anchorBefore.getElementType() == XmlTokenType.XML_START_TAG_START) { anchorBefore = anchorBefore.getTreeParent(); } anchorBefore.rawInsertBeforeMe((TreeElement)toInsert); } else parent.rawAddChildren((TreeElement)toInsert); }
insert
298,524
void (String url, @NotNull Project project) { throw new UnsupportedOperationException(); }
removeResource
298,525
void (@NonNls String url, @NonNls String location, @NotNull Project project) { throw new UnsupportedOperationException(); }
addResource
298,526
String[] () { throw new UnsupportedOperationException(); }
getAvailableUrls
298,527
String[] (Project project) { throw new UnsupportedOperationException(); }
getAvailableUrls
298,528
void () { }
clearAllResources
298,529
void (Project project) { }
clearAllResources
298,530
void (@NotNull String url) { throw new UnsupportedOperationException(); }
addIgnoredResource
298,531
void (@NotNull List<String> urls, @Nullable Disposable disposable) { throw new UnsupportedOperationException(); }
addIgnoredResources
298,532
boolean (@NotNull String url) { return false; }
isIgnoredResource
298,533
String[] () { throw new UnsupportedOperationException(); }
getIgnoredResources
298,534
boolean (VirtualFile file) { return false; }
isUserResource
298,535
boolean (VirtualFile file) { return false; }
isStandardResource
298,536
String (@NotNull Project project) { throw new UnsupportedOperationException(); }
getDefaultHtmlDoctype
298,537
void (@NotNull String defaultHtmlDoctype, @NotNull Project project) { throw new UnsupportedOperationException(); }
setDefaultHtmlDoctype
298,538
XMLSchemaVersion (@NotNull Project project) { throw new UnsupportedOperationException(); }
getXmlSchemaVersion
298,539
void (XMLSchemaVersion version, @NotNull Project project) { throw new UnsupportedOperationException(); }
setXmlSchemaVersion
298,540
String () { throw new UnsupportedOperationException(); }
getCatalogPropertiesFile
298,541
void (@Nullable String filePath) { throw new UnsupportedOperationException(); }
setCatalogPropertiesFile
298,542
long (@NotNull Project project) { return 0; }
getModificationCount
298,543
void (@NotNull @NonNls String url, @NonNls String location) { throw new UnsupportedOperationException(); }
addResource
298,544
void (@NotNull @NonNls String url, @NonNls String version, @NonNls String location) { throw new UnsupportedOperationException(); }
addResource
298,545
void (@NotNull String url) { throw new UnsupportedOperationException(); }
removeResource
298,546
void (@NotNull String url, @Nullable String version) { throw new UnsupportedOperationException(); }
removeResource
298,547
String (@NotNull @NonNls String url) { throw new UnsupportedOperationException(); }
getResourceLocation
298,548
String (@NotNull @NonNls String url, @Nullable String version) { throw new UnsupportedOperationException(); }
getResourceLocation
298,549
String (@NotNull @NonNls String url, @NotNull Project project) { throw new UnsupportedOperationException(); }
getResourceLocation
298,550
String[] (@Nullable FileType fileType, boolean includeStandard) { throw new UnsupportedOperationException(); }
getResourceUrls
298,551
String[] (@Nullable FileType fileType, @Nullable @NonNls String version, boolean includeStandard) { throw new UnsupportedOperationException(); }
getResourceUrls
298,552
void (@NonNls String resource, @NonNls String fileName) { addStdResource(resource, null, fileName, getClass()); }
addStdResource
298,553
void (@NonNls String resource, @NonNls String fileName, Class klass) { addStdResource(resource, null, fileName, klass); }
addStdResource
298,554
void (@NonNls String resource, @NonNls String version, @NonNls String fileName, @Nullable Class<?> klass, @Nullable ClassLoader classLoader) { Map<String, ExternalResourceManagerExImpl.Resource> map = ExternalResourceManagerExImpl.getOrCreateMap(myResources, version); map.put(resource, new ExternalResourceManagerExImpl.Resource(fileName, klass, classLoader)); }
addStdResource
298,555
void (@NonNls String resource, @Nullable @NonNls String version, @NonNls String fileName, Class klass) { addStdResource(resource, version, fileName, klass, null); }
addStdResource
298,556
void (@NonNls String url) { myIgnored.add(url); }
addIgnoredResource
298,557
void (@NonNls String resource, @NonNls String fileName) { addInternalResource(resource, null, fileName, getClass()); }
addInternalResource
298,558
void (@NonNls String resource, @NonNls String fileName, Class<?> clazz) { addInternalResource(resource, null, fileName, clazz); }
addInternalResource
298,559
void (@NonNls String resource, @NonNls String version, @NonNls String fileName) { addInternalResource(resource, version, fileName, getClass()); }
addInternalResource
298,560
void (@NonNls String resource, @Nullable @NonNls String version, @NonNls String fileName, @Nullable Class<?> clazz) { addStdResource(resource, version, ExternalResourceManagerEx.STANDARD_SCHEMAS + fileName, clazz, null); }
addInternalResource
298,561
List<String> () { return myIgnored; }
getIgnored
298,562
void () { myStandardResources.drop(); incModificationCount(); }
dropCache
298,563
boolean (VirtualFile file) { VirtualFile parent = file.getParent(); return parent != null && parent.getName().equals("standardSchemas"); }
isStandardResource
298,564
boolean (VirtualFile file) { return myResourceLocations.contains(file.getUrl()); }
isUserResource
298,565
String (@NotNull String url) { return getResourceLocation(url, DEFAULT_VERSION); }
getResourceLocation
298,566
String (@NotNull @NonNls String url, @Nullable String version) { String result = getUserResource(url, Strings.notNullize(version, DEFAULT_VERSION)); if (result == null) { XMLCatalogManager manager = getCatalogManager(); if (manager != null) { result = manager.resolve(url); } if (result == null) { result = getStdResource(url, version); if (result == null) { return url; } } } return result; }
getResourceLocation
298,567
String (@NotNull @NonNls String url, @NotNull Project project) { return getResourceLocation(url, null, project); }
getResourceLocation
298,568
String (@NonNls String url, String version, @NotNull Project project) { ExternalResourceManagerExImpl projectResources = getProjectResources(project); String location = projectResources.getResourceLocation(url, version); if (location == null || location.equals(url)) { if (projectResources.myXMLSchemaVersion == XMLSchemaVersion.XMLSchema_1_1) { if (XmlUtil.XML_SCHEMA_URI.equals(url)) return XSD_1_1; if ((XmlUtil.XML_SCHEMA_URI + ".xsd").equals(url)) return XSD_1_1; } return getResourceLocation(url, version); } else { return location; } }
getResourceLocation
298,569
String[] (FileType fileType, boolean includeStandard) { return getResourceUrls(fileType, DEFAULT_VERSION, includeStandard); }
getResourceUrls
298,570
String[] (@Nullable FileType fileType, @Nullable @NonNls String version, boolean includeStandard) { List<String> result = new LinkedList<>(); addResourcesFromMap(result, version, myResources); if (includeStandard) { addResourcesFromMap(result, version, myStandardResources.getValue()); } return ArrayUtilRt.toStringArray(result); }
getResourceUrls
298,571
void (@NotNull String url, String location) { addResource(url, DEFAULT_VERSION, location); }
addResource
298,572
void (@NotNull @NonNls String url, @NonNls String version, @NonNls String location) { ApplicationManager.getApplication().assertWriteAccessAllowed(); addSilently(url, version, location); fireExternalResourceChanged(); }
addResource
298,573
void (@NotNull String url, @Nullable String version, String location) { getOrCreateMap(myResources, version).put(url, location); myResourceLocations.add(location); incModificationCount(); }
addSilently
298,574
void (@NotNull String url) { removeResource(url, DEFAULT_VERSION); }
removeResource
298,575
void (@NotNull String url, @Nullable String version) { ApplicationManager.getApplication().assertWriteAccessAllowed(); Map<String, String> map = getMap(myResources, version); if (map != null) { String location = map.remove(url); if (location != null) { myResourceLocations.remove(location); } incModificationCount(); fireExternalResourceChanged(); } }
removeResource
298,576
void (String url, @NotNull Project project) { getProjectResources(project).removeResource(url); }
removeResource
298,577
void (@NonNls String url, @NonNls String location, @NotNull Project project) { getProjectResources(project).addResource(url, location); }
addResource
298,578
String[] () { Set<String> urls = new HashSet<>(); for (Map<String, String> map : myResources.values()) { urls.addAll(map.keySet()); } return ArrayUtilRt.toStringArray(urls); }
getAvailableUrls
298,579
String[] (Project project) { return getProjectResources(project).getAvailableUrls(); }
getAvailableUrls
298,580
void () { myResources.clear(); myIgnoredResources.clear(); }
clearAllResources
298,581
void (Project project) { ApplicationManager.getApplication().assertWriteAccessAllowed(); clearAllResources(); getProjectResources(project).clearAllResources(); incModificationCount(); fireExternalResourceChanged(); }
clearAllResources
298,582
void (@NotNull String url) { ApplicationManager.getApplication().assertWriteAccessAllowed(); if (addIgnoredSilently(url)) { fireExternalResourceChanged(); } }
addIgnoredResource
298,583
void (@NotNull List<String> urls, @Nullable Disposable disposable) { Application app = ApplicationManager.getApplication(); if (app.isWriteAccessAllowed()) { doAddIgnoredResources(urls, disposable); } else { app.runWriteAction(() -> doAddIgnoredResources(urls, disposable)); } }
addIgnoredResources
298,584
void (@NotNull List<String> urls, @Nullable Disposable disposable) { long modificationCount = getModificationCount(); for (String url : urls) { addIgnoredSilently(url); } if (modificationCount != getModificationCount()) { if (disposable != null) { //noinspection CodeBlock2Expr Disposer.register(disposable, () -> { ApplicationManager.getApplication().runWriteAction(() -> { boolean isChanged = false; for (String url : urls) { if (myIgnoredResources.remove(url)) { isChanged = true; } } if (isChanged) { fireExternalResourceChanged(); } }); }); } fireExternalResourceChanged(); } }
doAddIgnoredResources
298,585
boolean (@NotNull String url) { if (myStandardIgnoredResources.contains(url)) { return false; } if (myIgnoredResources.add(url)) { incModificationCount(); return true; } else { return false; } }
addIgnoredSilently
298,586
boolean (@NotNull String url) { if (myIgnoredResources.contains(url)) { return true; } // ensure ignored resources are loaded myStandardResources.getValue(); return myStandardIgnoredResources.contains(url) || isImplicitNamespaceDescriptor(url); }
isIgnoredResource
298,587
boolean (@NotNull String url) { for (ImplicitNamespaceDescriptorProvider provider : ImplicitNamespaceDescriptorProvider.EP_NAME.getExtensionList()) { if (provider.getNamespaceDescriptor(null, url, null) != null) { return true; } } return false; }
isImplicitNamespaceDescriptor
298,588
String[] () { // ensure ignored resources are loaded myStandardResources.getValue(); if (myIgnoredResources.isEmpty()) { return ArrayUtilRt.toStringArray(myStandardIgnoredResources); } Set<String> set = new HashSet<>(myIgnoredResources.size() + myStandardIgnoredResources.size()); set.addAll(myIgnoredResources); set.addAll(myStandardIgnoredResources); return ArrayUtilRt.toStringArray(set); }
getIgnoredResources
298,589
long (@NotNull Project project) { return getProjectResources(project).getModificationCount(); }
getModificationCount
298,590
void (@NotNull Element state) { ExpandMacroToPathMap macroExpands = new ExpandMacroToPathMap(); PathMacrosImpl.getInstanceEx().addMacroExpands(macroExpands); macroExpands.substitute(state, SystemInfo.isFileSystemCaseSensitive); incModificationCount(); for (Element element : state.getChildren(RESOURCE_ELEMENT)) { String url = element.getAttributeValue(URL_ATTR); if (!Strings.isEmpty(url)) { addSilently(url, DEFAULT_VERSION, Objects.requireNonNull(element.getAttributeValue(LOCATION_ATTR)).replace('/', File.separatorChar)); } } myIgnoredResources.clear(); for (Element element : state.getChildren(IGNORED_RESOURCE_ELEMENT)) { addIgnoredSilently(element.getAttributeValue(URL_ATTR)); } Element child = state.getChild(HTML_DEFAULT_DOCTYPE_ELEMENT); if (child != null) { String text = child.getText(); if (FileUtil.toSystemIndependentName(text).endsWith(".jar!/resources/html5-schema/html5.rnc")) { text = HTML5_DOCTYPE_ELEMENT; } myDefaultHtmlDoctype = text; } Element schemaElement = state.getChild(XML_SCHEMA_VERSION); if (schemaElement != null) { String text = schemaElement.getText(); myXMLSchemaVersion = XMLSchemaVersion.XMLSchema_1_1.toString().equals(text) ? XMLSchemaVersion.XMLSchema_1_1 : XMLSchemaVersion.XMLSchema_1_0; } Element catalogElement = state.getChild(CATALOG_PROPERTIES_ELEMENT); if (catalogElement != null) { myCatalogPropertiesFile = catalogElement.getTextTrim(); } }
loadState
298,591
void () { ApplicationManager.getApplication().getMessageBus().syncPublisher(ExternalResourceListener.TOPIC).externalResourceChanged(); incModificationCount(); }
fireExternalResourceChanged
298,592
ExternalResourceManagerExImpl (@NotNull Project project) { return project.getService(ExternalResourceManagerExImpl.class); }
getProjectResources
298,593
String (@NotNull Project project) { final String doctype = getProjectResources(project).myDefaultHtmlDoctype; if (XmlUtil.XHTML_URI.equals(doctype)) { return XmlUtil.XHTML4_SCHEMA_LOCATION; } else if (HTML5_DOCTYPE_ELEMENT.equals(doctype)) { return Html5SchemaProvider.getHtml5SchemaLocation(); } else { return doctype; } }
getDefaultHtmlDoctype
298,594
void (@NotNull String defaultHtmlDoctype, @NotNull Project project) { getProjectResources(project).setDefaultHtmlDoctype(defaultHtmlDoctype); }
setDefaultHtmlDoctype
298,595
XMLSchemaVersion (@NotNull Project project) { return getProjectResources(project).myXMLSchemaVersion; }
getXmlSchemaVersion
298,596
void (XMLSchemaVersion version, @NotNull Project project) { getProjectResources(project).myXMLSchemaVersion = version; fireExternalResourceChanged(); }
setXmlSchemaVersion
298,597
String () { return myCatalogPropertiesFile; }
getCatalogPropertiesFile
298,598
void (String filePath) { myCatalogManager = null; myCatalogPropertiesFile = filePath; incModificationCount(); }
setCatalogPropertiesFile
298,599
void (String defaultHtmlDoctype) { incModificationCount(); if (Html5SchemaProvider.getHtml5SchemaLocation().equals(defaultHtmlDoctype)) { myDefaultHtmlDoctype = HTML5_DOCTYPE_ELEMENT; } else { myDefaultHtmlDoctype = defaultHtmlDoctype; } fireExternalResourceChanged(); }
setDefaultHtmlDoctype