diff --git a/platform/webSymbols/api-dump-experimental.txt b/platform/webSymbols/api-dump-experimental.txt index 105bd3b18fa4..ce925487cbf5 100644 --- a/platform/webSymbols/api-dump-experimental.txt +++ b/platform/webSymbols/api-dump-experimental.txt @@ -770,6 +770,7 @@ - f:getScopes(com.intellij.webSymbols.query.WebSymbolsQueryExecutor):java.util.List - f:getSymbols(com.intellij.webSymbols.WebSymbolQualifiedKind,com.intellij.webSymbols.query.WebSymbolsListSymbolsQueryParams,com.intellij.util.containers.Stack):java.util.List - f:isExclusiveFor(com.intellij.webSymbols.WebSymbolQualifiedKind):Z +- p:requiresResolve():Z *:com.intellij.webSymbols.query.WebSymbolsListSymbolsQueryParams - com.intellij.webSymbols.query.WebSymbolsQueryParams - *sf:Companion:com.intellij.webSymbols.query.WebSymbolsListSymbolsQueryParams$Companion diff --git a/platform/webSymbols/src/com/intellij/webSymbols/query/WebSymbolsCompoundScope.kt b/platform/webSymbols/src/com/intellij/webSymbols/query/WebSymbolsCompoundScope.kt index 5b23228800fc..a46f97f03946 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/query/WebSymbolsCompoundScope.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/query/WebSymbolsCompoundScope.kt @@ -22,6 +22,7 @@ abstract class WebSymbolsCompoundScope : WebSymbolsScope { consumer: (WebSymbolsScope) -> Unit) fun getScopes(queryExecutor: WebSymbolsQueryExecutor): List { + if (requiresResolve() && !queryExecutor.allowResolve) return emptyList() val list = mutableListOf() build(queryExecutor) { if (it is WebSymbolsCompoundScope) @@ -34,6 +35,8 @@ abstract class WebSymbolsCompoundScope : WebSymbolsScope { return list } + protected open fun requiresResolve(): Boolean = true + final override fun getMatchingSymbols(qualifiedName: WebSymbolQualifiedName, params: WebSymbolsNameMatchQueryParams, scope: Stack): List = diff --git a/xml/xml-psi-impl/src/com/intellij/html/webSymbols/WebSymbolsHtmlQueryConfigurator.kt b/xml/xml-psi-impl/src/com/intellij/html/webSymbols/WebSymbolsHtmlQueryConfigurator.kt index 995ac64cc8e9..b98fe36e9edf 100644 --- a/xml/xml-psi-impl/src/com/intellij/html/webSymbols/WebSymbolsHtmlQueryConfigurator.kt +++ b/xml/xml-psi-impl/src/com/intellij/html/webSymbols/WebSymbolsHtmlQueryConfigurator.kt @@ -56,6 +56,8 @@ class WebSymbolsHtmlQueryConfigurator : WebSymbolsQueryConfigurator { override val priority: WebSymbol.Priority get() = WebSymbol.Priority.HIGHEST + override fun requiresResolve(): Boolean = false + override fun build(queryExecutor: WebSymbolsQueryExecutor, consumer: (WebSymbolsScope) -> Unit) { val context = location.parentOfTypes(XmlTag::class, XmlAttribute::class) val element = (context as? XmlTag) ?: (context as? XmlAttribute)?.parent ?: return