Editor customization

Hi all.
I would like to ask you what is a proper way to create an extension for parameters autosuggestion.
For example:
when I type function name and first letter of literal parameter
then a list of suggestions appears for current parameter started with letter ‘A’ => might be [‘ARCHIVE’, ‘AARON’, ‘APPLE’…]
This list of suggestions will be received from some datasource.
Is a way I see to use showHint and ‘change’ event (Codemirror extension).
Is it possible solution or could you suggest more appropriate way to do this?