diff --git a/platform/webSymbols/gen/com/intellij/webSymbols/webTypes/json/BaseContribution.java b/platform/webSymbols/gen/com/intellij/webSymbols/webTypes/json/BaseContribution.java index 9a4156fadd27..1c164139af8d 100644 --- a/platform/webSymbols/gen/com/intellij/webSymbols/webTypes/json/BaseContribution.java +++ b/platform/webSymbols/gen/com/intellij/webSymbols/webTypes/json/BaseContribution.java @@ -28,6 +28,8 @@ import com.fasterxml.jackson.annotation.JsonValue; "since", "deprecated", "deprecated-since", + "obsolete", + "obsolete-since", "experimental", "priority", "proximity", @@ -89,11 +91,11 @@ public abstract class BaseContribution implements GenericContributionsHost @JsonPropertyDescription("Version since this symbol is available.") private String since; /** - * Specifies whether the symbol is deprecated. Value can be a boolean or a string message with explanation and migration information. + * Specifies whether the symbol is deprecated. Deprecated symbol usage is discouraged, but still supported. Value can be a boolean or a string message with explanation and migration information. * */ @JsonProperty("deprecated") - @JsonPropertyDescription("Specifies whether the symbol is deprecated. Value can be a boolean or a string message with explanation and migration information.") + @JsonPropertyDescription("Specifies whether the symbol is deprecated. Deprecated symbol usage is discouraged, but still supported. Value can be a boolean or a string message with explanation and migration information.") private Deprecated deprecated = null; /** * Version in which this symbol was first deprecated. @@ -102,6 +104,20 @@ public abstract class BaseContribution implements GenericContributionsHost @JsonProperty("deprecated-since") @JsonPropertyDescription("Version in which this symbol was first deprecated.") private String deprecatedSince; + /** + * Specifies whether the symbol is obsolete. Obsolete symbols are no longer supported. Value can be a boolean or a string message with explanation and migration information. + * + */ + @JsonProperty("obsolete") + @JsonPropertyDescription("Specifies whether the symbol is obsolete. Obsolete symbols are no longer supported. Value can be a boolean or a string message with explanation and migration information.") + private Obsolete obsolete = null; + /** + * Version in which this symbol was first made obsolete. + * + */ + @JsonProperty("obsolete-since") + @JsonPropertyDescription("Version in which this symbol was first made obsolete.") + private String obsoleteSince; /** * Specifies whether the symbol is experimental. Value can be a boolean or a string message with explanation. Experimental symbols should be used with caution as the API might change. * @@ -292,7 +308,7 @@ public abstract class BaseContribution implements GenericContributionsHost } /** - * Specifies whether the symbol is deprecated. Value can be a boolean or a string message with explanation and migration information. + * Specifies whether the symbol is deprecated. Deprecated symbol usage is discouraged, but still supported. Value can be a boolean or a string message with explanation and migration information. * */ @JsonProperty("deprecated") @@ -301,7 +317,7 @@ public abstract class BaseContribution implements GenericContributionsHost } /** - * Specifies whether the symbol is deprecated. Value can be a boolean or a string message with explanation and migration information. + * Specifies whether the symbol is deprecated. Deprecated symbol usage is discouraged, but still supported. Value can be a boolean or a string message with explanation and migration information. * */ @JsonProperty("deprecated") @@ -327,6 +343,42 @@ public abstract class BaseContribution implements GenericContributionsHost this.deprecatedSince = deprecatedSince; } + /** + * Specifies whether the symbol is obsolete. Obsolete symbols are no longer supported. Value can be a boolean or a string message with explanation and migration information. + * + */ + @JsonProperty("obsolete") + public Obsolete getObsolete() { + return obsolete; + } + + /** + * Specifies whether the symbol is obsolete. Obsolete symbols are no longer supported. Value can be a boolean or a string message with explanation and migration information. + * + */ + @JsonProperty("obsolete") + public void setObsolete(Obsolete obsolete) { + this.obsolete = obsolete; + } + + /** + * Version in which this symbol was first made obsolete. + * + */ + @JsonProperty("obsolete-since") + public String getObsoleteSince() { + return obsoleteSince; + } + + /** + * Version in which this symbol was first made obsolete. + * + */ + @JsonProperty("obsolete-since") + public void setObsoleteSince(String obsoleteSince) { + this.obsoleteSince = obsoleteSince; + } + /** * Specifies whether the symbol is experimental. Value can be a boolean or a string message with explanation. Experimental symbols should be used with caution as the API might change. * diff --git a/platform/webSymbols/gen/com/intellij/webSymbols/webTypes/json/NamePatternDefault.java b/platform/webSymbols/gen/com/intellij/webSymbols/webTypes/json/NamePatternDefault.java index 621825522287..af9236d270dd 100644 --- a/platform/webSymbols/gen/com/intellij/webSymbols/webTypes/json/NamePatternDefault.java +++ b/platform/webSymbols/gen/com/intellij/webSymbols/webTypes/json/NamePatternDefault.java @@ -43,11 +43,11 @@ public class NamePatternDefault @JsonPropertyDescription("A reference to an element in Web-Types model.") private Reference delegate; /** - * Specifies whether the symbol is deprecated. Value can be a boolean or a string message with explanation and migration information. + * Specifies whether the symbol is deprecated. Deprecated symbol usage is discouraged, but still supported. Value can be a boolean or a string message with explanation and migration information. * */ @JsonProperty("deprecated") - @JsonPropertyDescription("Specifies whether the symbol is deprecated. Value can be a boolean or a string message with explanation and migration information.") + @JsonPropertyDescription("Specifies whether the symbol is deprecated. Deprecated symbol usage is discouraged, but still supported. Value can be a boolean or a string message with explanation and migration information.") private Deprecated deprecated = null; @JsonProperty("priority") private com.intellij.webSymbols.webTypes.json.BaseContribution.Priority priority; @@ -130,7 +130,7 @@ public class NamePatternDefault } /** - * Specifies whether the symbol is deprecated. Value can be a boolean or a string message with explanation and migration information. + * Specifies whether the symbol is deprecated. Deprecated symbol usage is discouraged, but still supported. Value can be a boolean or a string message with explanation and migration information. * */ @JsonProperty("deprecated") @@ -139,7 +139,7 @@ public class NamePatternDefault } /** - * Specifies whether the symbol is deprecated. Value can be a boolean or a string message with explanation and migration information. + * Specifies whether the symbol is deprecated. Deprecated symbol usage is discouraged, but still supported. Value can be a boolean or a string message with explanation and migration information. * */ @JsonProperty("deprecated") diff --git a/platform/webSymbols/gen/com/intellij/webSymbols/webTypes/json/Obsolete.java b/platform/webSymbols/gen/com/intellij/webSymbols/webTypes/json/Obsolete.java new file mode 100644 index 000000000000..272ee586808b --- /dev/null +++ b/platform/webSymbols/gen/com/intellij/webSymbols/webTypes/json/Obsolete.java @@ -0,0 +1,62 @@ + +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.webSymbols.webTypes.json; + +import java.io.IOException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +@JsonDeserialize(using = Obsolete.MyDeserializer.class) +public class Obsolete { + + /** + * Type: {@code Boolean | String} + * + */ + private Object value; + + /** + * Type: {@code Boolean | String} + * + */ + public Object getValue() { + return value; + } + + /** + * Type: {@code Boolean | String} + * + */ + public void setValue(Object value) { + this.value = value; + } + + public static class MyDeserializer + extends JsonDeserializer + { + + + @Override + public Obsolete deserialize(JsonParser parser, DeserializationContext deserializationContext) + throws IOException + { + Obsolete result = new Obsolete(); + JsonToken token = parser.currentToken(); + if ((token == JsonToken.VALUE_TRUE)||(token == JsonToken.VALUE_FALSE)) { + result.value = parser.readValueAs(Boolean.class); + } else { + if (token == JsonToken.VALUE_STRING) { + result.value = parser.readValueAs(String.class); + } else { + deserializationContext.handleUnexpectedToken(Object.class, parser); + } + } + return result; + } + + } + +} diff --git a/platform/webSymbols/resources/messages/WebSymbolsBundle.properties b/platform/webSymbols/resources/messages/WebSymbolsBundle.properties index f80344ad68d5..1ab47e406e70 100644 --- a/platform/webSymbols/resources/messages/WebSymbolsBundle.properties +++ b/platform/webSymbols/resources/messages/WebSymbolsBundle.properties @@ -8,11 +8,15 @@ web.inspection.message.segment.default-subject=name web.inspection.message.deprecated.symbol.explanation=consult docs for better alternative web.inspection.message.deprecated.symbol.since=#ref is deprecated since {0}, web.inspection.message.deprecated.symbol.message=#ref is deprecated, +web.inspection.message.obsolete.symbol.since=#ref is obsolete since {0}, +web.inspection.message.obsolete.symbol.message=#ref is obsolete, mdn.documentation.section.status.Since=Since mdn.documentation.section.status.DeprecatedSince=Deprecated since +mdn.documentation.section.status.ObsoleteSince=Obsolete since mdn.documentation.section.status.Experimental=Experimental mdn.documentation.section.status.Deprecated=Deprecated +mdn.documentation.section.status.Obsolete=Obsolete mdn.documentation.section.isRequired=Required mdn.documentation.section.defaultValue=Default mdn.documentation.section.library=Library diff --git a/platform/webSymbols/src/com/intellij/webSymbols/WebSymbol.kt b/platform/webSymbols/src/com/intellij/webSymbols/WebSymbol.kt index 170b2de11770..2a425f2c148a 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/WebSymbol.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/WebSymbol.kt @@ -129,9 +129,10 @@ interface WebSymbol : WebSymbolsScope, Symbol, NavigatableSymbol { /** * Documents API status of the symbol. It is one of the sub-interfaces of [WebSymbolApiStatus]: - * [WebSymbolApiStatus.Stable], [WebSymbolApiStatus.Experimental] or [WebSymbolApiStatus.Deprecated]. + * [WebSymbolApiStatus.Stable], [WebSymbolApiStatus.Experimental], [WebSymbolApiStatus.Deprecated] + * or [WebSymbolApiStatus.Obsolete]. * - * Deprecated symbols are appropriately highlighted in the code editor, code completion and + * Deprecated and obsolete symbols are appropriately highlighted in the code editor, code completion and * quick documentation. */ val apiStatus: WebSymbolApiStatus diff --git a/platform/webSymbols/src/com/intellij/webSymbols/WebSymbolApiStatus.kt b/platform/webSymbols/src/com/intellij/webSymbols/WebSymbolApiStatus.kt index d9ee0d4b5af2..4c4b6bf02993 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/WebSymbolApiStatus.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/WebSymbolApiStatus.kt @@ -5,13 +5,26 @@ import org.jetbrains.annotations.Nls sealed interface WebSymbolApiStatus { + /** + * Version of the library, in which the symbol API status was updated + */ + val since: @Nls String? + + /** + * Stable symbols are not expected to change in backward incompatible way + * and are fit for production code. + */ interface Stable : WebSymbolApiStatus { /** * Version of the library, in which the stable symbol was first available */ - val since: @Nls String? get() = null + override val since: @Nls String? get() = null } + /** + * Usage of deprecated symbols is discouraged, but such symbols are still supported. + * Usages of deprecated symbols should be migrated as soon as possible. + */ interface Deprecated : WebSymbolApiStatus { /** * Message with HTML markup @@ -21,9 +34,29 @@ sealed interface WebSymbolApiStatus { /** * Version of the library, in which symbol was first deprecated */ - val since: @Nls String? get() = null + override val since: @Nls String? get() = null } + /** + * Obsolete symbols are no longer supported. + * Such symbols should not be used at all. + */ + interface Obsolete : WebSymbolApiStatus { + /** + * Message with HTML markup + */ + val message: @Nls String? get() = null + + /** + * Version of the library, in which symbol was first deprecated + */ + override val since: @Nls String? get() = null + } + + /** + * Experimental symbols are expected to be changed, or even removed. + * Such symbols should not be used in production code. + */ interface Experimental : WebSymbolApiStatus { /** * Message with HTML markup @@ -33,23 +66,31 @@ sealed interface WebSymbolApiStatus { /** * Version of the library, in which the experimental symbol was first available */ - val since: @Nls String? get() = null + override val since: @Nls String? get() = null } companion object { + @JvmField val Stable: Stable = object : Stable {} + @JvmField val Experimental: Experimental = object : Experimental {} + @JvmField val Deprecated: Deprecated = object : Deprecated {} + @JvmField + val Obsolete: Obsolete = object : Obsolete {} + + @JvmStatic fun Stable(since: @Nls String? = null): Stable = object : Stable { override val since: String? get() = since } + @JvmStatic fun Experimental(message: @Nls String? = null, since: @Nls String? = null): Experimental = object : Experimental { override val message: String? @@ -58,6 +99,7 @@ sealed interface WebSymbolApiStatus { get() = since } + @JvmStatic fun Deprecated(message: @Nls String? = null, since: @Nls String? = null): Deprecated = object : Deprecated { override val message: String? @@ -65,5 +107,27 @@ sealed interface WebSymbolApiStatus { override val since: String? get() = since } + + @JvmStatic + fun Obsolete(message: @Nls String? = null, since: @Nls String? = null): Obsolete = + object : Obsolete { + override val message: String? + get() = message + override val since: String? + get() = since + } + + @JvmStatic + fun WebSymbolApiStatus?.isDeprecatedOrObsolete(): Boolean = + this is Deprecated || this is Obsolete + + fun WebSymbolApiStatus.getMessage(): @Nls String? = + when (this) { + is Deprecated -> message + is Experimental -> message + is Obsolete -> message + is Stable -> null + } + } } \ No newline at end of file diff --git a/platform/webSymbols/src/com/intellij/webSymbols/completion/WebSymbolCodeCompletionItem.kt b/platform/webSymbols/src/com/intellij/webSymbols/completion/WebSymbolCodeCompletionItem.kt index 59c56f6f14e1..2f780c2329d2 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/completion/WebSymbolCodeCompletionItem.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/completion/WebSymbolCodeCompletionItem.kt @@ -34,8 +34,7 @@ interface WebSymbolCodeCompletionItem { val priority: WebSymbol.Priority? val proximity: Int? - @get:JvmName("isDeprecated") - val deprecated: Boolean + val apiStatus: WebSymbolApiStatus val aliases: Set val symbol: WebSymbol? val insertHandler: WebSymbolCodeCompletionItemInsertHandler? @@ -60,7 +59,7 @@ interface WebSymbolCodeCompletionItem { fun withProximity(proximity: Int): WebSymbolCodeCompletionItem - fun withDeprecated(deprecated: Boolean): WebSymbolCodeCompletionItem + fun withApiStatus(apiStatus: WebSymbolApiStatus): WebSymbolCodeCompletionItem fun withAliasesReplaced(aliases: Set): WebSymbolCodeCompletionItem @@ -93,7 +92,7 @@ interface WebSymbolCodeCompletionItem { symbol: WebSymbol? = this.symbol, priority: WebSymbol.Priority? = this.priority, proximity: Int? = this.proximity, - deprecated: Boolean = this.deprecated, + apiStatus: WebSymbolApiStatus = this.apiStatus, icon: Icon? = this.icon, typeText: String? = this.typeText, tailText: String? = this.tailText): WebSymbolCodeCompletionItem @@ -108,7 +107,7 @@ interface WebSymbolCodeCompletionItem { symbol: WebSymbol? = null, priority: WebSymbol.Priority? = symbol?.priority, proximity: Int? = symbol?.proximity, - deprecated: Boolean = symbol?.apiStatus is WebSymbolApiStatus.Deprecated, + apiStatus: WebSymbolApiStatus = symbol?.apiStatus ?: WebSymbolApiStatus.Stable, aliases: Set = emptySet(), icon: Icon? = symbol?.let { it.icon @@ -120,7 +119,7 @@ interface WebSymbolCodeCompletionItem { insertHandler: WebSymbolCodeCompletionItemInsertHandler? = null): WebSymbolCodeCompletionItem = WebSymbolCodeCompletionItemImpl(name, offset, completeAfterInsert, if (!completeAfterInsert) completeAfterChars else emptySet(), displayName, symbol, priority, proximity, - deprecated, aliases, icon, typeText, tailText, insertHandler) + apiStatus, aliases, icon, typeText, tailText, insertHandler) @JvmStatic fun getPsiElement(lookupElement: LookupElement): PsiElement? = diff --git a/platform/webSymbols/src/com/intellij/webSymbols/completion/impl/WebSymbolCodeCompletionItemImpl.kt b/platform/webSymbols/src/com/intellij/webSymbols/completion/impl/WebSymbolCodeCompletionItemImpl.kt index 4e78522fc706..f8365fb299a8 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/completion/impl/WebSymbolCodeCompletionItemImpl.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/completion/impl/WebSymbolCodeCompletionItemImpl.kt @@ -7,6 +7,8 @@ import com.intellij.codeInsight.lookup.LookupElement import com.intellij.codeInsight.lookup.LookupElementBuilder import com.intellij.webSymbols.PsiSourcedWebSymbol import com.intellij.webSymbols.WebSymbol +import com.intellij.webSymbols.WebSymbolApiStatus +import com.intellij.webSymbols.WebSymbolApiStatus.Companion.isDeprecatedOrObsolete import com.intellij.webSymbols.completion.WebSymbolCodeCompletionItem import com.intellij.webSymbols.completion.WebSymbolCodeCompletionItemInsertHandler import com.intellij.webSymbols.impl.scaleToHeight @@ -21,7 +23,7 @@ internal data class WebSymbolCodeCompletionItemImpl(override val name: String, override val symbol: WebSymbol? = null, override val priority: WebSymbol.Priority? = null, override val proximity: Int? = null, - override val deprecated: Boolean = false, + override val apiStatus: WebSymbolApiStatus = WebSymbolApiStatus.Stable, override val aliases: Set = emptySet(), override val icon: Icon? = null, override val typeText: String? = null, @@ -39,14 +41,15 @@ internal data class WebSymbolCodeCompletionItemImpl(override val name: String, completionPrefix.substring(offset) == name) return val priorityOffset = baselinePriorityValue - WebSymbol.Priority.NORMAL.value + val deprecatedOrObsolete = apiStatus.isDeprecatedOrObsolete() LookupElementBuilder .create(wrapSymbolForDocumentation(symbol)?.createPointer() ?: name, name) .withLookupStrings(aliases) .withIcon(icon?.scaleToHeight(16)) .withTypeText(typeText, true) .withTailText(tailText, true) - .withBoldness(!deprecated && priority == WebSymbol.Priority.HIGHEST) - .withStrikeoutness(deprecated) + .withBoldness(!deprecatedOrObsolete && priority == WebSymbol.Priority.HIGHEST) + .withStrikeoutness(deprecatedOrObsolete) .let { if (displayName != null) it.withPresentableText(displayName) @@ -66,7 +69,7 @@ internal data class WebSymbolCodeCompletionItemImpl(override val name: String, it.withAutoCompletionPolicy(AutoCompletionPolicy.NEVER_AUTOCOMPLETE) else it }.let { - val priorityValue = if (deprecated) WebSymbol.Priority.LOWEST.value + val priorityValue = if (deprecatedOrObsolete) WebSymbol.Priority.LOWEST.value else (priority ?: WebSymbol.Priority.NORMAL).value + priorityOffset PrioritizedLookupElement.withPriority(it, priorityValue) }.let { @@ -77,7 +80,7 @@ internal data class WebSymbolCodeCompletionItemImpl(override val name: String, } } - private fun wrapSymbolForDocumentation(symbol: WebSymbol?)= + private fun wrapSymbolForDocumentation(symbol: WebSymbol?) = when (symbol) { is PsiSourcedWebSymbol -> PsiSourcedCodeCompletionWebSymbolWithDocumentation(symbol) is WebSymbol -> CodeCompletionWebSymbolWithDocumentation(symbol) @@ -116,8 +119,8 @@ internal data class WebSymbolCodeCompletionItemImpl(override val name: String, override fun withProximity(proximity: Int): WebSymbolCodeCompletionItem = copy(proximity = proximity) - override fun withDeprecated(deprecated: Boolean): WebSymbolCodeCompletionItem = - copy(deprecated = deprecated) + override fun withApiStatus(apiStatus: WebSymbolApiStatus): WebSymbolCodeCompletionItem = + copy(apiStatus = apiStatus) override fun withAliasesReplaced(aliases: Set): WebSymbolCodeCompletionItem = copy(aliases = aliases) @@ -161,13 +164,13 @@ internal data class WebSymbolCodeCompletionItemImpl(override val name: String, symbol: WebSymbol?, priority: WebSymbol.Priority?, proximity: Int?, - deprecated: Boolean, + apiStatus: WebSymbolApiStatus, icon: Icon?, typeText: String?, tailText: String?): WebSymbolCodeCompletionItem = copy(name = name, offset = offset, completeAfterInsert = completeAfterInsert, completeAfterChars = if (!completeAfterInsert) completeAfterChars else emptySet(), displayName = displayName, symbol = symbol, priority = priority, proximity = proximity, - deprecated = deprecated, icon = icon, typeText = typeText, tailText = tailText) + apiStatus = apiStatus, icon = icon, typeText = typeText, tailText = tailText) } \ No newline at end of file diff --git a/platform/webSymbols/src/com/intellij/webSymbols/documentation/impl/WebSymbolDocumentationTargetImpl.kt b/platform/webSymbols/src/com/intellij/webSymbols/documentation/impl/WebSymbolDocumentationTargetImpl.kt index 31dc7c2df478..587565877d07 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/documentation/impl/WebSymbolDocumentationTargetImpl.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/documentation/impl/WebSymbolDocumentationTargetImpl.kt @@ -112,6 +112,10 @@ internal class WebSymbolDocumentationTargetImpl(override val symbol: WebSymbol, sections[WebSymbolsBundle.message("mdn.documentation.section.status.Deprecated")] = status.message ?: "" status.since?.let { sections[WebSymbolsBundle.message("mdn.documentation.section.status.DeprecatedSince")] = it } } + is WebSymbolApiStatus.Obsolete -> { + sections[WebSymbolsBundle.message("mdn.documentation.section.status.Obsolete")] = status.message ?: "" + status.since?.let { sections[WebSymbolsBundle.message("mdn.documentation.section.status.ObsoleteSince")] = it } + } is WebSymbolApiStatus.Experimental -> { sections[WebSymbolsBundle.message("mdn.documentation.section.status.Experimental")] = status.message ?: "" status.since?.let { sections[WebSymbolsBundle.message("mdn.documentation.section.status.Since")] = it } diff --git a/platform/webSymbols/src/com/intellij/webSymbols/inspections/WebSymbolsInspectionsPass.kt b/platform/webSymbols/src/com/intellij/webSymbols/inspections/WebSymbolsInspectionsPass.kt index 671b41f72f97..9dc6e759c669 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/inspections/WebSymbolsInspectionsPass.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/inspections/WebSymbolsInspectionsPass.kt @@ -185,6 +185,7 @@ internal class WebSymbolsInspectionsPass(private val file: PsiFile, document: Do get() = when (this) { ProblemKind.DeprecatedSymbol -> HighlightSeverity.WEAK_WARNING + ProblemKind.ObsoleteSymbol -> HighlightSeverity.WARNING ProblemKind.UnknownSymbol -> HighlightSeverity.WARNING ProblemKind.MissingRequiredPart -> HighlightSeverity.WARNING ProblemKind.DuplicatedPart -> HighlightSeverity.WARNING @@ -198,6 +199,9 @@ internal class WebSymbolsInspectionsPass(private val file: PsiFile, document: Do ProblemKind.DeprecatedSymbol -> return WebSymbolsBundle.message("web.inspection.message.deprecated.symbol.message") + " " + WebSymbolsBundle.message("web.inspection.message.deprecated.symbol.explanation") + ProblemKind.ObsoleteSymbol -> return WebSymbolsBundle.message("web.inspection.message.obsolete.symbol.message") + + " " + + WebSymbolsBundle.message("web.inspection.message.deprecated.symbol.explanation") ProblemKind.UnknownSymbol -> "web.inspection.message.segment.unrecognized-identifier" ProblemKind.MissingRequiredPart -> "web.inspection.message.segment.missing" ProblemKind.DuplicatedPart -> "web.inspection.message.segment.duplicated" diff --git a/platform/webSymbols/src/com/intellij/webSymbols/patterns/ComplexPatternOptions.kt b/platform/webSymbols/src/com/intellij/webSymbols/patterns/ComplexPatternOptions.kt index 99c3b3c48270..382f2bb91010 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/patterns/ComplexPatternOptions.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/patterns/ComplexPatternOptions.kt @@ -6,7 +6,7 @@ import com.intellij.webSymbols.WebSymbolApiStatus data class ComplexPatternOptions( val additionalScope: WebSymbol? = null, - val deprecation: WebSymbolApiStatus.Deprecated? = null, + val apiStatus: WebSymbolApiStatus? = null, val isRequired: Boolean = true, val priority: WebSymbol.Priority? = null, val proximity: Int? = null, diff --git a/platform/webSymbols/src/com/intellij/webSymbols/patterns/impl/ComplexPattern.kt b/platform/webSymbols/src/com/intellij/webSymbols/patterns/impl/ComplexPattern.kt index deb584f3b1fe..23c54d1193c7 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/patterns/impl/ComplexPattern.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/patterns/impl/ComplexPattern.kt @@ -7,11 +7,13 @@ import com.intellij.util.containers.Stack import com.intellij.util.text.CharSequenceSubSequence import com.intellij.webSymbols.WebSymbol import com.intellij.webSymbols.WebSymbolApiStatus +import com.intellij.webSymbols.WebSymbolApiStatus.Companion.isDeprecatedOrObsolete import com.intellij.webSymbols.WebSymbolNameSegment import com.intellij.webSymbols.WebSymbolsScope import com.intellij.webSymbols.impl.selectBest import com.intellij.webSymbols.patterns.WebSymbolsPattern import com.intellij.webSymbols.patterns.WebSymbolsPatternSymbolsResolver +import com.intellij.webSymbols.utils.coalesceWith import com.intellij.webSymbols.utils.isCritical import kotlin.math.max import kotlin.math.min @@ -39,7 +41,7 @@ internal class ComplexPattern(private val configProvider: ComplexPatternConfigPr params: MatchParameters, start: Int, end: Int): List = - process(scopeStack, params) { patterns, newSymbolsResolver, deprecation, + process(scopeStack, params) { patterns, newSymbolsResolver, apiStatus, isRequired, priority, proximity, repeats, unique -> performPatternMatch(params, start, end, patterns, repeats, unique, scopeStack, newSymbolsResolver) .let { matchResults -> @@ -72,8 +74,8 @@ internal class ComplexPattern(private val configProvider: ComplexPatternConfigPr }, { false }) } .let { matchResults -> - if (matchResults.isNotEmpty() && (deprecation != null || priority != null || proximity != null)) - matchResults.map { it.applyToSegments(apiStatus = deprecation, priority = priority, proximity = proximity) } + if (matchResults.isNotEmpty() && (apiStatus.isDeprecatedOrObsolete() || priority != null || proximity != null)) + matchResults.map { it.applyToSegments(apiStatus = apiStatus, priority = priority, proximity = proximity) } else matchResults } .let { matchResults -> @@ -92,7 +94,7 @@ internal class ComplexPattern(private val configProvider: ComplexPatternConfigPr params: CompletionParameters, start: Int, end: Int): CompletionResults = - process(scopeStack, params) { patterns, newSymbolsResolver, deprecation, + process(scopeStack, params) { patterns, newSymbolsResolver, apiStatus, isRequired, priority, proximity, repeats, unique -> var staticPrefixes: Set = emptySet() @@ -129,7 +131,7 @@ internal class ComplexPattern(private val configProvider: ComplexPatternConfigPr item.with( priority = priority ?: item.priority, proximity = proximity?.let { (item.proximity ?: 0) + proximity } ?: item.proximity, - deprecated = deprecation != null || item.deprecated, + apiStatus = apiStatus.coalesceWith(item.apiStatus), symbol = item.symbol ?: defaultSource, completeAfterChars = (if (repeats) getStaticPrefixes().mapNotNull { it.getOrNull(0) }.toSet() else emptySet()) + item.completeAfterChars @@ -146,7 +148,7 @@ internal class ComplexPattern(private val configProvider: ComplexPatternConfigPr params: MatchParameters, action: (patterns: List, symbolsResolver: WebSymbolsPatternSymbolsResolver?, - patternDeprecation: WebSymbolApiStatus.Deprecated?, + patternApiStatus: WebSymbolApiStatus?, patternRequired: Boolean, patternPriority: WebSymbol.Priority?, patternProximity: Int?, @@ -159,7 +161,7 @@ internal class ComplexPattern(private val configProvider: ComplexPatternConfigPr scopeStack.push(additionalScope) } try { - return action(patterns, options.symbolsResolver, options.deprecation, options.isRequired, options.priority, + return action(patterns, options.symbolsResolver, options.apiStatus, options.isRequired, options.priority, options.proximity, options.repeats, options.unique) } finally { diff --git a/platform/webSymbols/src/com/intellij/webSymbols/patterns/impl/SequencePattern.kt b/platform/webSymbols/src/com/intellij/webSymbols/patterns/impl/SequencePattern.kt index b2f573536737..bec562c7fc17 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/patterns/impl/SequencePattern.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/patterns/impl/SequencePattern.kt @@ -4,13 +4,17 @@ package com.intellij.webSymbols.patterns.impl import com.intellij.openapi.util.text.StringUtil import com.intellij.util.containers.Stack import com.intellij.util.text.CharSequenceSubSequence -import com.intellij.webSymbols.* +import com.intellij.webSymbols.WebSymbol +import com.intellij.webSymbols.WebSymbolNameSegment +import com.intellij.webSymbols.WebSymbolOrigin +import com.intellij.webSymbols.WebSymbolsScope import com.intellij.webSymbols.completion.WebSymbolCodeCompletionItem import com.intellij.webSymbols.completion.impl.CompoundInsertHandler import com.intellij.webSymbols.patterns.WebSymbolsPattern import com.intellij.webSymbols.patterns.WebSymbolsPatternSymbolsResolver import com.intellij.webSymbols.query.WebSymbolMatch import com.intellij.webSymbols.utils.asSingleSymbol +import com.intellij.webSymbols.utils.coalesceWith import com.intellij.webSymbols.utils.nameSegments import com.intellij.webSymbols.utils.withOffset @@ -342,7 +346,7 @@ internal class SequencePattern(private val patternsProvider: () -> List List : PsiSym .mapNotNull { (range, segments) -> val problemOnly = problemOnlyRanges[range] ?: false val deprecation = segments.mapNotNull mapSegments@{ segment -> - segment.apiStatus.asSafely() + segment.apiStatus.takeIf { it.isDeprecatedOrObsolete() } ?.let { return@mapSegments it } val declarations = segment.symbols.filter { !it.extension } - declarations.mapNotNull { it.apiStatus as? WebSymbolApiStatus.Deprecated } + declarations + .mapNotNull { decl -> decl.apiStatus.takeIf { it.isDeprecatedOrObsolete() } } .takeIf { it.size == declarations.size } ?.firstOrNull() }.takeIf { it.size == segments.size }?.firstOrNull() @@ -164,7 +167,7 @@ abstract class WebSymbolReferenceProvider : PsiSym private class NameSegmentReferenceWithProblem(element: PsiElement, rangeInElement: TextRange, nameSegments: Collection, - private val deprecation: WebSymbolApiStatus.Deprecated?, + private val apiStatus: WebSymbolApiStatus?, private val problemOnly: Boolean) : NameSegmentReference(element, rangeInElement, nameSegments) { @@ -191,28 +194,43 @@ abstract class WebSymbolReferenceProvider : PsiSym ) ) }.firstOrNull() - val deprecationProblem = if (deprecation != null) { + val deprecationProblem = if (apiStatus.isDeprecatedOrObsolete()) { + val isDeprecated = apiStatus is WebSymbolApiStatus.Deprecated val symbolTypes = nameSegments.flatMapTo(LinkedHashSet()) { it.symbolKinds } val toolMapping = symbolTypes.map { - WebSymbolsInspectionToolMappingEP.get(it.namespace, it.kind, WebSymbolReferenceProblem.ProblemKind.DeprecatedSymbol) + if (apiStatus is WebSymbolApiStatus.Obsolete) + WebSymbolsInspectionToolMappingEP.get(it.namespace, it.kind, ProblemKind.ObsoleteSymbol) + ?.let { mapping -> return@map mapping } + WebSymbolsInspectionToolMappingEP.get(it.namespace, it.kind, ProblemKind.DeprecatedSymbol) }.firstOrNull() - val cause = deprecation.message + + val cause = apiStatus?.getMessage() ?.takeIf { it.isNotBlank() } ?.sanitizeHtmlOutputForProblemMessage() ?: WebSymbolsBundle.message("web.inspection.message.deprecated.symbol.explanation") @Suppress("HardCodedStringLiteral") - val prefix = toolMapping?.getProblemMessage(null)?.trim()?.removeSuffix(".")?.let { if (!it.endsWith(",")) "$it," else it } - ?: deprecation.since?.let { WebSymbolsBundle.message("web.inspection.message.deprecated.symbol.since", it) } - ?: WebSymbolsBundle.message("web.inspection.message.deprecated.symbol.message") + val prefix = toolMapping + ?.getProblemMessage(null) + ?.trim() + ?.removeSuffix(".") + ?.let { if (!it.endsWith(",")) "$it," else it } + ?: apiStatus?.since + ?.let { + WebSymbolsBundle.message(if (isDeprecated) "web.inspection.message.deprecated.symbol.since" + else "web.inspection.message.obsolete.symbol.since", it) + } + ?: WebSymbolsBundle.message(if (isDeprecated) "web.inspection.message.deprecated.symbol.message" + else "web.inspection.message.obsolete.symbol.message") WebSymbolReferenceProblem( symbolTypes, - WebSymbolReferenceProblem.ProblemKind.DeprecatedSymbol, + if (isDeprecated) ProblemKind.DeprecatedSymbol else ProblemKind.ObsoleteSymbol, inspectionManager.createProblemDescriptor( element, rangeInElement, "$prefix ${StringUtil.decapitalize(cause)}", - ProblemHighlightType.LIKE_DEPRECATED, true + if (isDeprecated) ProblemHighlightType.LIKE_DEPRECATED else ProblemHighlightType.LIKE_MARKED_FOR_REMOVAL, + true ) ) diff --git a/platform/webSymbols/src/com/intellij/webSymbols/utils/WebSymbolUtils.kt b/platform/webSymbols/src/com/intellij/webSymbols/utils/WebSymbolUtils.kt index aca203adf32b..e7d855f281bf 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/utils/WebSymbolUtils.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/utils/WebSymbolUtils.kt @@ -231,12 +231,18 @@ fun List.withOffset(offset: Int): List other ?: WebSymbolApiStatus.Stable - is WebSymbolApiStatus.Deprecated -> this + is WebSymbolApiStatus.Obsolete -> this + is WebSymbolApiStatus.Deprecated -> when (other) { + is WebSymbolApiStatus.Obsolete -> other + else -> this + } is WebSymbolApiStatus.Experimental -> when (other) { + is WebSymbolApiStatus.Obsolete, is WebSymbolApiStatus.Deprecated -> other else -> this } is WebSymbolApiStatus.Stable -> when (other) { + is WebSymbolApiStatus.Obsolete, is WebSymbolApiStatus.Deprecated, is WebSymbolApiStatus.Experimental -> other else -> this diff --git a/platform/webSymbols/src/com/intellij/webSymbols/webTypes/impl/WebTypesJsonContributionAdapter.kt b/platform/webSymbols/src/com/intellij/webSymbols/webTypes/impl/WebTypesJsonContributionAdapter.kt index 4b06732a4c52..79caa617c750 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/webTypes/impl/WebTypesJsonContributionAdapter.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/webTypes/impl/WebTypesJsonContributionAdapter.kt @@ -289,7 +289,7 @@ abstract class WebTypesJsonContributionAdapter private constructor(protected val override val jsonPattern: NamePatternRoot? get() = null override fun createPointer(): Pointer = - object : WebTypesJsonContributionWrapperPointer(this) { + object : WebTypesJsonContributionAdapterPointer(this) { override fun dereference(): Static? = rootScope.dereference()?.let { Static(contribution, jsonContext, cacheHolder, it, namespace, kind) @@ -316,7 +316,7 @@ abstract class WebTypesJsonContributionAdapter private constructor(protected val "$kind/${jsonPattern?.wrap("", jsonOrigin)?.getStaticPrefixes()?.toSet() ?: "[]"}... " override fun createPointer(): Pointer = - object : WebTypesJsonContributionWrapperPointer(this) { + object : WebTypesJsonContributionAdapterPointer(this) { override fun dereference(): Pattern? = rootScope.dereference()?.let { @@ -346,7 +346,7 @@ abstract class WebTypesJsonContributionAdapter private constructor(protected val override val jsonPattern: NamePatternRoot? get() = null override fun createPointer(): Pointer = - object : WebTypesJsonContributionWrapperPointer(this) { + object : WebTypesJsonContributionAdapterPointer(this) { override fun dereference(): LegacyVueDirective? = rootScope.dereference()?.let { @@ -381,7 +381,7 @@ abstract class WebTypesJsonContributionAdapter private constructor(protected val ?: (contribution as HtmlElement).convertToComponentContribution().also { _contributionForQuery = it } override fun createPointer(): Pointer = - object : WebTypesJsonContributionWrapperPointer(this) { + object : WebTypesJsonContributionAdapterPointer(this) { override fun dereference(): LegacyVueComponent? = rootScope.dereference()?.let { @@ -458,7 +458,7 @@ abstract class WebTypesJsonContributionAdapter private constructor(protected val } } - private abstract class WebTypesJsonContributionWrapperPointer(wrapper: T) : Pointer { + private abstract class WebTypesJsonContributionAdapterPointer(wrapper: T) : Pointer { val contribution = wrapper.contribution val jsonContext = wrapper.jsonOrigin diff --git a/platform/webSymbols/src/com/intellij/webSymbols/webTypes/impl/WebTypesPatternUtils.kt b/platform/webSymbols/src/com/intellij/webSymbols/webTypes/impl/WebTypesPatternUtils.kt index f901497d205b..5aef4b49910c 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/webTypes/impl/WebTypesPatternUtils.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/webTypes/impl/WebTypesPatternUtils.kt @@ -1,10 +1,9 @@ // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.webSymbols.webTypes.impl -import com.intellij.util.asSafely import com.intellij.util.containers.Stack import com.intellij.webSymbols.WebSymbol -import com.intellij.webSymbols.WebSymbolApiStatus +import com.intellij.webSymbols.WebSymbolApiStatus.Companion.isDeprecatedOrObsolete import com.intellij.webSymbols.WebSymbolQualifiedKind import com.intellij.webSymbols.WebSymbolsScope import com.intellij.webSymbols.completion.WebSymbolCodeCompletionItem @@ -81,8 +80,8 @@ private class WebTypesComplexPatternConfigProvider(private val pattern: NamePatt val delegate = pattern.delegate?.resolve(null, scopeStack, queryParams.queryExecutor)?.firstOrNull() // Allow delegate pattern to override settings - val deprecation = delegate?.apiStatus?.asSafely() - ?: pattern.toApiStatus(origin)?.asSafely() + val apiStatus = delegate?.apiStatus?.takeIf { it.isDeprecatedOrObsolete() } + ?: pattern.toApiStatus(origin)?.takeIf { it.isDeprecatedOrObsolete() } val isRequired = (delegate?.required ?: pattern.required) != false val priority = delegate?.priority ?: pattern.priority?.wrap() val proximity = delegate?.proximity ?: pattern.proximity @@ -90,7 +89,7 @@ private class WebTypesComplexPatternConfigProvider(private val pattern: NamePatt val unique = pattern.unique != false val symbolsResolver = createSymbolsResolver(delegate) - return ComplexPatternOptions(delegate, deprecation, isRequired, priority, proximity, repeats, unique, symbolsResolver) + return ComplexPatternOptions(delegate, apiStatus, isRequired, priority, proximity, repeats, unique, symbolsResolver) } private fun createSymbolsResolver(delegate: WebSymbol?) = diff --git a/platform/webSymbols/src/com/intellij/webSymbols/webTypes/json/WebTypesJsonUtils.kt b/platform/webSymbols/src/com/intellij/webSymbols/webTypes/json/WebTypesJsonUtils.kt index d0a68faef74e..73f6b6962e7a 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/webTypes/json/WebTypesJsonUtils.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/webTypes/json/WebTypesJsonUtils.kt @@ -491,7 +491,9 @@ private fun parseWebTypesPath(path: List, context: WebSymbol?): List WebSymbolApiStatus.Obsolete((msg as? String)?.let { origin.renderDescription(it) }, obsoleteSince) } + ?: deprecated?.value?.takeIf { it != false } ?.let { msg -> WebSymbolApiStatus.Deprecated((msg as? String)?.let { origin.renderDescription(it) }, deprecatedSince) } ?: experimental?.value?.takeIf { it != false } ?.let { msg -> WebSymbolApiStatus.Experimental((msg as? String)?.let { origin.renderDescription(it) }, since) } diff --git a/platform/webSymbols/testSrc/com/intellij/webSymbols/query/WebSymbolsDebugOutputPrinter.kt b/platform/webSymbols/testSrc/com/intellij/webSymbols/query/WebSymbolsDebugOutputPrinter.kt index 312ba8f86e2a..117ac85e3e05 100644 --- a/platform/webSymbols/testSrc/com/intellij/webSymbols/query/WebSymbolsDebugOutputPrinter.kt +++ b/platform/webSymbols/testSrc/com/intellij/webSymbols/query/WebSymbolsDebugOutputPrinter.kt @@ -111,6 +111,9 @@ open class WebSymbolsDebugOutputPrinter : DebugOutputPrinter() { is WebSymbolApiStatus.Deprecated -> append("deprecated") .applyIf(apiStatus.since != null) { append(" in ").append(apiStatus.since) } .applyIf(apiStatus.message != null) { append(" (").append(apiStatus.message).append(")") } + is WebSymbolApiStatus.Obsolete -> append("obsolete") + .applyIf(apiStatus.since != null) { append(" in ").append(apiStatus.since) } + .applyIf(apiStatus.message != null) { append(" (").append(apiStatus.message).append(")") } is WebSymbolApiStatus.Experimental -> append("experimental") .applyIf(apiStatus.since != null) { append(" since ").append(apiStatus.since) } .applyIf(apiStatus.message != null) { append(" (").append(apiStatus.message).append(")") } diff --git a/platform/webSymbols/web-types-gen/resources/web-types.json b/platform/webSymbols/web-types-gen/resources/web-types.json index ca94a61daff7..2ad0b5d72eda 100644 --- a/platform/webSymbols/web-types-gen/resources/web-types.json +++ b/platform/webSymbols/web-types-gen/resources/web-types.json @@ -335,6 +335,12 @@ "deprecated-since": { "$ref": "#/definitions/deprecated-since" }, + "obsolete": { + "$ref": "#/definitions/obsolete" + }, + "obsolete-since": { + "$ref": "#/definitions/obsolete-since" + }, "experimental": { "$ref": "#/definitions/experimental" }, @@ -746,7 +752,7 @@ "type": "string" }, "deprecated": { - "description": "Specifies whether the symbol is deprecated. Value can be a boolean or a string message with explanation and migration information.", + "description": "Specifies whether the symbol is deprecated. Deprecated symbol usage is discouraged, but still supported. Value can be a boolean or a string message with explanation and migration information.", "type": [ "boolean", "string" @@ -757,6 +763,18 @@ "description": "Version in which this symbol was first deprecated.", "type": "string" }, + "obsolete": { + "description": "Specifies whether the symbol is obsolete. Obsolete symbols are no longer supported. Value can be a boolean or a string message with explanation and migration information.", + "type": [ + "boolean", + "string" + ], + "default": false + }, + "obsolete-since": { + "description": "Version in which this symbol was first made obsolete.", + "type": "string" + }, "experimental": { "description": "Specifies whether the symbol is experimental. Value can be a boolean or a string message with explanation. Experimental symbols should be used with caution as the API might change.", "type": [ diff --git a/plugins/htmltools/intellij.html.tools.iml b/plugins/htmltools/intellij.html.tools.iml index d4c85d948710..078ee2ccc511 100644 --- a/plugins/htmltools/intellij.html.tools.iml +++ b/plugins/htmltools/intellij.html.tools.iml @@ -9,6 +9,7 @@ + diff --git a/plugins/htmltools/src/com/intellij/htmltools/codeInspection/htmlInspections/HtmlDeprecatedAttributeInspection.java b/plugins/htmltools/src/com/intellij/htmltools/codeInspection/htmlInspections/HtmlDeprecatedAttributeInspection.java index 545740643d32..7d2fb1d24a98 100644 --- a/plugins/htmltools/src/com/intellij/htmltools/codeInspection/htmlInspections/HtmlDeprecatedAttributeInspection.java +++ b/plugins/htmltools/src/com/intellij/htmltools/codeInspection/htmlInspections/HtmlDeprecatedAttributeInspection.java @@ -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; } diff --git a/plugins/htmltools/src/com/intellij/htmltools/codeInspection/htmlInspections/HtmlDeprecatedTagInspection.java b/plugins/htmltools/src/com/intellij/htmltools/codeInspection/htmlInspections/HtmlDeprecatedTagInspection.java index 54e68efd520e..c2b3b328107c 100644 --- a/plugins/htmltools/src/com/intellij/htmltools/codeInspection/htmlInspections/HtmlDeprecatedTagInspection.java +++ b/plugins/htmltools/src/com/intellij/htmltools/codeInspection/htmlInspections/HtmlDeprecatedTagInspection.java @@ -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 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()); diff --git a/xml/xml-psi-impl/src/com/intellij/documentation/mdn/Css-obsolete.json b/xml/xml-psi-impl/src/com/intellij/documentation/mdn/Css-obsolete.json index d9215e3919d6..f4ffdd9c9f33 100644 --- a/xml/xml-psi-impl/src/com/intellij/documentation/mdn/Css-obsolete.json +++ b/xml/xml-psi-impl/src/com/intellij/documentation/mdn/Css-obsolete.json @@ -12,10 +12,10 @@ "viewport": { "url": "$MDN_URL$/web/CSS/@viewport", "status": [ - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n
\n

Note: See https://github.com/w3c/csswg-drafts/issues/4766 for discussion around @viewport's removal from the standards track.

\n
\n

The @viewport CSS at-rule lets you configure the viewport through which the document is viewed. It's primarily used for mobile devices, but is also used by desktop browsers that support features like \"snap to edge\" (such as Microsoft Edge).

\n

Lengths specified as percentages are calculated relative to the initial viewport, which is the viewport before any user agent or authored styles have had an opportunity to adjust the viewport. This is typically based on the size of the window on desktop browsers that aren't in full screen mode.

\n

On mobile devices (or desktop devices that are in full screen mode), the initial viewport is usually the portion of a device's screen that is available for application use. This may be either the full screen or the full screen area minus areas controlled by the operating system (such as a taskbar) or the application-available screen area (either the full screen or the screen minus any areas owned by the operating system or other applications).

\n
@viewport {\n  width: 100vw; /*Sets the width of the actual viewport to the device width*/\n}\n
\n
\n

Note: The use of <meta name=\"viewport\"> tag overrides @viewport

\n
" + "doc": "
\n

Note: See https://github.com/w3c/csswg-drafts/issues/4766 for discussion around @viewport's removal from the standards track.

\n
\n

The @viewport CSS at-rule lets you configure the viewport through which the document is viewed. It's primarily used for mobile devices, but is also used by desktop browsers that support features like \"snap to edge\" (such as Microsoft Edge).

