Community
Participate
Working Groups
With the fix to bug 432940, Tern is our default assist handler. To avoid force-loading a tonne of plugins, we need to add support for loading plugins on-demand. This will be useful for plugins added / removed / enabled from preferences and will work better with defined eslint-env directives.
If you wish to do that, I think you need to create a new instance of Tern server with the new plugins to load.
(In reply to Angelo ZERR from comment #1) > If you wish to do that, I think you need to create a new instance of Tern > server with the new plugins to load. I think we might be able to do it by trying: 1. load the plugin with require 2. using 'exports.registerPlugin' to make Tern aware of the new plugin 3. setting the defs from the plugin in Tern's list of defs 4. setting the passes from the plugin in Tern 5. issuing a #reset() on the server These are pretty much the steps The Tern constructor uses.
I pushed the skeleton for a plugin that will allow us to ask the server what plugins it has, and to install / remove plugins: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=8c34523ae99801def505e0c921c34ba69e741488
Pushed the complete plugins API + handler + listeners to: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=f009111dba9ca7144d386670f3eb9922dbbea24c The first implementation in the new API is a new request called 'installed_plugins', which, as you guessed, returns the complete listing of plugins currently known to Tern - these are all of the plugins defined when the server start and the ones that were added, and can include plugins defined but that could not be loaded by Tern. There are three other requests: 1. install_plugins - once implemented will allow a plugin(s) to be installed in Tern 2. remove_plugins - once implemented will allow a plugin(s) to be removed from Tern 3. plugin_enablement - once implemented will allow a plugin(s) to be enabled / disabled. I'm not so sure about the usefulness of this one though, its basically a remove to disable and and install to add. Maybe we can work it to turn them off without removing so we don;t lose plugin state.
Pushed fix to allow plugin and definition files to be loaded on demand when a tern project file is detected. If for any reason the loading fails, or the .tern-project file has problems (syntax or otherwise), the worker falls back to loading the default configuration. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=ddcc5f06cd249f7a27a1974a1979f5aa0559b861 Also added a new test suite for .tern-project file tests and a skeleton plugin for ESLint Since the hooks are in place to load plugins / defs as we need, I am going to close this bug as fixed, and have opened bug 483053 for the work to enable installing plugins via the pref page (or some other way).