Search code examples
javascriptace-editor

Ace Editor JavaScript AutoCompletion (2025)


I have AutoCompletion working in a rudimentary fashion in Ace Editor for JavaScript. I can type in a keyword, a period and have matches come up. I'd like to have actual "intellisense" functionality where I can feed my completer objects and such and have autocomplete work as I drill down into objects.

The tern extension seems like it would do what I want, but it appears to be a 3 year old fork of Ace, and that makes me a little uncomfortable running with it.

The "built-in" completer for Ace seems to pull in "everything" from the browser context it's running in, and that isn't going to work for me either. The code being edited will be running in an isolated V8 context, so browser (or NodeJS) globals won't be available (on purpose).

Before I go down the rabbit hole of rolling my own JavaScript interpreter logic, is there any more recent solution on this that I've missed in my searches?


Solution

  • The official way to add autocompletion to ace is https://github.com/mkslanc/ace-linters/ which adds it via LSP and typescript language service.