\n

Lengths specified as percentages are calculated relative to the initial viewport, which is the viewport before any user agent or authored styles have had an opportunity to adjust the viewport. This is typically based on the size of the window on desktop browsers that aren't in full screen mode.

\n

On mobile devices (or desktop devices that are in full screen mode), the initial viewport is usually the portion of a device's screen that is available for application use. This may be either the full screen or the full screen area minus areas controlled by the operating system (such as a taskbar) or the application-available screen area (either the full screen or the screen minus any areas owned by the operating system or other applications).

\n
@viewport {\n  width: 100vw; /*Sets the width of the actual viewport to the device width*/\n}\n
\n
\n

Note: The use of <meta name=\"viewport\"> tag overrides @viewport

\n
" } }, "dataTypes": {}, @@ -24,12 +24,12 @@ "ime-mode": { "url": "$MDN_URL$/web/CSS/ime-mode", "status": [ - "Deprecated" + "Obsolete" ], "compatibility": { "Firefox": "3" }, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The ime-mode CSS property controls the state of the input method editor (IME) for text fields. This property is obsolete.

\n
/* Keyword values */\nime-mode: auto;\nime-mode: normal;\nime-mode: active;\nime-mode: inactive;\nime-mode: disabled;\n/* Global values */\nime-mode: inherit;\nime-mode: initial;\nime-mode: revert;\nime-mode: unset;\n
\n

The ime-mode property is only partially and inconsistently implemented in browsers. It was introduced by Microsoft with Internet Explorer 5 as a proprietary extension: -ms-ime-mode Attribute | imeMode Property.

\n
\n

Note: In general, it's not appropriate for a public web site to change the IME mode. This property should only be used for private web applications or to undo the property if it was previously set by legacy code.

\n
", + "doc": "The ime-mode CSS property controls the state of the input method editor (IME) for text fields. This property is obsolete.

\n
/* Keyword values */\nime-mode: auto;\nime-mode: normal;\nime-mode: active;\nime-mode: inactive;\nime-mode: disabled;\n/* Global values */\nime-mode: inherit;\nime-mode: initial;\nime-mode: revert;\nime-mode: unset;\n
\n

The ime-mode property is only partially and inconsistently implemented in browsers. It was introduced by Microsoft with Internet Explorer 5 as a proprietary extension: -ms-ime-mode Attribute | imeMode Property.

\n
\n

Note: In general, it's not appropriate for a public web site to change the IME mode. This property should only be used for private web applications or to undo the property if it was previously set by legacy code.

\n
", "formalSyntax": "auto | normal | active | inactive | disabled", "values": { "auto": "No change is made to the current input method editor state. This is the default.", @@ -42,10 +42,10 @@ "scroll-snap-coordinate": { "url": "$MDN_URL$/web/CSS/scroll-snap-coordinate", "status": [ - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The scroll-snap-coordinate CSS property defines the x and y coordinate positions within an element that will align with its nearest ancestor scroll container's scroll-snap-destination for each respective axis.

