WEB-61632 WEB-61853 WebSymbols: add Obsolete API status; MDN: set obsolete symbols API status to obsolete.

GitOrigin-RevId: 5fd6970549cb591951c55331d9275ef519736f9c
This commit is contained in:
Piotr Tomiak
2023-07-06 12:14:46 +02:00
committed by intellij-monorepo-bot
parent f0cdf9cd61
commit 36a13f562e
31 changed files with 411 additions and 159 deletions

View File

@@ -9,6 +9,7 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="intellij.xml.impl" />
<orderEntry type="module" module-name="intellij.platform.webSymbols" />
<orderEntry type="module" module-name="intellij.platform.lang.impl" />
<orderEntry type="module" module-name="intellij.platform.images" />
<orderEntry type="module" module-name="intellij.platform.core.ui" />

View File

@@ -14,6 +14,7 @@ import com.intellij.xml.util.HtmlUtil;
import org.jetbrains.annotations.NotNull;
import static com.intellij.documentation.mdn.MdnDocumentationKt.getHtmlMdnDocumentation;
import static com.intellij.webSymbols.WebSymbolApiStatus.isDeprecatedOrObsolete;
public class HtmlDeprecatedAttributeInspection extends HtmlLocalInspectionTool {
@@ -32,7 +33,7 @@ public class HtmlDeprecatedAttributeInspection extends HtmlLocalInspectionTool {
StringUtil.toLowerCase(attribute.getName());
MdnSymbolDocumentation documentation = getHtmlMdnDocumentation(attribute, null);
boolean deprecatedInHtml5 = "align".equals(name)
|| (documentation != null && documentation.isDeprecated());
|| (documentation != null && isDeprecatedOrObsolete(documentation.getApiStatus()));
if (!deprecatedInHtml5) {
return;
}

View File

@@ -28,6 +28,7 @@ import java.util.HashSet;
import java.util.Set;
import static com.intellij.documentation.mdn.MdnDocumentationKt.getHtmlMdnDocumentation;
import static com.intellij.webSymbols.WebSymbolApiStatus.isDeprecatedOrObsolete;
public class HtmlDeprecatedTagInspection extends HtmlLocalInspectionTool {
@NonNls private static final Set<String> ourHtmlReplaceableTags;
@@ -91,7 +92,7 @@ public class HtmlDeprecatedTagInspection extends HtmlLocalInspectionTool {
}
MdnSymbolDocumentation documentation = getHtmlMdnDocumentation(tag, null);
boolean deprecatedInHtml5 = documentation != null && documentation.isDeprecated();
boolean deprecatedInHtml5 = documentation != null && isDeprecatedOrObsolete(documentation.getApiStatus());
boolean inHtml5 = HtmlUtil.isHtml5Context(tag);
if (!inHtml5 && !deprecatedInHtml5 && !HtmlUtil.hasNonHtml5Doctype(tag)) {
fixes = ArrayUtil.append(fixes, new SwitchToHtml5Action());