Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] Custom JavaScript types in code-edit widget

Hi Sebastian,

> I have custom _javascript_ types I wish to incorporate in the code-edit widget. All I need for that, is a way to add the corresponding json structure to the tern plugin and make it available as an eslint
> environment (similar to the hard coded ecma5 or browser structures). How would I do that?

Currently there is no way to contribute a plugin to Tern.

We are planning to provide supportĀ (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=464823) that will work similarly to adding a normal plugin to Orion (which will eventually be used load / unload / add / remove plugins from Tern).

In the mean time you would have to fork the code and build in your custom plugin as everything is statically required within ternWorkerCore.js (found in:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/tree/bundles/org.eclipse.orion.client._javascript_/web/_javascript_/plugins/ternWorkerCore.js)

> Also, how would I add predefined global variables available in the eslint plugin.

Much the same way as extending Tern, you would have to add your env / type infos into the source and build it. You can hook in your types into the ESLint environments.js file, which can be found it:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/tree/bundles/org.eclipse.orion.client._javascript_/web/eslint/conf/environments.js

Michael Rennie


Back to the top