I'm working on a version of intellisense for a new query language, currently using the left parenthesis as a trigger character for intellisense suggestions. A common usage is to type items(
and then show a list of suggestions for relevant items.
However, some of these items contain trigger characters in the name, such as "banana(yellow)"
and I'm wondering if there's a simple way to indicate to the monaco worker that I'd like to ignore triggers typed within strings, so that the suggestions are not recompiled when I type the parenthesis before "yellow." So I want to type items("banana(yellow)")
and receive a list of new suggestions after the first left parenthesis, but not after the second.
Specifically, I'm wondering if this is something that will need to be addressed in the onDidType method, or later in completionItemsProvider, or whether it will need to be addressed somewhere else entirely, perhaps with a boolean flag I'm missing.
I have never tried this myself, but here are 2 ideas:
You probably have set the trigger characters in your code completion provider. Try changing this value when you don't want a specific character (here open par) to trigger the provider.
There's a flag name
suggestOnTriggerCharacters
in theIEditorOptions
interface. You could temporarily switch options when you don't want the suggestion box to come up while you are in a string.