fix: do not unnecessarily initialize TsScopedVariables to avoid querying the whole tree

This commit is contained in:
Akash Yadav
2023-10-16 22:17:51 +05:30
parent 0a5a5400a5
commit 33e6a4b7ad
@@ -190,11 +190,11 @@ open class TsAnalyzeManager(val languageSpec: TsLanguageSpec, var theme: TsTheme
}
fun updateStyles() {
val scopedVariables = TsScopedVariables(tree!!, localText, languageSpec)
if (thread != this || !messageQueue.isEmpty()) {
return
}
val scopedVariables = TsScopedVariables(tree!!, localText, languageSpec)
val oldTree = (styles.spans as LineSpansGenerator?)?.tree
val copied = tree!!.copy()
styles.spans = LineSpansGenerator(