I already did it in my project. I'd like to contribute it to https://github.com/codemirror/lang-json if there are some developers who believe it's worth it.
In my case, users will type the golang template function name. I hope the autocompletion could help my users. So they don't need to remember or check the function names.