I have custom completion source added to javascript
extension:
javascript(),
javascriptLanguage.data.of({autocomplete: javascriptCompletionSource})
Context: I have some panel created with ViewPlugin.fromClass
. This panel contains autocompletions list. In update
method I get completions and add them into container (default suggestions work properly):
if (!update.docChanged) {
return
}
const tokens = currentCompletions(update.state)
tokensContainerElement.innerHTML = tokens.map(createTokenElement)
The problem I’m facing: suggestions from javascriptCompletionSource
are not returned from currentCompletions
, moreover, logic inside javascriptCompletionSource
has been triggered after currentCompletions
gets called. Default suggestions coming from javascript()
extension work properly.
CompletionSource
successfully matched in javascriptCompletionSource
, so I expected it to be returned from currentCompletions
, but it’s not.
I wondered if this problem related to some delaying issue (tasks queue), so I tried to get autocompletions with timeout ~250ms. I managed to make javascriptCompletionSource
being called and return its completions earlier, than currentCompletions
, but still got nothing…
I also tried to play around with interactionDelay
config field (higher delay), tried to call startCompletion
before currentCompletions
, didn’t help.
Did anyone meet this problem?