[webSymbols] WebSymbolsCompoundScope - require resolve by default to avoid accidental performance problems.

(cherry picked from commit 734b1b90585b21d702dbe3b3fcf6a249ab0a4f62)

IJ-CR-155990

GitOrigin-RevId: c82898d5c8d7223d7ee517759af7697cea2a5d36
This commit is contained in:
Piotr Tomiak
2025-02-24 12:45:44 +01:00
committed by intellij-monorepo-bot
parent e047fd7665
commit 81c808783c
3 changed files with 6 additions and 0 deletions

View File

@@ -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

View File

@@ -22,6 +22,7 @@ abstract class WebSymbolsCompoundScope : WebSymbolsScope {
consumer: (WebSymbolsScope) -> Unit)
fun getScopes(queryExecutor: WebSymbolsQueryExecutor): List<WebSymbolsScope> {
if (requiresResolve() && !queryExecutor.allowResolve) return emptyList()
val list = mutableListOf<WebSymbolsScope>()
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<WebSymbolsScope>): List<WebSymbol> =

View File

@@ -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