• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Valloric / ycmd / 1205
94%

Build:
DEFAULT BRANCH: master
Ran 25 Jan 2016 09:45PM UTC
Jobs 1
Files 42
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
1205

push

travis-ci

homu
Auto merge of #321 - puremourning:tern-plugins, r=vheon

[READY] Support Tern plugins by installing into a sandbox

# Overview

The Tern server supports a large number of plugins which add both functionality and databases of common libraries, like `express`. We want to allow users to install third party plugins to node_modules of the Tern runtime.  We also want to be able to install our own plugins to improve the user experience for all users.

This is not possible if we use a git submodule for Tern and simply run 'npm install' within the submodule source directory, as subsequent 'npm install tern-my-plugin' will (heinously) install another (arbitrary) version of Tern within the Tern source tree (e.g. third_party/tern/node_modules/tern. The reason for this is that the plugin that gets installed has "tern" as a dependency, and npm isn't smart enough to know that you're installing *within* the Tern distribution. Or it isn't intended to work that way.

So instead, we use a sandbox "runtime" directory and have a package.json within our "Tern runtime" directory (third_party/tern_runtime) that defines the packages that we require, including Tern and any plugins which we require as standard. This allows us to precisely control the version (and/or git commit) that is used by ycmd, while allowing additional plugins to be installed by users manually within a sandbox.

An additional benefit is that users don't need to check out the history of tern when installing, so we move to a released version of tern (0.17.0) rather than a particular git checkout.

# Summary of the change

- Remove the `third_party/tern` submodule
- Create the sandbox directory and put a `package.json` in it containing just the current dependencies (just tern)
- Update the tern version to 0.17.0, to pick up some recent fixes
- Update the `build.py` to run `npm install` in the sandbox directory instead of a tern submodule checkout

# Background

A user asked about how to install Tern plugins, and I [confidently described how I expected it to work](https://github.com/Valloric/YouCompleteMe/pull/1849#issuecomment-168111295), but to my shame, [it didn't](https://github.com/Valloric/YouCompleteMe/pull/1849#issuecomment-169161304). I wasn't able to find a convenient, canonical and controlled way to continue with the submodule approach, so moving to pure `npm` approach seemed more likely to work in the future. It appears this is the expected way of doing things with npm (at least, where not instilling packages 'globally').

Additionally, there is a [real-time diagnostics plugin](https://github.com/angelozerr/tern-lint) for tern, which we may consider in future. This structure would be required to support that.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/321)
<!-- Reviewable:end -->

2621 of 3165 relevant lines covered (82.81%)

0.83 hits per line

Jobs
ID Job ID Ran Files Coverage
5 1205.5 (USE_CLANG_COMPLETER=true YCMD_PYTHON_VERSION=2.7 COVERAGE=true) 25 Jan 2016 09:45PM UTC 0
82.81
Travis Job 1205.5
Source Files on build 1205
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1205
  • 5ed0aa75 on github
  • Prev Build on master (#1203)
  • Next Build on master (#1207)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc