CM6 Dynamic Configuration Question

My CompletionSource use a Dynamic list, which update in Linter .
I had to use compartments reconfigure my language when list updated.

Question:
Input will activate autocomplete UI, and after 500ms activate Linter, Linter will parse user-defined variable and put it in autocomplete list ,then reconfigure language compartment to apply the new list. But reconfigure language will close the autoComplete UI.

Now I use inefficiency method that judge the parse result equals to last time result to avoid reconfigure.
Is there any better way?

Does this patch help with this?

It’s work, UI Disappeared for a moment and show the new completion list.
But I think keep the old list will be better, the reason is simple:
User enter code like this:

var variableName = 123;

or without '='

var variableName

When the user entering the code and has not completed(such as ‘var varia’) , no matter what variableName the user enters, variableName is aways in new list, because it is always parsed and was added to the list.

I change my CompletionSource, now return empty list when matchBefore(/var \w+/),.
So I don’t need to worry about the var problems, Thanks :grin: