i want to type ‘[’ to show completion list [‘param1’,‘param2’,‘param3’] (for expample), and type ‘@’ to show completion list [‘func1’, ‘func2’, ‘func3’]。
i use extension blow to start completion
keymap.of([{
key: '[',
run: startCompletion,
}])
but in CompletionSource, i want to know this completion is triggered by ‘[’, so that i can filter the list just has [‘param1’,‘param2’,‘param3’]
return (context: CompletionContext) => {
const token = context.matchBefore(match);
// i want to filter options by trigger key '['
return { from: token ? token.from : context.pos, options, validFor };
};
Thank you anyhow!