Skip to content

Eclipse extension point for third party repository and/or tern module contributions #322

@demonfiddler

Description

@demonfiddler

Raised at Angelo's invitation, see #321.

The proposal is for an Eclipse extension point that would enable third party plug-ins to contribute a custom Tern repository (or Tern modules). These contributions would then be automatically included in the list of available modules when configuring your Tern Eclipse IDE workspace or Tern project. The extension point schema could be designed to allow a complete repository or individual modules to be contributed from a folder within a designated plug-in (defaulting to the plug-in contributing the extension). NOTE: I played around with such a schema but it soon became clear that implementing support for explicit module contributions would be hard, as the existing repository implementation seems to assume a fixed directory structure (metadata, node_modules/tern/defs|lib|node_modules|plugins).

Implementation note: the current repository implementation assumes that the modules are files in a physical file system, which forces plug-ins to be installed as unpacked directories rather than JAR files (the latter is generally preferred). However, given that these files are loaded by a JavaScript engine there's probably no alternative.

From issue 321: the default tern repository currently enumerates Tern modules as children of the node_modules/tern folder within the ternjs Eclipse plug-in. A binary plug-in's installed image should be treated as a read-only location. Eclipse plug-ins have a writable 'state location' (see Plugin.getStateLocation() : IPath), which would be an appropriate place for maintaining user-downloaded modules. So it might be better to aim for a 'composed repository' that presents the contents of several repositories as if they were a single repository. That way, you could still read the built-in modules from the ternjs binary plug-in image, read downloaded custom modules from the plug-in state location, and read additional repositories contributed by 3rd party Eclipse plug-ins via the proposed extension point from within their contributing plug-ins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions