Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
304,000
void (@NotNull XmlAttributeValue value) { //use original range to check because while we are modifying document, element ranges returned from getTextRange() are not updated. if (myOriginalRange.contains(value.getTextRange())) { PsiElement child = value.getFirstChild(); if (child != null && !containsQuoteChars(value) //...
visitXmlAttributeValue
304,001
void (int start, int end, String newValue) { final int mappedStart = myPostProcessorHelper.mapOffset(start); final int mappedEnd = myPostProcessorHelper.mapOffset(end); myDocument.replaceString(mappedStart, mappedEnd, newValue); myPostProcessorHelper.updateResultRange(end - start, newValue.length()); }
replaceString
304,002
void (int offset, String value) { final int mappedOffset = myPostProcessorHelper.mapOffset(offset); myDocument.insertString(mappedOffset, value); myPostProcessorHelper.updateResultRange(0, value.length()); }
insertString
304,003
boolean (@NotNull XmlAttributeValue value) { for (PsiElement child = value.getFirstChild(); child != null; child = child.getNextSibling()) { if (!isDelimiter(child.getNode().getElementType()) && StringUtil.contains(child.getNode().getChars(), myNewQuote)) { return true; } } return false; }
containsQuoteChars
304,004
boolean (@NotNull IElementType elementType) { return elementType == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER || elementType == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER; }
isDelimiter
304,005
void () { if (myDocument == null) return; runSimple(); myDocumentManager.commitDocument(myDocument); }
run
304,006
void () { if (myDocument == null) return; myDocumentManager.doPostponedOperationsAndUnblockDocument(myDocument); myContext.accept(this); }
runSimple
304,007
void (@NotNull CodeStyleSettings.QuoteStyle quoteStyle, @NotNull PsiElement element) { CommonCodeStyleSettings settings = CodeStyle.getSettings(element.getContainingFile()).getCommonSettings(HTMLLanguage.INSTANCE); PostFormatProcessorHelper postFormatProcessorHelper = new PostFormatProcessorHelper(settings); postFormat...
runOnElement
304,008
FormattingModel (@NotNull FormattingContext formattingContext) { final PsiFile psiFile = formattingContext.getContainingFile(); final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(psiFile); return new XmlFormattingModel( psiFile, new XmlBlock(SourceTreeToPsiMap.psiElementToTree(psiFil...
createModel
304,009
String () { return null; }
getLineCommentPrefix
304,010
String () { return "<!--"; }
getBlockCommentPrefix
304,011
String () { return "-->"; }
getBlockCommentSuffix
304,012
String () { return "&lt;!&ndash;"; }
getCommentedBlockCommentPrefix
304,013
String () { return "&ndash;&gt;"; }
getCommentedBlockCommentSuffix
304,014
void (Document document, RangeMarker range) { String prefix = getBlockCommentPrefix(); String suffix = getBlockCommentSuffix(); int start = range.getStartOffset(); int prefixStart = start = CharArrayUtil.shiftForward(document.getCharsSequence(), start, " \t\n"); if (CharArrayUtil.regionMatches(document.getCharsSequence...
escape
304,015
void (Document document, RangeMarker range) { final int start = range.getStartOffset(); for (int i = range.getEndOffset(); i >= start; i--) { if (CharArrayUtil.regionMatches(document.getCharsSequence(), i, ESCAPED_DOUBLE_DASH)) { document.replaceString(i, i + ESCAPED_DOUBLE_DASH.length(), DOUBLE_DASH); } } if (CharArra...
unescape
304,016
boolean (@NotNull PsiElement e) { return true; }
isApplicableTo
304,017
void (@NotNull PsiElement element, @NotNull Set<PsiElement> result) { }
collectElementsToIgnore
304,018
String (@NotNull PsiElement e) { return XmlBundle.message("xml.action.unwrap.enclosing.tag.name.description", ((XmlTag)e).getName()); }
getDescription
304,019
PsiElement (@NotNull PsiElement element, @NotNull List<? super PsiElement> toExtract) { final TextRange range = element.getTextRange(); final ASTNode startTagNameEnd = XmlChildRole.START_TAG_END_FINDER.findChild(element.getNode()); final ASTNode endTagNameStart = XmlChildRole.CLOSING_TAG_START_FINDER.findChild(element....
collectAffectedElements
304,020
void (Document document, int offset) { int line = offset < document.getTextLength() ? document.getLineNumber(offset) : -1; if (line > 0 && DocumentUtil.isLineEmpty(document, line)) { int start = document.getLineStartOffset(line); int end = Math.min(document.getLineEndOffset(line) + 1, document.getTextLength() - 1); if ...
deleteEmptyLine
304,021
boolean (final IElementType element) { return super.isWordCompletionEnabledIn(element) || ENABLED_TOKENS.contains(element); }
isWordCompletionEnabledIn
304,022
boolean (final String newName, final PsiElement element, final ProcessingContext context) { return newName.trim().matches("([\\d\\w\\_\\.\\-]+:)?[\\d\\w\\_\\.\\-]+"); }
isInputValid
304,023
boolean (final String newName, final PsiElement element, final ProcessingContext context) { return true; }
isInputValid
304,024
String (final TextRange textRange, String whiteSpace, ASTNode leafElement) { if (!myCanModifyAllWhiteSpaces) { if (leafElement.getElementType() == TokenType.WHITE_SPACE) return null; LOG.assertTrue(leafElement.getPsi().isValid()); ASTNode prevNode = TreeUtil.prevLeaf(leafElement); if (prevNode != null) { IElementType t...
replaceWithPsiInLeaf
304,025
boolean () { return true; }
showOptionsDialog
304,026
boolean () { return false; }
shouldTryToRestoreCaretPosition
304,027
boolean () { return false; }
isExclusive
304,028
boolean (final TemplateImpl template) { TemplateContext context = template.getTemplateContext(); return context.isEnabled(TemplateContextTypes.getByClass(XmlContextType.class)) || context.isEnabled(TemplateContextTypes.getByClass(HtmlContextType.class)); }
isEnabled
304,029
FormattingModel (@NotNull FormattingContext formattingContext) { final ASTNode root = TreeUtil.getFileElement((TreeElement)SourceTreeToPsiMap.psiElementToTree(formattingContext.getPsiElement())); PsiFile containingFile = formattingContext.getContainingFile(); final FormattingDocumentModelImpl documentModel = Formatting...
createModel
304,030
XmlBlock (CodeStyleSettings settings, ASTNode root, FormattingDocumentModelImpl documentModel) { return new XmlBlock(root, null, null, new XmlPolicy(settings, documentModel), null, null, false); }
createBlock
304,031
void (final ASTNode treePrev, final LeafElement whiteSpaceElement) { final CharTable charTable = SharedImplUtil.findCharTableByTree(treePrev); final ASTNode treeParent = treePrev.getTreeParent(); final boolean before; final XmlText xmlText; if(treePrev.getElementType() == XmlElementType.XML_TEXT) { xmlText = (XmlText)t...
addWhitespaceToTagBody
304,032
boolean (@NotNull ASTNode place) { final ASTNode treeParent = place.getTreeParent(); if (!(treeParent.getElementType() instanceof IXmlTagElementType)) return false; while(place != null){ if(place.getElementType() == XmlTokenType.XML_TAG_END) return true; place = place.getTreePrev(); } return false; }
isInsideTagBody
304,033
boolean (final @NotNull ASTNode treePrev, final @NotNull LeafElement whiteSpaceElement) { if (isInsideTagBody(treePrev)) { addWhitespaceToTagBody(treePrev, whiteSpaceElement); return true; } return false; }
addWhitespace
304,034
boolean (final @NotNull ASTNode node) { return (node.getElementType() == XmlTokenType.XML_DATA_CHARACTERS) && node.getText().trim().length() == 0; }
containsWhitespacesOnly
304,035
String () { return "XML.Catalog.Dialog"; }
getHelpTopic
304,036
JComponent () { return myPanel; }
createComponent
304,037
void () { myPropertyFile.setText(ExternalResourceManagerEx.getInstanceEx().getCatalogPropertiesFile()); }
reset
304,038
boolean () { return !StringUtil.notNullize(ExternalResourceManagerEx.getInstanceEx().getCatalogPropertiesFile()).equals(myPropertyFile.getText()); }
isModified
304,039
void (@NotNull DocumentEvent e) { validateInput(); }
textChanged
304,040
void (String uri, @NotNull Project project, @Nullable PsiFile file, @Nullable String location) { DefaultMutableTreeNode root = new DefaultMutableTreeNode(); mySchemasTree.setModel(new DefaultTreeModel(root)); ConfigFileSearcher searcher = new ConfigFileSearcher(file == null ? null : ModuleUtilCore.findModuleForPsiEleme...
setupSchemasTree
304,041
Set<PsiFile> (@Nullable Module module, @NotNull Project project) { List<IndexedRelevantResource<String, XsdNamespaceBuilder>> resources = XmlNamespaceIndex.getAllResources(module, project); HashSet<PsiFile> files = new HashSet<>(); PsiManager psiManager = PsiManager.getInstance(project); for (IndexedRelevantResource<St...
search
304,042
void (@NotNull JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { ConfigFilesTreeBuilder.renderNode(value, expanded, this); }
customizeCellRenderer
304,043
void (MouseEvent e) { if (e.getClickCount() > 1 && isOKActionEnabled()) { doOKAction(); } }
mouseClicked
304,044
void (TreeSelectionEvent e) { validateInput(); }
valueChanged
304,045
void () { setOKActionEnabled(!StringUtil.isEmpty(myUri.getText()) && getResourceLocation() != null); }
validateInput
304,046
JComponent () { return myMainPanel; }
createCenterPanel
304,047
JComponent () { return StringUtil.isEmpty(myUri.getText()) ? myUri : mySchemaFound ? mySchemasTree : myFileTextField.getTextField(); }
getPreferredFocusedComponent
304,048
Dimension () { return new Dimension(400, 300); }
getPreferredSize
304,049
String () { return myUri.getText(); }
getUri
304,050
void () { FileTextField field = FileChooserFactory.getInstance().createFileTextField(FILE_CHOOSER_DESCRIPTOR, getDisposable()); myFileTextField = new TextFieldWithBrowseButton(field.getField()); }
createUIComponents
304,051
JComponent () { JPanel panel = new JPanel(new GridBagLayout()); panel.add( new JLabel(myName), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 3, 5), 0, 0) ); panel.add( myTfUrl, new GridBagConstraints(0, 1, 2, 1, 1, 0, GridBagConstraints.WEST, GridBagConstrai...
createCenterPanel
304,052
void (ActionEvent ignored) { FileChooserDescriptor descriptor = getChooserDescriptor(); FileChooser.chooseFile(descriptor, myProject, null, file -> myTfPath.setText(file.getPath().replace('/', File.separatorChar))); }
actionPerformed
304,053
JComponent () { return myTfUrl; }
getPreferredFocusedComponent
304,054
NameLocationPair () { String path = myTfPath.getText().trim(); String url = myTfUrl.getText().trim(); return new NameLocationPair(url, path, myTfShared); }
getPair
304,055
FileChooserDescriptor () { return new FileChooserDescriptor(true, false, false, false, true, false); }
getChooserDescriptor
304,056
void () { setTitle(myTitle); myTfUrl = new JTextField(); myTfPath = new JTextField(); myBtnBrowseLocalPath = new FixedSizeButton(myTfPath); super.init(); }
init
304,057
void (NameLocationPair origin) { myTfUrl.setText(origin.myName); myTfPath.setText(origin.myLocation); myTfShared = origin.myShared; }
init
304,058
Set<VirtualFile> () { Set<VirtualFile> standardResources = myStandardResources.getValue(); Set<VirtualFile> roots = new HashSet<>(standardResources.size() + 1); roots.addAll(standardResources); String path = FetchExtResourceAction.getExternalResourcesPath(); VirtualFile extResources = LocalFileSystem.getInstance().find...
getAdditionalRootsToIndex
304,059
String () { if (myHtml4RadioButton.isSelected()) { return XmlUtil.XHTML4_SCHEMA_LOCATION; } if (myHtml5RadioButton.isSelected()) { return Html5SchemaProvider.getHtml5SchemaLocation(); } return myDoctypeTextField.getText(); }
getDoctype
304,060
void (ActionEvent e) { myDoctypeTextField.setEnabled(myOtherRadioButton.isSelected()); }
actionPerformed
304,061
boolean () { return !ExternalResourceManagerEx.getInstanceEx().getDefaultHtmlDoctype(myProject).equals(getDoctype()) || ExternalResourceManagerEx.getInstanceEx().getXmlSchemaVersion(myProject) != getSchemaVersion(); }
isModified
304,062
void () { final String doctype = ExternalResourceManagerEx.getInstanceEx().getDefaultHtmlDoctype(myProject); if (doctype.isEmpty() || doctype.equals(XmlUtil.XHTML4_SCHEMA_LOCATION)) { myHtml4RadioButton.setSelected(true); myDoctypeTextField.setEnabled(false); } else if (doctype.equals(Html5SchemaProvider.getHtml5Schema...
reset
304,063
String () { return XmlBundle.message("xml.external.resource.display.name"); }
getDisplayName
304,064
JComponent () { myPanel = new JPanel(new GridBagLayout()) { @Override public Dimension getPreferredSize() { return new Dimension(-1, 400); } }; myExtPanel = new AddEditRemovePanel<>(new ExtUrlsTableModel(), myPairs, XmlBundle.message( "xml.external.resource.label.external.resources")) { @Override protected NameLocation...
createComponent
304,065
Dimension () { return new Dimension(-1, 400); }
getPreferredSize
304,066
NameLocationPair () { return addExtLocation(); }
addItem
304,067
boolean (NameLocationPair o) { setModified(true); return true; }
removeItem
304,068
NameLocationPair (NameLocationPair o) { return editExtLocation(o); }
editItem
304,069
void (TableModelEvent e) { setModified(true); }
tableChanged
304,070
String () { return addIgnoreLocation(); }
addItem
304,071
boolean (String o) { setModified(true); return true; }
removeItem
304,072
String (String o) { return editIgnoreLocation(o); }
editItem
304,073
void () { ApplicationManager.getApplication().runWriteAction(() -> { ExternalResourceManagerEx manager = ExternalResourceManagerEx.getInstanceEx(); if (myProject == null) { manager.clearAllResources(); } else { manager.clearAllResources(myProject); } for (NameLocationPair pair : myPairs) { String s = FileUtil.toSystemI...
apply
304,074
void () { myPairs = new ArrayList<>(myNewPairs); ExternalResourceManagerEx manager = ExternalResourceManagerEx.getInstanceEx(); String[] urls = manager.getAvailableUrls(); for (String url : urls) { String loc = myProject == null ? manager.getResourceLocation(url, (String)null) : manager.getResourceLocation(url, myProje...
reset
304,075
void () { myPanel = null; myExtPanel = null; myIgnorePanel = null; }
disposeUIResources
304,076
String () { return "preferences.externalResources"; }
getHelpTopic
304,077
Component (JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { final Component rendererComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (value != null) { String loc = value.toString().replace('\\', '/'); final int jarDelimIndex = l...
getTableCellRendererComponent
304,078
int () { return myNames.length; }
getColumnCount
304,079
Object (String o, int columnIndex) { return o; }
getField
304,080
String (int column) { return myNames[column]; }
getColumnName
304,081
int () { return myNames.length; }
getColumnCount
304,082
Object (NameLocationPair pair, int columnIndex) { return switch (columnIndex) { case 0 -> pair.myName; case 1 -> pair.myLocation; case 2 -> !pair.myShared; default -> ""; }; }
getField
304,083
Class (int columnIndex) { return columnIndex == 2 ? Boolean.class : String.class; }
getColumnClass
304,084
boolean (int column) { return column == 2; }
isEditable
304,085
void (Object aValue, NameLocationPair data, int columnIndex) { data.myShared = !((Boolean)aValue).booleanValue(); }
setValue
304,086
String (int column) { return myNames[column]; }
getColumnName
304,087
int (Object o) { return myName.compareTo(((NameLocationPair)o).myName); }
compareTo
304,088
boolean (Object obj) { if (! (obj instanceof NameLocationPair)) return false; return compareTo(obj) == 0; }
equals
304,089
int () { return myName.hashCode(); }
hashCode
304,090
String () { return myName; }
getName
304,091
String () { return myLocation; }
getLocation
304,092
LocalQuickFixAndIntentionActionOnPsiElement (@NotNull XmlTag tag, @NotNull String attrName, String @NotNull ... values) { return new InsertRequiredAttributeFix(tag, attrName, values); }
insertRequiredAttributeFix
304,093
LocalQuickFix (@NotNull PsiElement element, @NotNull String namespacePrefix, @Nullable XmlToken token) { return new CreateNSDeclarationIntentionFix(element, namespacePrefix, token); }
createNSDeclarationIntentionFix
304,094
LocalQuickFixAndIntentionActionOnPsiElement (@NotNull XmlAttribute attribute) { return new AddAttributeValueIntentionFix(attribute); }
addAttributeValueFix
304,095
OptPane () { return pane( expandableString("myAdditionalRequiredHtmlAttributes", XmlBundle.message("inspection.javadoc.html.not.required.label.text"), ",") ); }
getOptionsPane
304,096
OptPane () { return pane( checkbox("myCustomValuesEnabled", XmlAnalysisBundle.message("html.inspections.unknown.tag.boolean.attribute.checkbox.title"), stringList("myValues", "")) ); }
getOptionsPane
304,097
OptPane () { return pane( checkbox("myCustomValuesEnabled", XmlAnalysisBundle.message("html.inspections.unknown.tag.checkbox.title"), stringList("myValues", "")) ); }
getOptionsPane
304,098
String () { return text; }
getText
304,099
boolean () { return false; }
startInWriteAction