Autocompletion usage

How can i have object /array prototypes as part of autocompletion in @codemirror/lang-javascript?

function name() {
let obj = {
a = “test”;

Also when I type obj , a should be part of autocomplete suggestion . How can I do that?

That’s not something CodeMirror can do for you. It would require running some kind of type inference on the code. If you want a heavyweight solution, you could look into running a TypeScript language server and connecting autocompletion to that.

1 Like