From c6b3450bd0aab1d3342784f0326a0f772ab6b5f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20Engstr=C3=B6m?= Date: Wed, 18 Dec 2024 10:52:09 +0100 Subject: [PATCH] Put back call to getQualifiers on update --- .../src/lib/extensions/lxlQualifierPlugin/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/supersearch/src/lib/extensions/lxlQualifierPlugin/index.ts b/packages/supersearch/src/lib/extensions/lxlQualifierPlugin/index.ts index 1e15d147d..25339e9e6 100644 --- a/packages/supersearch/src/lib/extensions/lxlQualifierPlugin/index.ts +++ b/packages/supersearch/src/lib/extensions/lxlQualifierPlugin/index.ts @@ -148,9 +148,10 @@ function lxlQualifierPlugin(getLabelFn?: GetLabelFunction) { update(update: ViewUpdate) { if (update.docChanged || syntaxTree(update.startState) != syntaxTree(update.state)) { - // let's see how it works to run getQualifiers only on new data and not on input - // should be much better for performande... - // this.qualifiers = getQualifiers(update.view); + // TODO: Calling getQualifiers on every document change is probably not good for performance + // Try optimizing; either run the function only on certain kinds of input, or split getQualifiers; + // one that updates the widgets (on input) and one that looks for labels (on data update) + this.qualifiers = getQualifiers(update.view); } else { for (const tr of update.transactions) { for (const e of tr.effects) {