Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
304,700
void (@NotNull TextEditorHighlightingPassRegistrar registrar, @NotNull Project project) { registrar.registerTextEditorHighlightingPass(this, new int[]{Pass.UPDATE_ALL}, null, false, -1); }
registerHighlightingPassFactory
304,701
TextEditorHighlightingPass (final @NotNull PsiFile file, final @NotNull Editor editor) { if (editor.isOneLineMode()) return null; if (!XmlTagTreeHighlightingUtil.isTagTreeHighlightingActive(file)) return null; if (!(editor instanceof EditorEx)) return null; return new XmlTagTreeHighlightingPass(file, (EditorEx)editor);...
createHighlightingPass
304,702
boolean (@NotNull PsiElement deepestElement) { final PsiFile file = deepestElement.getContainingFile(); if (file == null || !XmlTagTreeHighlightingUtil.isTagTreeHighlightingActive(file)) { return false; } return true; }
isMyContext
304,703
CrumbPresentation[] (PsiElement @NotNull [] elements) { if (elements.length == 0 || !isMyContext(elements[elements.length - 1])) { return null; } if (!XmlTagTreeHighlightingUtil.containsTagsWithSameName(elements)) { return null; } final CrumbPresentation[] result = new CrumbPresentation[elements.length]; final Color[] ...
getCrumbPresentations
304,704
Color (boolean selected, boolean hovered, boolean light) { final Color baseColor = super.getBackgroundColor(selected, hovered, light); return baseColor == null ? XmlTagTreeHighlightingPass.toLineMarkerColor(0x92, myColor) : myColor != null ? UIUtil.makeTransparent(myColor, baseColor, 0.1) : baseColor; }
getBackgroundColor
304,705
String () { return KEY; }
getQuickFixKeyId
304,706
boolean () { return false; }
startInWriteAction
304,707
String () { return KEY; }
getQuickFixKeyId
304,708
boolean () { return false; }
startInWriteAction
304,709
void (final @NotNull String currentUri, final String url) { if (currentUri.equals(uri) && url != null) schemaLocations.add(url); }
process
304,710
boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!(file instanceof XmlFile)) return false; PsiElement element = file.findElementAt(editor.getCaretModel().getOffset()); XmlAttributeValue value = PsiTreeUtil.getParentOfType(element, XmlAttributeValue.class); if (value == null) return false; XmlAttrib...
isAvailable
304,711
Set<String> (@NotNull Project project) { String path = getExternalResourcesPath(); Path file = checkExists(path); return Collections.singleton(file.toAbsolutePath().toString()); }
getRootsToWatch
304,712
String () { return KEY; }
getQuickFixKeyId
304,713
boolean (final String uri) { return uri.startsWith(HTTP_PROTOCOL) || uri.startsWith(FTP_PROTOCOL) || uri.startsWith(HTTPS_PROTOCOL); }
isAcceptableUri
304,714
String (PsiFile file, int offset, String uri) { final PsiElement currentElement = file.findElementAt(offset); final XmlAttribute attribute = PsiTreeUtil.getParentOfType(currentElement, XmlAttribute.class); if (attribute != null) { final XmlTag tag = PsiTreeUtil.getParentOfType(currentElement, XmlTag.class); if (tag != ...
findUrl
304,715
Path (String dir) { Path path = Paths.get(dir); try { Files.createDirectories(path); } catch (IOException e) { LOG.warn("Unable to create: " + path, e); } return path; }
checkExists
304,716
boolean () { return false; }
startInWriteAction
304,717
void (@NotNull ProgressIndicator indicator) { while (true) { try { HttpConfigurable.getInstance().prepareURL(url); fetchDtd(project, uri, url, indicator); ApplicationManager.getApplication().invokeLater(() -> DaemonCodeAnalyzer.getInstance(project).restart(file)); return; } catch (IOException ex) { LOG.info(ex); @Suppr...
run
304,718
VirtualFile (final String resPath, final @Nullable String dtdUrl, Project project) { final Ref<VirtualFile> ref = new Ref<>(); ApplicationManager.getApplication().invokeAndWait(() -> ApplicationManager.getApplication().runWriteAction(() -> { ref.set(LocalFileSystem.getInstance().refreshAndFindFileByPath(resPath.replace...
findFileByPath
304,719
String () { return PathManager.getSystemPath() + File.separator + EXT_RESOURCES_FOLDER; }
getExternalResourcesPath
304,720
void (final List<String> resourceUrls, final List<String> downloadedResources) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { for (String resourcesUrl : resourceUrls) { Ext...
cleanup
304,721
void () { ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { for (String resourcesUrl : resourceUrls) { ExternalResourceManager.getInstance().removeResource(resourcesUrl); } for (String downloadedResource : downloadedResources) { VirtualFile virtualFile = LocalFileSystem.g...
run
304,722
void () { for (String resourcesUrl : resourceUrls) { ExternalResourceManager.getInstance().removeResource(resourcesUrl); } for (String downloadedResource : downloadedResources) { VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByIoFile(new File(downloadedResource)); if (virtualFile != null) { try { virt...
run
304,723
boolean (final Project project, ProgressIndicator indicator, final String resourceUrl, FetchResult result) { if (myForceResultIsValid) { return true; } if (!ApplicationManager.getApplication().isUnitTestMode() && result.contentType != null && result.contentType.contains(HTML_MIME) && new String(result.bytes, StandardCh...
resultIsValid
304,724
Set<String> (XmlFile file, XmlFile context, final String url) { if (context != null) { XmlEntityCache.copyEntityCaches(file, context); } Set<String> result = new LinkedHashSet<>(); XmlUtil.processXmlElements( file, element -> { if (element instanceof XmlEntityDecl) { String candidateName = null; for (PsiElement e = ele...
extractEmbeddedFileReferences
304,725
Set<String> (final VirtualFile vFile, final @Nullable VirtualFile contextVFile, final PsiManager psiManager, final String url) { return ReadAction.compute(() -> { PsiFile file = psiManager.findFile(vFile); if (file instanceof XmlFile) { PsiFile contextFile = contextVFile != null ? psiManager.findFile(contextVFile) : nu...
extractEmbeddedFileReferences
304,726
String () { return KEY; }
getQuickFixKeyId
304,727
IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { int offset = editor.getCaretModel().getOffset(); final String uri = findUri(file, offset); if (uri == null) { return IntentionPreviewInfo.EMPTY; } String pathToConfigurable = ConfigurableExtensionPointUtil.getConfigurablePa...
generatePreview
304,728
boolean () { return false; }
startInWriteAction
304,729
boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!(file instanceof XmlFile)) return false; int offset = editor.getCaretModel().getOffset(); String uri = findUri(file, offset); if (uri == null || !isAcceptableUri(uri)) return false; setText(XmlBundle.message(getQuickFixKeyId())); return true; }
isAvailable
304,730
boolean (final String uri) { return true; }
isAcceptableUri
304,731
String () { return XmlBundle.message(getQuickFixKeyId()); }
getFamilyName
304,732
XmlFile () { return (XmlFile)myElement.getFile(); }
getFile
304,733
String () { final String alias = getXmlNamespaceHelper().getNamespaceAlias(getFile()); return XmlPsiBundle.message("xml.quickfix.create.namespace.declaration.text", alias); }
getText
304,734
XmlNamespaceHelper () { return XmlNamespaceHelper.getHelper(getFile()); }
getXmlNamespaceHelper
304,735
String () { return XmlPsiBundle.message("xml.quickfix.create.namespace.declaration.family"); }
getFamilyName
304,736
void (final @NotNull Project project, final @NotNull ProblemDescriptor descriptor) { final PsiFile containingFile = descriptor.getPsiElement().getContainingFile(); Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor(); final PsiFile file = editor != null ? PsiDocumentManager.getInstance(project...
applyFix
304,737
IntentionPreviewInfo (@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) { return doPreview(project, previewDescriptor.getPsiElement(), null); }
generatePreview
304,738
IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { PsiElement element = myElement.retrieve(); if (element == null) return IntentionPreviewInfo.EMPTY; return doPreview(project, PsiTreeUtil.findSameElementInCopy(element, file), editor); }
generatePreview
304,739
IntentionPreviewInfo (@NotNull Project project, PsiElement element, @Nullable Editor editor) { PsiFile file = element.getContainingFile(); if (!(file instanceof XmlFile xmlFile)) return IntentionPreviewInfo.EMPTY; List<String> namespaces = getNamespaces(element, xmlFile); String namespace = namespaces.isEmpty() ? "" : ...
doPreview
304,740
boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!(file instanceof XmlFile)) return false; PsiElement element = myElement.retrieve(); XmlTag rootTag = ((XmlFile)file).getRootTag(); return element != null && rootTag != null && !PsiUtilCore.hasErrorElementChild(rootTag); }
isAvailable
304,741
List<String> (PsiElement element, XmlFile xmlFile) { if (element instanceof XmlAttribute) { element = element.getParent(); } Set<String> set = getXmlNamespaceHelper().guessUnboundNamespaces(element, xmlFile); final String match = getUnboundNamespaceForPrefix(myNamespacePrefix, xmlFile, set); if (match != null) { return...
getNamespaces
304,742
boolean () { return true; }
startInWriteAction
304,743
boolean (final @NotNull Editor editor) { XmlToken token = null; if (myToken != null) { token = (XmlToken)myToken.retrieve(); if (token == null) return false; } if (!XmlSettings.getInstance().SHOW_XML_ADD_IMPORT_HINTS || myNamespacePrefix.isEmpty()) { return false; } final PsiElement element = myElement.retrieve(); if (...
showHint
304,744
boolean (final String name, final XmlFile tldFileByUri) { if (name == null || name.isEmpty()) return true; final List<String> list = StringUtil.getWordsIn(name); final String[] words = ArrayUtilRt.toStringArray(list); final boolean[] wordsFound = new boolean[words.length]; final int[] wordsFoundCount = new int[1]; IdTa...
checkIfGivenXmlHasTheseWords
304,745
void (final CharSequence chars, char @Nullable [] charsArray, int start, int end) { if (wordsFoundCount[0] == words.length) return; final int foundWordLen = end - start; Next: for (int i = 0; i < words.length; ++i) { final String localName = words[i]; if (wordsFound[i] || localName.length() != foundWordLen) continue; f...
run
304,746
void (final MetaHandler metaHandler, final PsiFile file, final ExternalUriProcessor processor) { ProgressManager.getInstance().runProcessWithProgressSynchronously( () -> ReadAction.run(() -> processExternalUrisImpl(metaHandler, file, processor)), XmlPsiBundle.message("xml.progress.finding.acceptable.uri"), false, file....
processExternalUris
304,747
boolean (final PsiMetaData metaData, final String url) { if (metaData instanceof XmlNSDescriptorImpl nsDescriptor) { final XmlElementDescriptor descriptor = nsDescriptor.getElementDescriptor(searchFor(), url); return descriptor != null && !(descriptor instanceof AnyXmlElementDescriptor); } return false; }
isAcceptableMetaData
304,748
String () { return myName; }
searchFor
304,749
void (final MetaHandler metaHandler, final PsiFile file, final ExternalUriProcessor processor) { final ProgressIndicator pi = ProgressManager.getInstance().getProgressIndicator(); final String searchFor = metaHandler.searchFor(); if (pi != null) { pi.setText(XmlPsiBundle.message("xml.progress.looking.in.schemas")); pi....
processExternalUrisImpl
304,750
boolean (@NotNull Project project, Editor editor, PsiFile file) { return file.getLanguage().isKindOf(XMLLanguage.INSTANCE) && getText(editor, file) != null && !file.getLanguage().isKindOf(HTMLLanguage.INSTANCE); }
isAvailable
304,751
PsiElement (Editor editor, PsiFile file) { int offset = editor.getCaretModel().getOffset(); PsiElement element = file.findElementAt(offset); PsiElement parent = element != null ? element.getParent() : null; if (isText(parent)) return parent; element = file.findElementAt(offset - 1); parent = element != null ? element.g...
getText
304,752
boolean (PsiElement element) { if (element instanceof XmlText) return true; if (element instanceof XmlEntityRef && element.getParent() instanceof XmlText) return true; return false; }
isText
304,753
boolean () { return true; }
startInWriteAction
304,754
String () { return XmlPsiBundle.message("xml.quickfix.insert.required.attribute.text", myAttrName); }
getText
304,755
String () { return XmlPsiBundle.message("xml.quickfix.insert.required.attribute.family"); }
getFamilyName
304,756
void (final @NotNull Project project, @NotNull PsiFile file, final @Nullable Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { XmlTag myTag = (XmlTag)startElement; ASTNode treeElement = SourceTreeToPsiMap.psiElementToTree(myTag); final XmlElementDescriptor descriptor = myTag.getDescript...
invoke
304,757
String () { return getText(); }
getFamilyName
304,758
boolean () { return false; }
startInWriteAction
304,759
boolean (String inputString) { return !ns.contains(inputString) && isValidPrefix(inputString, project); }
checkInput
304,760
boolean (String inputString) { return checkInput(inputString); }
canClose
304,761
void (@NotNull XmlTag tag) { if (tag.getNamespace().equals(namespace) && tag.getNamespacePrefix().isEmpty()) { tags.add(tag); } super.visitXmlTag(tag); }
visitXmlTag
304,762
void (@NotNull XmlAttributeValue value) { PsiReference ref = null; boolean skip = false; for (PsiReference reference : value.getReferences()) { if (reference instanceof TypeOrElementOrAttributeReference) { ref = reference; } else if (reference instanceof SchemaPrefixReference) { skip = true; break; } } if (!skip && ref...
visitXmlAttributeValue
304,763
boolean (String prefix, Project project) { try { XmlTag tag = XmlElementFactory.getInstance(project).createTagFromText("<" + prefix + ":foo/>"); return "foo".equals(tag.getLocalName()); } catch (IncorrectOperationException e) { return false; } }
isValidPrefix
304,764
boolean (@NotNull Project project, Editor editor, @NotNull PsiElement element) { return getXmlnsDeclaration(element) != null; }
isAvailable
304,765
void (@NotNull XmlTag tag) { if (ns.equals(tag.getNamespacePrefix())) { tags.add(tag); } super.visitXmlTag(tag); }
visitXmlTag
304,766
void (@NotNull XmlAttributeValue value) { if (value.getValue().startsWith(ns + ":")) { for (PsiReference ref : value.getReferences()) { if (ref instanceof SchemaPrefixReference && ref.isReferenceTo(prefix)) { attrs.add((XmlAttribute)value.getParent()); } } } }
visitXmlAttributeValue
304,767
void (String ns, final List<? extends XmlTag> tags, final List<? extends XmlAttribute> attrs, Project project) { final int localNameIndex = ns.length() + 1; final int totalCount = tags.size() + attrs.size(); final SequentialModalProgressTask progressTask = new SequentialModalProgressTask( project, XmlBundle.message("xm...
convertTagsAndAttributes
304,768
boolean () { return tagIndex + attrIndex >= totalCount; }
isDone
304,769
boolean () { progressTask.getIndicator().setFraction(((double)(tagIndex + attrIndex)) / totalCount); ApplicationManager.getApplication().runWriteAction(() -> { if (tagIndex < tags.size()) { XmlTag tag = tags.get(tagIndex++); final String s = tag.getName().substring(localNameIndex); if (!s.isEmpty()) { tag.setName(s); }...
iteration
304,770
boolean (@NotNull Project project, Editor editor, @NotNull PsiElement element) { return getXmlnsDeclaration(element) != null; }
isAvailable
304,771
String () { return getText(); }
getFamilyName
304,772
boolean () { return false; }
startInWriteAction
304,773
void (final @NotNull JList<? extends String> list, final @NlsSafe String value, final int index, final boolean selected, final boolean hasFocus) { append(value, SimpleTextAttributes.REGULAR_ATTRIBUTES); setIcon(AllIcons.Nodes.Static); setPaintFocusBorder(false); }
customizeCellRenderer
304,774
boolean (@NotNull Project project, Editor editor, PsiFile file) { XmlTag tag = getTag(editor, file); if (tag == null) return false; if (tag.getAttributes().length <= 1) return false; int offset = editor.getCaretModel().getOffset(); ASTNode startEnd = XmlChildRole.START_TAG_END_FINDER.findChild(tag.getNode()); if (start...
isAvailable
304,775
Collection<TextRange> (@NotNull PsiFile file, boolean processChangedTextOnly) { return Collections.singleton(marker.getTextRange()); }
getRangesToFormat
304,776
boolean () { return true; }
startInWriteAction
304,777
XmlTag (@Nullable Editor editor, PsiFile file) { if (!(file instanceof XmlFile)) return null; int offset = editor.getCaretModel().getOffset(); PsiElement element = file.findElementAt(offset); XmlTag parent = PsiTreeUtil.getParentOfType(element, XmlTag.class); if (parent != null) return parent; element = file.findElemen...
getTag
304,778
boolean () { final int offset = myElement.getTextOffset(); final RangeMarker marker = myEditor.getDocument().createRangeMarker(offset, offset); Consumer<String> consumer = (namespace) -> { if (namespace != null) { final Project project = myFile.getProject(); WriteCommandAction.writeCommandAction(project, myFile) . run(...
execute
304,779
boolean (@NotNull Project project, Editor editor, PsiFile file) { return getCData(editor, file) != null; }
isAvailable
304,780
PsiElement (Editor editor, PsiFile file) { int offset = editor.getCaretModel().getOffset(); PsiElement element = file.findElementAt(offset); PsiElement parent = element != null ? element.getParent() : null; if (parent != null && parent.getNode() != null && parent.getNode().getElementType() == XmlElementType.XML_CDATA) ...
getCData
304,781
boolean () { return true; }
startInWriteAction
304,782
boolean (@NotNull Project project, Editor editor, PsiFile file) { XmlTag tag = getTag(editor, file); if (tag == null) return false; int offset = editor.getCaretModel().getOffset(); ASTNode startEnd = XmlChildRole.START_TAG_END_FINDER.findChild(tag.getNode()); if (startEnd == null || offset <= startEnd.getStartOffset())...
isAvailable
304,783
boolean () { return true; }
startInWriteAction
304,784
XmlTag (Editor editor, PsiFile file) { int offset = editor.getCaretModel().getOffset(); PsiElement element = file.findElementAt(offset); PsiElement parent = element != null ? element.getParent() : null; if (parent instanceof XmlTag) return (XmlTag)parent; if (parent instanceof XmlAttribute) return null; element = file....
getTag
304,785
TextRange (final XmlAttributeValue xmlAttributeValue) { ASTNode valueNode = XmlChildRole.ATTRIBUTE_VALUE_VALUE_FINDER.findChild(xmlAttributeValue.getNode()); PsiElement toHighlight = valueNode == null ? xmlAttributeValue : valueNode.getPsi(); TextRange childRange = toHighlight.getTextRange(); TextRange range = xmlAttri...
xmlAttributeValueRange
304,786
PsiReference[] (final XmlAttributeValue value) { boolean hasNonStandardTokens = ContainerUtil.exists(value.getChildren(), ch -> !ATTRIBUTE_VALUE_STD_TOKENS.contains(ch.getNode().getElementType())); if (hasNonStandardTokens) return PsiReference.EMPTY_ARRAY; String text = value.getValue(); int start = text.indexOf(CHARSE...
extractFromContentAttribute
304,787
int (@NotNull XmlEncodingReference ref) { return myPriority - ref.myPriority; }
compareTo
304,788
String (final Object element) { if (element instanceof XmlTag) { return ((XmlTag)element).getLocalName(); } else { return super.getTextByElement(element); } }
getTextByElement
304,789
Block (@NotNull ASTNode node, @NotNull Block originalBlock, Indent indent, int offset, TextRange range, @Nullable Language language) { return new AnotherLanguageBlockWrapper(node, myXmlFormattingPolicy, originalBlock, indent, offset, range); }
createInjectedBlock
304,790
Block (ASTNode node, Wrap wrap, Alignment alignment, Indent indent, TextRange range) { return new XmlBlock(node, wrap, alignment, myXmlFormattingPolicy, indent, range); }
createBlockBeforeInjection
304,791
Block (ASTNode node, Wrap wrap, Alignment alignment, Indent indent, TextRange range) { return new XmlBlock(node, wrap, alignment, myXmlFormattingPolicy, indent, range); }
createBlockAfterInjection
304,792
CodeStyleSettings () { return myXmlFormattingPolicy.getSettings(); }
getSettings
304,793
boolean (String text, final ASTNode injectionHost) { IElementType type = injectionHost.getElementType(); if (type == XmlElementType.XML_TEXT) { return true; } else if (type == XmlElementType.XML_COMMENT) { // <!--[if IE]>, <![endif]--> of conditional comments injection return true; } return text.isEmpty(); }
canProcessFragment
304,794
Spacing (Block child1, @NotNull Block child2) { return null; }
getSpacing
304,795
boolean () { return true; }
isLeaf
304,796
List<Block> () { return EMPTY; }
buildChildren
304,797
boolean (final XmlTag parentTag) { if (parentTag == null) { return true; } final PsiElement firstChild = findFirstNonEmptyChild(parentTag); if (firstChild == null) { return false; } if (firstChild.getNode().getElementType() != XmlTokenType.XML_START_TAG_START) { return false; } if (myHtmlCodeStyleSettings.HTML_DO_NOT_A...
indentChildrenOf
304,798
PsiElement (final XmlTag parentTag) { PsiElement result = parentTag.getFirstChild(); while (result != null && result.getTextLength() == 0) { result = result.getNextSibling(); } return result; }
findFirstNonEmptyChild
304,799
int (final XmlTag parentTag) { final TextRange textRange = parentTag.getTextRange(); return myDocumentModel.getLineNumber(textRange.getEndOffset()) - myDocumentModel.getLineNumber(textRange.getStartOffset()) + 1; }
getLines