Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
6,800
boolean (@NotNull String forValue) { return myForValuesOfLabels.contains(forValue); }
hasForValue
6,801
void (@NotNull XmlTag tag) { super.visitXmlTag(tag); if ("label".equals(StringUtil.toLowerCase(tag.getName()))) { for (XmlAttribute attribute : tag.getAttributes()) { if ("for".equals(StringUtil.toLowerCase(attribute.getLocalName()))) { String id = attribute.getValue(); if (id != null) { myHolder.registerForValue(id); ...
visitXmlTag
6,802
String () { return SHORT_NAME; }
getShortName
6,803
void (@NotNull XmlTag tag, @NotNull ProblemsHolder holder, boolean isOnTheFly) { if (!HtmlUtil.isHtmlTagContainingFile(tag)) { return; } final String tagName = StringUtil.toLowerCase(tag.getName()); if (ourElementsWithoutTitle.contains(tagName)) { final XmlAttribute title = tag.getAttribute(TITLE); if (title != null) {...
checkTag
6,804
String () { return HtmlToolsBundle.message("html.intention.insert.attribute", TITLE); }
getText
6,805
String () { return "HtmlRequiredTitleAttribute"; }
getShortName
6,806
String () { return "HtmlFormInputWithoutLabel"; }
getShortName
6,807
void (@NotNull XmlTag tag, @NotNull ProblemsHolder holder, boolean isOnTheFly) { PsiFile file = tag.getContainingFile(); Language language = file.getLanguage(); // Support JSP & JSPX but exclude JavaScript Frameworks if (!(!(language instanceof HTMLLanguage) || language == HTMLLanguage.INSTANCE)) return; if (!HtmlUtil....
checkTag
6,808
boolean (@NotNull XmlAttribute attribute) { XmlTag parent = attribute.getParent(); if (parent != null) { return attribute.equals(IdRefReference.getImplicitIdRefAttr(parent)); } return false; }
isImplicitIdAttribute
6,809
void (XmlTag tag, ProblemsHolder holder) { if (InjectedLanguageManager.getInstance(tag.getProject()).getInjectionHost(tag) != null) return; List<LocalQuickFix> fixes = new ArrayList<>(); Pair<PsiElement, PsiElement> pair = getNearestText(tag, new ForwardIterator()); if (pair != null) { fixes.add(new CreateLabelFromText...
registerProblem
6,810
PsiElement (PsiElement element) { return element.getNextSibling(); }
getNext
6,811
PsiElement (PsiElement element) { return element.getPrevSibling(); }
getNext
6,812
void (@NotNull XmlTag tag, @NotNull ProblemsHolder holder, boolean isOnTheFly) { if (!HtmlUtil.isHtmlTagContainingFile(tag)) return; if (!tag.getName().equalsIgnoreCase(HEAD)) return; if (XmlCustomElementDescriptor.isCustomElement(tag)) return; final XmlTag[] subTags = tag.getSubTags(); long count = Arrays.stream(subTa...
checkTag
6,813
String () { return "HtmlRequiredTitleElement"; }
getShortName
6,814
void (@NotNull XmlTag tag, @NotNull ProblemsHolder holder, boolean isOnTheFly) { if (!HtmlUtil.isHtmlTagContainingFile(tag)) return; final XmlAttribute lang = tag.getAttribute(LANG); final XmlAttribute xmlLang = tag.getAttribute(XML_LANG); final String tagName = tag.getName(); List<LocalQuickFix> fixes = new ArrayList<...
checkTag
6,815
String () { return "HtmlRequiredLangAttribute"; }
getShortName
6,816
void (@NotNull XmlTag tag, @NotNull ProblemsHolder holder, @NotNull List<@NotNull LocalQuickFix> fixes, @InspectionMessage String text, @NotNull ProblemHighlightType severity) { PsiElement toRegister = XmlTagUtil.getStartTagNameElement(tag); if (toRegister == null) return; InspectionManager manager = holder.getManager(...
RegisterProblem
6,817
void (@NotNull XmlTag tag, @NotNull ProblemsHolder holder, boolean isOnTheFly) { if (!HtmlUtil.isHtmlTagContainingFile(tag)) return; if (tag.getAttribute(ALT) != null) return; if (XmlExtension.getExtension(tag.getContainingFile()).isRequiredAttributeImplicitlyPresent(tag, ALT)) return; if (XmlCustomElementDescriptor.is...
checkTag
6,818
String () { return "HtmlRequiredAltAttribute"; }
getShortName
6,819
void (@NotNull XmlAttribute attribute, @NotNull ProblemsHolder holder, boolean isOnTheFly) { if (HtmlUtil.isHtmlTagContainingFile(attribute)) { if (!HtmlUtil.isHtml5Context(attribute)) { return; } XmlAttributeDescriptor descriptor = attribute.getDescriptor(); if (descriptor == null || descriptor.getClass() != HtmlAttri...
checkAttribute
6,820
void (@NotNull XmlTag tag, @NotNull ProblemsHolder holder, boolean isOnTheFly) { if (!HtmlUtil.isHtmlTagContainingFile(tag)) return; final String tagName = StringUtil.toLowerCase(tag.getName()); if (!tagName.equalsIgnoreCase(TABLE)) return; List<LocalQuickFix> fixes = new ArrayList<>(); if (tag.getAttribute(SUMMARY) !=...
checkTag
6,821
String () { return super.getShortName(); }
getShortName
6,822
String () { return HtmlToolsBundle.message("html.inspections.create.new.label", myName); }
getFamilyName
6,823
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { XmlTag myTag = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), XmlTag.class); if (myTag == null) return; XmlAttributeValue id = findIdValue(myTag); if (id != null) { PsiElement added = myTag.getParent().addBefore(createLabelFor(myTag, id),...
applyFix
6,824
XmlTag (@NotNull XmlTag place, @NotNull XmlAttributeValue id) { XmlTag tag = createElementFromText(place.getProject(), place, "<label for=\"x\"></label>"); //noinspection ConstantConditions tag.getAttribute("for").getValueElement().replace(id); return tag; }
createLabelFor
6,825
XmlText (@NotNull Project project) { return XmlElementFactory.getInstance(project).createTagFromText("<a>\n</a>").getValue().getTextElements()[0]; }
createNewline
6,826
XmlTag (Project project, XmlTag myTag, String text) { return myTag instanceof HtmlTag ? XmlElementFactory.getInstance(project).createHTMLTagFromText(text) : XmlElementFactory.getInstance(project).createXHTMLTagFromText(text); }
createElementFromText
6,827
String () { return HtmlToolsBundle.message(myBundleKey, myName); }
getFamilyName
6,828
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement e = descriptor.getPsiElement(); if (e == null) return; XmlTag myTag = PsiTreeUtil.getParentOfType(e, XmlTag.class); if (myTag == null) return; Pair<PsiElement, PsiElement> pair = HtmlFormInputWithoutLabelInspection.getNearestText(myTag,...
applyFix
6,829
String () { return HtmlToolsBundle.message("html.replace.tag.with.css.quickfix.text", myName); }
getName
6,830
String () { return getName(); }
getText
6,831
PsiElement[] (@NotNull Project project, boolean blocklevel) { final XmlFile xmlFile = HtmlTagReplaceUtil.genereateXmlFileWithSingleTag(project, blocklevel ? "div" : "span"); return HtmlTagReplaceUtil.getXmlNamesFromSingleTagFile(xmlFile); }
generateContainingElements
6,832
void (XmlTag tag, String name) { String s = tag.getAttributeValue(HtmlUtil.STYLE_ATTRIBUTE_NAME); String addString = Holder.ourTagToCssMap.get(name); if (s == null) { s = addString; } else { for (int i = s.length() - 1; i >= 0; i--) { if (!Character.isSpaceChar(s.charAt(i))) { if (s.charAt(i) != ';') { s += ';'; } brea...
addCssAttribute
6,833
void (final @NotNull Project project, final @NotNull ProblemDescriptor descriptor) { PsiElement parent = descriptor.getPsiElement(); while (parent != null) { if (parent instanceof XmlTag && Holder.ourTagToCssMap.containsKey(StringUtil.toLowerCase(((XmlTag)parent).getLocalName()))) { break; } parent = parent.getParent()...
applyFix
6,834
String () { return HtmlToolsBundle.message("html.replace.tag.with.css.quickfix.text", "font"); }
getName
6,835
PsiElement[] (@NotNull Project project, String tagName) { final XmlFile xmlFile = HtmlTagReplaceUtil.genereateXmlFileWithSingleTag(project, "span"); return HtmlTagReplaceUtil.getXmlNamesFromSingleTagFile(xmlFile); }
generateContainingElements
6,836
void (final @NotNull Project project, final @NotNull ProblemDescriptor descriptor) { PsiElement parent = descriptor.getPsiElement(); while (parent != null) { if (parent instanceof XmlTag && "font".equals(StringUtil.toLowerCase(((XmlTag)parent).getLocalName()))) { break; } parent = parent.getParent(); } if (parent == nu...
applyFix
6,837
String () { return HtmlToolsBundle.message("html.replace.tag.with.another.quickfix.text", myName, Holder.ourTagToNewTagMap.get(myName)); }
getName
6,838
PsiElement[] (@NotNull Project project, String tagName) { final XmlFile xmlFile = HtmlTagReplaceUtil.genereateXmlFileWithSingleTag(project, Holder.ourTagToNewTagMap.get(tagName)); return HtmlTagReplaceUtil.getXmlNamesFromSingleTagFile(xmlFile); }
generateContainingElements
6,839
void (final @NotNull Project project, final @NotNull ProblemDescriptor descriptor) { PsiElement parent = descriptor.getPsiElement(); while (parent != null) { if (parent instanceof XmlTag && myName.equals(StringUtil.toLowerCase(((XmlTag)parent).getLocalName()))) { break; } parent = parent.getParent(); } if (parent == nu...
applyFix
6,840
XmlFile (@NotNull Project project, String filetext) { return (XmlFile)PsiFileFactory.getInstance(project).createFileFromText("dummy.xml", XMLLanguage.INSTANCE, filetext); }
generateXmlFile
6,841
XmlFile (@NotNull Project project, String tagname) { @NonNls String filetext = "<" + tagname + "></" + tagname + ">"; return generateXmlFile(project, filetext); }
genereateXmlFileWithSingleTag
6,842
PsiElement[] (XmlFile xmlFile) { XmlTag tag = xmlFile.getDocument().getRootTag(); assert tag != null; PsiElement[] answer = new PsiElement[2]; int cnt = 0; for (PsiElement child : tag.getChildren()) { if (child instanceof XmlToken) { IElementType type = ((XmlToken)child).getTokenType(); if (type == XmlTokenType.XML_NAM...
getXmlNamesFromSingleTagFile
6,843
String () { return HtmlToolsBundle.message("html.replace.tag.with.another.quickfix.text", "applet", "object"); }
getName
6,844
PsiElement[] (@NotNull Project project, String tagName) { final XmlFile xmlFile = HtmlTagReplaceUtil.genereateXmlFileWithSingleTag(project, "object"); return HtmlTagReplaceUtil.getXmlNamesFromSingleTagFile(xmlFile); }
generateContainingElements
6,845
void (final @NotNull Project project, final @NotNull ProblemDescriptor descriptor) { PsiElement parent = descriptor.getPsiElement(); while (parent != null) { if (parent instanceof XmlTag && "applet".equals(StringUtil.toLowerCase(((XmlTag)parent).getLocalName()))) { break; } parent = parent.getParent(); } if (parent == ...
applyFix
6,846
boolean (@NotNull PsiFile file) { // Shouldn't work for inherited languages like Vue or Angular2HTML return file.getLanguage() == HTMLLanguage.INSTANCE || file.getLanguage() == XHTMLLanguage.INSTANCE; }
isAvailableForFile
6,847
void (final String includePath, final XmlTagChild first, final XmlTagChild last) { ApplicationManager.getApplication().runWriteAction(() -> { final XmlTag parentTag = first.getParentTag(); LOG.assertTrue(parentTag != null); try { final XmlElementDescriptor descriptor = parentTag.getDescriptor(); LOG.assertTrue(descript...
doReplaceRange
6,848
boolean (final XmlTagChild first, final XmlTagChild last) { final Language language = first.getLanguage(); if (first != last || Language.findInstance(HTMLLanguage.class).equals(language) || Language.findInstance(XHTMLLanguage.class).equals(language) ) { return false; } final XmlTag parentTag = first.getParentTag(); ret...
verifyChildRange
6,849
boolean (@Nullable XmlElementDescriptor descriptor) { if (descriptor == null) return false; final @NonNls String name = descriptor.getName(); return HtmlUtil.STYLE_TAG_NAME.equals(name) || HtmlUtil.SCRIPT_TAG_NAME.equals(name); }
isAvailableOnDescriptor
6,850
boolean (@NotNull PsiErrorElement element) { PsiFile containingFile = element.getContainingFile(); return containingFile.getLanguage() != XHTMLLanguage.INSTANCE || !(InjectedLanguageManager.getInstance(containingFile.getProject()).getInjectionHost(containingFile) instanceof PsiComment) || !element.getErrorDescription()...
shouldHighlightErrorElement
6,851
boolean () { return true; }
isEnabledByDefault
6,852
String () { return myFamilyName; }
getFamilyName
6,853
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final XmlAttributeValue value = (XmlAttributeValue)descriptor.getPsiElement(); if (value == null) return; try { final PsiReference[] refs = value.getReferences(); if (refs.length != 1) return; ElementManipulators.handleContentChange(value, refs[0]...
applyFix
6,854
PsiElementVisitor (final @NotNull ProblemsHolder holder, boolean isOnTheFly) { return new XmlElementVisitor() { @Override public void visitXmlAttribute(@NotNull XmlAttribute attribute) { XmlTag parent = attribute.getParent(); if (!(parent instanceof HtmlTag) || XmlHighlightVisitor.isInjectedWithoutValidation(parent)) {...
buildVisitor
6,855
ElementFilter () { return new ElementFilter() { @Override public boolean isAcceptable(Object _element, PsiElement context) { PsiElement element = (PsiElement)_element; PsiFile file = element.getContainingFile(); return (HtmlUtil.hasHtml(file) || HtmlUtil.supportsXmlTypedHandlers(file)) && isAcceptableAttributeValue(ele...
getFilter
6,856
boolean (Object _element, PsiElement context) { PsiElement element = (PsiElement)_element; PsiFile file = element.getContainingFile(); return (HtmlUtil.hasHtml(file) || HtmlUtil.supportsXmlTypedHandlers(file)) && isAcceptableAttributeValue(element); }
isAcceptable
6,857
boolean (Class hintClass) { return true; }
isClassAcceptable
6,858
boolean (PsiElement element) { final PsiElement parent = element.getParent(); if (parent instanceof XmlAttribute xmlAttribute) { final @NonNls String attrName = xmlAttribute.getName(); XmlTag tag = xmlAttribute.getParent(); if (tag == null) return false; final @NonNls String tagName = tag.getName(); return ( attrName.e...
isAcceptableAttributeValue
6,859
FileType[] (@Nullable String rel) { if (rel == null) return null; for (String type : rel.split(" ")) { if ("stylesheet".equalsIgnoreCase(type)) { return findFileType("text/css"); } if (type.contains("icon") || type.contains("image")) { return IMAGE_FILE_TYPES; } } return null; }
findFileTypeByRel
6,860
FileType[] (@Nullable String mimeType) { final Collection<Language> languages = Language.findInstancesByMimeType(mimeType != null ? mimeType.trim() : null); FileType fileType = ContainerUtil.find(FileTypeManager.getInstance().getRegisteredFileTypes(), type -> type instanceof LanguageFileType && languages.contains(((Lan...
findFileType
6,861
String[] () { return new String[] {SRC_ATTR_NAME, HREF_ATTRIBUTE_NAME, USEMAP_ATTR_NAME, "action", "background", "width", "height", "type", "bgcolor", "color", "vlink", "link", "alink", "text", "name", HtmlUtil.ID_ATTRIBUTE_NAME, HtmlUtil.CLASS_ATTRIBUTE_NAME, FOR_ATTR_NAME, MicrodataUtil.ITEM_REF, "data", "poster", "s...
getAttributeValues
6,862
boolean () { return true; }
isSoft
6,863
int (@Nullable String value, @NotNull XmlElement context) { if (value == null) { return 0; } if (!HtmlUtil.isHtml5Context(context)) { value = StringUtil.trimEnd(value, "px").trim(); } return StringUtil.parseInt(value, 0); }
getSizeValue
6,864
boolean () { return true; }
isSoft
6,865
boolean (final @NotNull PsiElement element) { if (element instanceof XmlTag) { String forValue = ((XmlTag)element).getAttributeValue(IdReferenceProvider.FOR_ATTR_NAME); if (forValue != null) { result.add(forValue); } } return true; }
execute
6,866
boolean () { return true; }
isSoft
6,867
boolean () { return true; }
isSoft
6,868
boolean (@NotNull Project project, Editor editor, PsiFile file) { final int offset = editor.getCaretModel().getOffset(); if (isAvailable(getTag(file, offset))) { return true; } if (offset > 0 && isAvailable(getTag(file, offset - 1))) { myUseElementToTheLeft = true; return true; } return false; }
isAvailable
6,869
boolean (@Nullable XmlTag tag) { if (tag == null) { return false; } ImageInfo imageInfo = getImageInfo(tag); if (imageInfo == null || imageInfo.height == 0 || imageInfo.width == 0) { return false; } final String widthValue = tag.getAttributeValue(HtmlReferenceProvider.SizeReference.WIDTH_ATTR_NAME); final String height...
isAvailable
6,870
void (@NotNull PsiReferenceRegistrar registrar) { HtmlReferenceProvider provider = new HtmlReferenceProvider(); String[] htmlAttrs = HtmlReferenceProvider.getAttributeValues(); ElementFilter htmlFilter = HtmlReferenceProvider.getFilter(); XmlUtil.registerXmlAttributeValueReferenceProvider(registrar, htmlAttrs, htmlFilt...
registerReferenceProviders
6,871
void (final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) { TableColumnAdder.addColumn(project, editor, file, false); }
invoke
6,872
CodeInsightActionHandler () { return myHandler; }
getHandler
6,873
boolean (final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) { return TableColumnAdder.isActionAvailable(editor, file); }
isValidForFile
6,874
void (final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) { TableColumnAdder.addColumn(project, editor, file, true); }
invoke
6,875
CodeInsightActionHandler () { return myHandler; }
getHandler
6,876
boolean (final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) { return TableColumnAdder.isActionAvailable(editor, file); }
isValidForFile
6,877
void (final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) { TableCellNavigator.moveCaret(project, editor, file, TableCellNavigator.Directions.RIGHT); }
invoke
6,878
boolean () { return false; }
startInWriteAction
6,879
CodeInsightActionHandler () { return myHandler; }
getHandler
6,880
boolean (final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) { return TableCellNavigator.isActionAvailable(editor, file); }
isValidForFile
6,881
void (final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) { TableCellNavigator.moveCaret(project, editor, file, TableCellNavigator.Directions.UP); }
invoke
6,882
boolean () { return false; }
startInWriteAction
6,883
CodeInsightActionHandler () { return myHandler; }
getHandler
6,884
boolean (final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) { return TableCellNavigator.isActionAvailable(editor, file); }
isValidForFile
6,885
void (final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) { TableCellNavigator.moveCaret(project, editor, file, TableCellNavigator.Directions.LEFT); }
invoke
6,886
boolean () { return false; }
startInWriteAction
6,887
CodeInsightActionHandler () { return myHandler; }
getHandler
6,888
boolean (final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) { return TableCellNavigator.isActionAvailable(editor, file); }
isValidForFile
6,889
void (final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) { TableCellNavigator.moveCaret(project, editor, file, TableCellNavigator.Directions.DOWN); }
invoke
6,890
boolean () { return false; }
startInWriteAction
6,891
CodeInsightActionHandler () { return myHandler; }
getHandler
6,892
boolean (final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) { return TableCellNavigator.isActionAvailable(editor, file); }
isValidForFile
6,893
void () { myFixture.configureByText(HtmlFileType.INSTANCE, """ <!doctype html> <html lang='en'> <head> <meta charset='UTF-8'> <meta content='width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' name='viewport'> <meta http-equiv='X-UA-Compatible' content='ie=edge'> <title>Docume...
testSimple
6,894
void (@NotNull String name, String @NotNull ... expectedItems) { ((PsiManagerEx)myFixture.getPsiManager()).setAssertOnFileLoadingFilter(VirtualFileFilter.ALL, myFixture.getTestRootDisposable()); GotoSymbolModel2 model = new GotoSymbolModel2(myFixture.getProject(), myFixture.getTestRootDisposable()); assertContainsEleme...
doTest
6,895
void () { myFixture.configureByText("test.html", "<p id=<caret>\""); try { myFixture.getReferenceAtCaretPosition(); } catch (Exception e) { fail(); } }
testXHtmlCompletion
6,896
String () { return BASE_PATH + "/actions"; }
getBasePath
6,897
String () { return PathManager.getCommunityHomePath() + "/plugins/htmltools/testData/inspections"; }
getTestDataPath
6,898
void () { configureByFile(BASE_PATH + "/html_deptag5.xml"); final List<IntentionAction> list = getAvailableActions(); final IntentionAction action = CodeInsightTestUtil.findIntentionByText(list, "Replace font tag with CSS"); assertNull(action); }
testXml
6,899
void () { configureByFile(BASE_PATH + "/html_deptag5.xhtml"); final List<IntentionAction> list = getAvailableActions(); final IntentionAction action = CodeInsightTestUtil.findIntentionByText(list, "Replace menu tag with ul tag"); assertNull(action); }
testFitMenu