Esprima (autocomplete, definition search, validation, and more)


There are loads of requirements for smart and good IDE. As goal for is to be hackable and accessible IDE regardless of your language you are working with or platform.

This has benefits for general audience, but has negatives for specifics of different languages, when they could be a bit better supported.

I am wondering: is it possible to load module dynamically, for example if someone opens .js file, it would load module and then during session reuse it.
Module would be for analysing code, one of the options would be Esprima, as it has loads of great features that would dramatically enrich JS developers experience.

Developer Tools autocomplete in main editor

It should be possible to load modules dynamically, yes. I’m working on a module for working with Idris files, which is best done by having a background-processes of idris --ideslave running, and communicating with it.
To ensure that this Idris process doesn’t launch when Atom launches, I launch the process when the first .idr-file is opened, and shut it down when the last .idr-file is closed again.

So it is definitely possible to determine when a language-type-dependent module should be activated/deactivated. It should also be possible to create a general purpose module that can activate/deactivate other modules on-demand by invoking their activation-event.

So the question is if this should be done on a grammar-scope level (that is, when files with the grammar N is opened/closed) or on a file-extention level (that is, when .ext-files are opened/closed).
It’s probably saner to do it on grammars, so that both .coffee and .cson can launch a CoffeeScript-enhancement module.

I don’t mind trying to generalise what I have already done into such a dynamic-activation module - but how do people feel about such a functionality?