Question: How to augment language completion list with 'completeAnyWord'?

Hi there, and thanks for your continued and amazing work on this project.

I’m trying to use the new completeAnyWord feature to allow completing of words found in the document, for things such as user defined variables, etc.

At the moment, when used with the autocompletion({ override: [completeAnyWord] }), it seems—unsurprisingly—to override the language provided list.
What I’m looking for is something closer to a fallback/extraWords config option.
Is there a way to achieve this presently? Something else that may complicate my use case its that users can switch the syntax language on the fly.

Thanks in advance for any feedback,
Alex

Indeed, override completely replaces the completer. What probably works better for you (I’ll make a note to document it more properly) is something like EditorState.languageData.of(() => [{autocomplete: completeAnyWord}]), which registers completeAnyWord as a global completion source.

2 Likes

Can you suggest me, how to use “completeFromList” as autocomplete