\n
/* Keyword value */\nscroll-snap-coordinate: none;\n/* <position> values */\nscroll-snap-coordinate: 50px 50px;                   /* Single coordinate */\nscroll-snap-coordinate: 100px 100px, 100px bottom;   /* Multiple coordinates */\n/* Global values */\nscroll-snap-coordinate: inherit;\nscroll-snap-coordinate: initial;\nscroll-snap-coordinate: unset;
\n

If the element has been transformed, the snap coordinates are likewise transformed, thus aligning the snap points with the element as it is displayed.

", + "doc": "The scroll-snap-coordinate CSS property defines the x and y coordinate positions within an element that will align with its nearest ancestor scroll container's scroll-snap-destination for each respective axis.

\n
/* Keyword value */\nscroll-snap-coordinate: none;\n/* <position> values */\nscroll-snap-coordinate: 50px 50px;                   /* Single coordinate */\nscroll-snap-coordinate: 100px 100px, 100px bottom;   /* Multiple coordinates */\n/* Global values */\nscroll-snap-coordinate: inherit;\nscroll-snap-coordinate: initial;\nscroll-snap-coordinate: unset;
\n

If the element has been transformed, the snap coordinates are likewise transformed, thus aligning the snap points with the element as it is displayed.

", "formalSyntax": "none | <position>#\n  <position> = [ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]\n    <length-percentage> = <length> | <percentage>", "values": { "none": "Specifies that the element does not contribute to a snap point.", @@ -55,10 +55,10 @@ "scroll-snap-destination": { "url": "$MDN_URL$/web/CSS/scroll-snap-destination", "status": [ - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The scroll-snap-destination CSS property defines the position in x and y coordinates within the scroll container's visual viewport which element snap points align with.

\n
/* <position> value */\nscroll-snap-destination: 400px 600px;\n/* Global values */\nscroll-snap-destination: inherit;\nscroll-snap-destination: initial;\nscroll-snap-destination: unset;\n
", + "doc": "The scroll-snap-destination CSS property defines the position in x and y coordinates within the scroll container's visual viewport which element snap points align with.

\n
/* <position> value */\nscroll-snap-destination: 400px 600px;\n/* Global values */\nscroll-snap-destination: inherit;\nscroll-snap-destination: initial;\nscroll-snap-destination: unset;\n
", "formalSyntax": "<position>\n  <position> = [ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]\n    <length-percentage> = <length> | <percentage>", "values": { "<position>": "Specifies the offset of the snap destination from the start edge of the scroll container’s visual viewport. The first value gives the x coordinate of the snap destination, the second value its y coordinate." @@ -67,10 +67,10 @@ "scroll-snap-points-x": { "url": "$MDN_URL$/web/CSS/scroll-snap-points-x", "status": [ - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The scroll-snap-points-x CSS property defines the horizontal positioning of snap points within the content of the scroll container they are applied to.

\n
/* Keyword value */\nscroll-snap-points-x: none;\n/* Repeating snap points */\nscroll-snap-points-x: repeat(400px);\n/* Global values */\nscroll-snap-points-x: inherit;\nscroll-snap-points-x: initial;\nscroll-snap-points-x: unset;\n
", + "doc": "The scroll-snap-points-x CSS property defines the horizontal positioning of snap points within the content of the scroll container they are applied to.

\n
/* Keyword value */\nscroll-snap-points-x: none;\n/* Repeating snap points */\nscroll-snap-points-x: repeat(400px);\n/* Global values */\nscroll-snap-points-x: inherit;\nscroll-snap-points-x: initial;\nscroll-snap-points-x: unset;\n
", "formalSyntax": "none | repeat( <length-percentage> )\n  <length-percentage> = <length> | <percentage>", "values": { "none": "The scroll container does not define any snap points. Elements within the scroll container may still define snap points on behalf of the scroll container.", @@ -80,10 +80,10 @@ "scroll-snap-points-y": { "url": "$MDN_URL$/web/CSS/scroll-snap-points-y", "status": [ - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The scroll-snap-points-y CSS property defines the vertical positioning of snap points within the content of the scroll container they are applied to.

\n
/* Keyword value */\nscroll-snap-points-y: none;\n/* Repeated snap points */\nscroll-snap-points-y: repeat(400px);\n/* Global values */\nscroll-snap-points-y: inherit;\nscroll-snap-points-y: initial;\nscroll-snap-points-y: unset;\n
", + "doc": "The scroll-snap-points-y CSS property defines the vertical positioning of snap points within the content of the scroll container they are applied to.

\n
/* Keyword value */\nscroll-snap-points-y: none;\n/* Repeated snap points */\nscroll-snap-points-y: repeat(400px);\n/* Global values */\nscroll-snap-points-y: inherit;\nscroll-snap-points-y: initial;\nscroll-snap-points-y: unset;\n
", "formalSyntax": "none | repeat( <length-percentage> )\n  <length-percentage> = <length> | <percentage>", "values": { "none": "The scroll container does not define any snap points. Elements within the scroll container may still define snap points on behalf of the scroll container.", @@ -93,13 +93,13 @@ "scroll-snap-type-x": { "url": "$MDN_URL$/web/CSS/scroll-snap-type-x", "status": [ - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "9", "SafariIOS": "9" }, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The scroll-snap-type-x CSS property defines how strictly snap points are enforced on the horizontal axis of the scroll container in case there is one.

\n

Specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent.

\n
/* Keyword values */\nscroll-snap-type-x: none;\nscroll-snap-type-x: mandatory;\nscroll-snap-type-x: proximity;\n/* Global values */\nscroll-snap-type-x: inherit;\nscroll-snap-type-x: initial;\nscroll-snap-type-x: unset;\n
", + "doc": "The scroll-snap-type-x CSS property defines how strictly snap points are enforced on the horizontal axis of the scroll container in case there is one.

\n

Specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent.

\n
/* Keyword values */\nscroll-snap-type-x: none;\nscroll-snap-type-x: mandatory;\nscroll-snap-type-x: proximity;\n/* Global values */\nscroll-snap-type-x: inherit;\nscroll-snap-type-x: initial;\nscroll-snap-type-x: unset;\n
", "formalSyntax": "none | mandatory | proximity", "values": { "none": "When the visual viewport of this scroll container is scrolled horizontally, it must ignore snap points.", @@ -110,10 +110,10 @@ "scroll-snap-type-y": { "url": "$MDN_URL$/web/CSS/scroll-snap-type-y", "status": [ - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The scroll-snap-type-y CSS property defines how strictly snap points are enforced on the vertical axis of the scroll container in case there is one.

\n

Specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent.

\n
/* Keyword values */\nscroll-snap-type-y: none;\nscroll-snap-type-y: mandatory;\nscroll-snap-type-y: proximity;\n/* Global values */\nscroll-snap-type-y: inherit;\nscroll-snap-type-y: initial;\nscroll-snap-type-y: unset;\n
", + "doc": "The scroll-snap-type-y CSS property defines how strictly snap points are enforced on the vertical axis of the scroll container in case there is one.

\n

Specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent.

\n
/* Keyword values */\nscroll-snap-type-y: none;\nscroll-snap-type-y: mandatory;\nscroll-snap-type-y: proximity;\n/* Global values */\nscroll-snap-type-y: inherit;\nscroll-snap-type-y: initial;\nscroll-snap-type-y: unset;\n
", "formalSyntax": "none | mandatory | proximity", "values": { "none": "When the visual viewport of this scroll container is scrolled vertically, it must ignore snap points.", diff --git a/xml/xml-psi-impl/src/com/intellij/documentation/mdn/DomEvents-obsolete.json b/xml/xml-psi-impl/src/com/intellij/documentation/mdn/DomEvents-obsolete.json index 3a6fa26ffc91..e65254166091 100644 --- a/xml/xml-psi-impl/src/com/intellij/documentation/mdn/DomEvents-obsolete.json +++ b/xml/xml-psi-impl/src/com/intellij/documentation/mdn/DomEvents-obsolete.json @@ -11,7 +11,7 @@ "events": { "overflow": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": { "Firefox": "" @@ -21,7 +21,7 @@ "show": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Firefox": "" @@ -30,7 +30,7 @@ }, "underflow": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": { "Firefox": "" diff --git a/xml/xml-psi-impl/src/com/intellij/documentation/mdn/Html-obsolete.json b/xml/xml-psi-impl/src/com/intellij/documentation/mdn/Html-obsolete.json index 3613f50ed8a6..d31fbc081ad7 100644 --- a/xml/xml-psi-impl/src/com/intellij/documentation/mdn/Html-obsolete.json +++ b/xml/xml-psi-impl/src/com/intellij/documentation/mdn/Html-obsolete.json @@ -13,12 +13,12 @@ "applet": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" }, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n
\n

The <applet> HTML element was removed in Gecko 56 and Chrome 47.

\n

Removal is being considered in WebKit and Edge.

\n
\n

The obsolete HTML Applet Element (<applet>) embeds a Java applet into the document; this element has been deprecated in favor of <object>.

\n

Use of Java applets on the Web is deprecated; most browsers no longer support use of plug-ins, including the Java plug-in.

", + "doc": "\n
\n

The <applet> HTML element was removed in Gecko 56 and Chrome 47.

\n

Removal is being considered in WebKit and Edge.

\n
\n

The obsolete HTML Applet Element (<applet>) embeds a Java applet into the document; this element has been deprecated in favor of <object>.

\n

Use of Java applets on the Web is deprecated; most browsers no longer support use of plug-ins, including the Java plug-in.

", "details": { "Content categories": "Flow content\n,\nphrasing content\n,\nembedded content\n, interactive content, palpable content.\n", "Permitted content": "Zero or more\n<param>\nelements, then\ntransparent\n.\n", @@ -30,7 +30,7 @@ "align": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -40,7 +40,7 @@ "alt": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -50,7 +50,7 @@ "archive": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -60,7 +60,7 @@ "code": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -70,7 +70,7 @@ "codebase": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -80,7 +80,7 @@ "datafld": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -90,7 +90,7 @@ "datasrc": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -100,7 +100,7 @@ "height": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -110,7 +110,7 @@ "hspace": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -120,7 +120,7 @@ "mayscript": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -130,7 +130,7 @@ "name": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -140,7 +140,7 @@ "object": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -150,7 +150,7 @@ "src": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -160,7 +160,7 @@ "vspace": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -170,7 +170,7 @@ "width": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Safari": "" @@ -182,11 +182,11 @@ "basefont": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { }, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The <basefont> HTML element is deprecated. It sets a default font face, size, and color for the other elements which are descended from its parent element. With this set, the font's size can then be varied relative to the base size using the <font> element.

\n

You should not use this element; instead, you should use CSS properties such as font, font-family, font-size, and color to change the font configuration for an element and its contents.

", + "doc": "The <basefont> HTML element is deprecated. It sets a default font face, size, and color for the other elements which are descended from its parent element. With this set, the font's size can then be varied relative to the base size using the <font> element.

\n

You should not use this element; instead, you should use CSS properties such as font, font-family, font-size, and color to change the font configuration for an element and its contents.

", "attrs": { "color": { "doc": "This attribute sets the text color using either a named color or a color specified in the hexadecimal #RRGGBB format." @@ -201,11 +201,11 @@ }, "bgsound": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": { }, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

Non-standard

\n

This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

\n
\n

The <bgsound> HTML element is deprecated. It sets up a sound file to play in the background while the page is used; use <audio> instead.

\n
\n

Do not use this! In order to embed audio in a Web page, you should be using the <audio> element.

\n
", + "doc": "
\n

Non-standard

\n

This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

\n
\n

The <bgsound> HTML element is deprecated. It sets up a sound file to play in the background while the page is used; use <audio> instead.

\n
\n

Do not use this! In order to embed audio in a Web page, you should be using the <audio> element.

\n
", "attrs": { "balance": { "doc": "This attribute defines a number between -10,000 and +10,000 that determines how the volume will be divided between the speakers." @@ -223,17 +223,17 @@ }, "blink": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The <blink> HTML element is a non-standard element which causes the enclosed text to flash slowly.

\n
Do not use this element as it is obsolete and is bad design practice. Blinking text is frowned upon by several accessibility standards and the CSS specification allows browsers to ignore the <blink> element.
" + "doc": "The <blink> HTML element is a non-standard element which causes the enclosed text to flash slowly.

\n
Do not use this element as it is obsolete and is bad design practice. Blinking text is frowned upon by several accessibility standards and the CSS specification allows browsers to ignore the <blink> element.
" }, "content": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The <content> HTML element—an obsolete part of the Web Components suite of technologies—was used inside of Shadow DOM as an insertion point, and wasn't meant to be used in ordinary HTML. It has now been replaced by the <slot> element, which creates a point in the DOM at which a shadow DOM can be inserted.

\n
\n

Note: Though present in early draft of the specifications and implemented in several browsers, this element has been removed in later versions of the spec, and should not be used. It is documented here to assist in adapting code written during the time it was included in the spec to work with newer versions of the specification.

\n
", + "doc": "The <content> HTML element—an obsolete part of the Web Components suite of technologies—was used inside of Shadow DOM as an insertion point, and wasn't meant to be used in ordinary HTML. It has now been replaced by the <slot> element, which creates a point in the DOM at which a shadow DOM can be inserted.

\n
\n

Note: Though present in early draft of the specifications and implemented in several browsers, this element has been removed in later versions of the spec, and should not be used. It is documented here to assist in adapting code written during the time it was included in the spec to work with newer versions of the specification.

\n
", "details": { "Content categories": "Transparent content\n.\n", "Permitted content": "Flow content\n.\n", @@ -250,13 +250,13 @@ "keygen": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Opera": "3", "Safari": "1.2" }, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The <keygen> HTML element exists to facilitate generation of key material, and submission of the public key as part of an HTML form. This mechanism is designed for use with Web-based certificate management systems. It is expected that the <keygen> element will be used in an HTML form along with other information needed to construct a certificate request, and that the result of the process will be a signed certificate.

", + "doc": "The <keygen> HTML element exists to facilitate generation of key material, and submission of the public key as part of an HTML form. This mechanism is designed for use with Web-based certificate management systems. It is expected that the <keygen> element will be used in an HTML form along with other information needed to construct a certificate request, and that the result of the process will be a signed certificate.

", "details": { "Content categories": "Flow content\n,\nphrasing content\n, interactive content,\nlisted\n,\nlabelable\n,\nsubmittable\n,\nresettable\nform-associated element\n, palpable content.\n", "Permitted content": "None, it is an\nempty element\n.\n", @@ -288,10 +288,10 @@ }, "menuitem": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The <menuitem> HTML element represents a command that a user is able to invoke through a popup menu. This includes context menus, as well as menus that might be attached to a menu button.

\n

A command can either be defined explicitly, with a textual label and optional icon to describe its appearance, or alternatively as an indirect command whose behavior is defined by a separate element. Commands can also optionally include a checkbox or be grouped to share radio buttons. (Menu items for indirect commands gain checkboxes or radio buttons when defined against elements <input type=\"checkbox\"> and <input type=\"radio\">.)

", + "doc": "The <menuitem> HTML element represents a command that a user is able to invoke through a popup menu. This includes context menus, as well as menus that might be attached to a menu button.

\n

A command can either be defined explicitly, with a textual label and optional icon to describe its appearance, or alternatively as an indirect command whose behavior is defined by a separate element. Commands can also optionally include a checkbox or be grouped to share radio buttons. (Menu items for indirect commands gain checkboxes or radio buttons when defined against elements <input type=\"checkbox\"> and <input type=\"radio\">.)

", "details": { "Content categories": "None.\n", "Permitted content": "None, it is an\nempty element\n.\n", @@ -303,7 +303,7 @@ "attrs": { "checked": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": { "Firefox": "8" @@ -312,7 +312,7 @@ }, "command": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": { "Firefox": "8" @@ -321,7 +321,7 @@ }, "default": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": { "Firefox": "8" @@ -330,7 +330,7 @@ }, "disabled": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": { "Firefox": "8" @@ -339,7 +339,7 @@ }, "icon": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": { "Firefox": "8" @@ -351,7 +351,7 @@ }, "radiogroup": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": { "Firefox": "8" @@ -360,7 +360,7 @@ }, "type": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": { "Firefox": "8" @@ -371,10 +371,10 @@ }, "shadow": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The <shadow> HTML element—an obsolete part of the Web Components technology suite—was intended to be used as a shadow DOM insertion point. You might have used it if you have created multiple shadow roots under a shadow host. It is not useful in ordinary HTML.

", + "doc": "The <shadow> HTML element—an obsolete part of the Web Components technology suite—was intended to be used as a shadow DOM insertion point. You might have used it if you have created multiple shadow roots under a shadow host. It is not useful in ordinary HTML.

", "details": { "Content categories": "Transparent content\n", "Permitted content": "Flow content\n", @@ -386,10 +386,10 @@ }, "spacer": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Non-standard

\n

This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

\n
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The <spacer> HTML element is an obsolete HTML element which allowed insertion of empty spaces on pages. It was devised by Netscape to accomplish the same effect as a single-pixel layout image, which was something web designers used to use to add white spaces to web pages without actually using an image. However, <spacer> no longer supported by any major browser and the same effects can now be achieved using simple CSS.

\n

Firefox, which is the descendant of Netscape's browsers, removed support for <spacer> in version 4.

", + "doc": "
\n

Non-standard

\n

This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

\n
\n

The <spacer> HTML element is an obsolete HTML element which allowed insertion of empty spaces on pages. It was devised by Netscape to accomplish the same effect as a single-pixel layout image, which was something web designers used to use to add white spaces to web pages without actually using an image. However, <spacer> no longer supported by any major browser and the same effects can now be achieved using simple CSS.

\n

Firefox, which is the descendant of Netscape's browsers, removed support for <spacer> in version 4.

", "attrs": { "align": { "doc": "This attribute determines alignment of spacer. Possible values are\nleft\n,\nright\nand\ncenter\n." diff --git a/xml/xml-psi-impl/src/com/intellij/documentation/mdn/MdnDocumentation.kt b/xml/xml-psi-impl/src/com/intellij/documentation/mdn/MdnDocumentation.kt index 992b6eff7aea..02331273e9a4 100644 --- a/xml/xml-psi-impl/src/com/intellij/documentation/mdn/MdnDocumentation.kt +++ b/xml/xml-psi-impl/src/com/intellij/documentation/mdn/MdnDocumentation.kt @@ -22,6 +22,7 @@ import com.intellij.psi.impl.source.html.dtd.HtmlSymbolDeclaration import com.intellij.psi.util.PsiTreeUtil import com.intellij.psi.xml.* import com.intellij.util.asSafely +import com.intellij.webSymbols.WebSymbolApiStatus import com.intellij.webSymbols.WebSymbolsBundle import com.intellij.xml.psi.XmlPsiBundle import com.intellij.xml.util.HtmlUtil @@ -175,8 +176,7 @@ private fun innerGetEventDoc(eventName: String): Pair val footnote: @Nls String? @@ -196,11 +196,15 @@ class MdnSymbolDocumentationAdapter(override val name: String, override val url: String? get() = doc.url?.let { fixMdnUrls(it, source.lang) } - override val isDeprecated: Boolean - get() = doc.status?.contains(MdnApiStatus.Deprecated) == true - - override val isExperimental: Boolean - get() = doc.status?.contains(MdnApiStatus.Experimental) == true + override val apiStatus: WebSymbolApiStatus + get() = doc.status?.let { + when { + it.contains(MdnApiStatus.Obsolete) -> WebSymbolApiStatus.Obsolete + it.contains(MdnApiStatus.Deprecated) -> WebSymbolApiStatus.Deprecated + it.contains(MdnApiStatus.Experimental) -> WebSymbolApiStatus.Experimental + else -> null + } + } ?: WebSymbolApiStatus.Stable override val description: String get() = capitalize(doc.doc ?: "").fixUrls() @@ -331,7 +335,7 @@ data class MdnCssBasicSymbolDocumentation(override val url: String?, @JsonDeserialize(using = CompatibilityMapDeserializer::class) override val compatibility: CompatibilityMap?, override val doc: String?, - val formalSyntax: String?) : MdnRawSymbolDocumentation{ + val formalSyntax: String?) : MdnRawSymbolDocumentation { override val sections: Map get() { val result = mutableMapOf() @@ -348,7 +352,7 @@ data class MdnCssAtRuleSymbolDocumentation(override val url: String?, override val compatibility: CompatibilityMap?, override val doc: String?, val properties: Map?, - val formalSyntax: String?) : MdnRawSymbolDocumentation{ + val formalSyntax: String?) : MdnRawSymbolDocumentation { override val sections: Map get() { val result = mutableMapOf() @@ -392,7 +396,8 @@ enum class MdnApiNamespace { enum class MdnApiStatus { Experimental, StandardTrack, - Deprecated + Deprecated, + Obsolete } enum class MdnJavaScriptRuntime(displayName: String? = null, mdnId: String? = null, val firstVersion: String = "1") { diff --git a/xml/xml-psi-impl/src/com/intellij/documentation/mdn/MdnDocumentedSymbol.kt b/xml/xml-psi-impl/src/com/intellij/documentation/mdn/MdnDocumentedSymbol.kt index 877d5a714adf..394e34ef7763 100644 --- a/xml/xml-psi-impl/src/com/intellij/documentation/mdn/MdnDocumentedSymbol.kt +++ b/xml/xml-psi-impl/src/com/intellij/documentation/mdn/MdnDocumentedSymbol.kt @@ -15,11 +15,7 @@ abstract class MdnDocumentedSymbol : WebSymbol { protected abstract fun getMdnDocumentation(): MdnSymbolDocumentation? override val apiStatus: WebSymbolApiStatus - get() = when { - mdnDoc?.isDeprecated == true -> WebSymbolApiStatus.Deprecated - mdnDoc?.isExperimental == true -> WebSymbolApiStatus.Experimental - else -> WebSymbolApiStatus.Stable - } + get() = mdnDoc?.apiStatus ?: WebSymbolApiStatus.Stable override val description: String? get() = mdnDoc?.description diff --git a/xml/xml-psi-impl/src/com/intellij/documentation/mdn/Svg-obsolete.json b/xml/xml-psi-impl/src/com/intellij/documentation/mdn/Svg-obsolete.json index 8cc3dc331faa..d84406cf8b29 100644 --- a/xml/xml-psi-impl/src/com/intellij/documentation/mdn/Svg-obsolete.json +++ b/xml/xml-psi-impl/src/com/intellij/documentation/mdn/Svg-obsolete.json @@ -13,7 +13,7 @@ "altglyph": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": { "Chrome": "", @@ -23,12 +23,12 @@ "Safari": "4", "SafariIOS": "4" }, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The <altGlyph> SVG element allows sophisticated selection of the glyphs used to render its child character data.

", + "doc": "The <altGlyph> SVG element allows sophisticated selection of the glyphs used to render its child character data.

", "attrs": { "dx": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": {}, "doc": "This attribute indicates a shift along the x-axis on the position of the element.\n
\nValue type: <list-of-coordinates> ; Default value: Relative x-coordinate of ancestor <text> or <tspan>; Animatable: yes" @@ -36,7 +36,7 @@ "dy": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": {}, "doc": "This attribute indicates a shift along the x-axis on the position of the element.\n
\nValue type: <list-of-coordinates> ; Default value: Relative y-coordinate of ancestor <text> or <tspan>; Animatable: yes" @@ -44,7 +44,7 @@ "format": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": {}, "doc": "The format of the given font.\n
\nValue type: <string> ; Default value: none; Animatable: no" @@ -52,14 +52,14 @@ "glyphref": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": {} }, "rotate": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": {}, "doc": "This attribute defines the supplemental rotation that will be applied to the element.\n
\nValue type: <list-of-numbers> ; Default value: none; Animatable: yes (non-additive)" @@ -67,7 +67,7 @@ "x": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": {}, "doc": "This attribute defines the corresponding absolute x-coordinates for rendering the element.\n
\nValue type: <list-of-coordinates> ; Default value: Absolute x-coordinate of ancestor <text> or <tspan>; Animatable: yes" @@ -78,7 +78,7 @@ "y": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": {}, "doc": "This attribute defines the corresponding absolute y-coordinates for rendering the element.\n
\nValue type: <list-of-coordinates> ; Default value: Absolute y-coordinate of ancestor <text> or <tspan>; Animatable: yes" @@ -88,44 +88,44 @@ "altglyphdef": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The <altGlyphDef> SVG element defines a substitution representation for glyphs.

" + "doc": "The <altGlyphDef> SVG element defines a substitution representation for glyphs.

" }, "altglyphitem": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n

The <altGlyphItem> element provides a set of candidates for glyph substitution by the <altGlyph> element.

" + "doc": "The <altGlyphItem> element provides a set of candidates for glyph substitution by the <altGlyph> element.

" }, "animatecolor": { "status": [ - "Deprecated" + "Obsolete" ], "compatibility": {}, - "doc": "
\n

Deprecated

\n

This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

\n
\n
\n

This element has been deprecated in SVG 1.1 Second Edition and may be removed in a future version of SVG. It provides no features not already available by using the <animate> element. So, authors should use the <animate> element instead.

\n
\n

The <animateColor> SVG element specifies a color transformation over time.

", + "doc": "
\n
\n

This element has been deprecated in SVG 1.1 Second Edition and may be removed in a future version of SVG. It provides no features not already available by using the <animate> element. So, authors should use the <animate> element instead.

\n
\n

The <animateColor> SVG element specifies a color transformation over time.

", "attrs": { "by": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": {} }, "from": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": {} }, "to": { "status": [ "StandardTrack", - "Deprecated" + "Obsolete" ], "compatibility": {} } diff --git a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/html/dtd/HtmlElementDescriptorImpl.java b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/html/dtd/HtmlElementDescriptorImpl.java index a7bfaaaa68e9..551e647b29c5 100644 --- a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/html/dtd/HtmlElementDescriptorImpl.java +++ b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/html/dtd/HtmlElementDescriptorImpl.java @@ -23,6 +23,7 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.xml.XmlTag; import com.intellij.util.containers.ContainerUtil; +import com.intellij.webSymbols.WebSymbolApiStatus; import com.intellij.xml.XmlAttributeDescriptor; import com.intellij.xml.XmlDeprecationOwnerDescriptor; import com.intellij.xml.XmlElementDescriptor; @@ -250,7 +251,8 @@ public class HtmlElementDescriptorImpl extends BaseXmlElementDescriptorImpl impl boolean html4Deprecated = ourHtml4DeprecatedTags.contains(myDelegate.getName()); MdnSymbolDocumentation documentation = doIfNotNull( myDelegate.getDeclaration(), declaration -> MdnDocumentationKt.getHtmlMdnDocumentation(declaration, null)); - boolean html5Deprecated = documentation != null && documentation.isDeprecated() || ourHtml5DeprecatedTags.contains(myDelegate.getName()); + boolean html5Deprecated = documentation != null && WebSymbolApiStatus.isDeprecatedOrObsolete(documentation.getApiStatus()) + || ourHtml5DeprecatedTags.contains(myDelegate.getName()); if (!html4Deprecated && !html5Deprecated) { return false; }