pulsar-cooperative / pulsar-ternjs

JavaScript code intelligence for Pulsar with tern.js and autocomplete-plus
MIT License
1 stars 0 forks source link
pulsar-package

atom-ternjs

[!NOTE] This package was originally created by tststs and has now been forked under the pulsar-cooperative organization. By forking this package we hope to allow new maintainers to work on this package as needed, without being limited by its previous [archived] status, helping to ensure this package stays up to date and functional for as long as possible without the huge responsibility implied by forking and maintaining this under a personal account.

For more info on the Pulsar Cooperative initiative please read the documentation.

JavaScript code intelligence for atom with Tern. Adds support for ES5, ES6, ES7, ES8, Node.js and more. Extendable via plugins. Uses suggestion provider by autocomplete-plus.

Get started (configure your project)

Get started (in case you can't use configure your project)

Example .tern-project file (customize to your own needs):

{
  "ecmaVersion": 8,
  "libs": [
    "browser"
  ],
  "loadEagerly": [
    "path/to/your/js/**/*.js"
  ],
  "dontLoad": [
    "node_modules/**",
    "path/to/your/js/**/*.js"
  ],
  "plugins": {
    "es_modules": {},
    "node": {},
    "doc_comment": {
      "fullDocs": true,
      "strong": true
    }
  }
}

EcmaVersion

Libs

Options

Plugins

Example configurations

Keybindings

List of keybindings. To use your own keybindings goto pulsar-ternjs package settings and disable keybindings.

Third party plugins

In order to use third party plugins (e.g. tern-node-express):

$ cd ~/.pulsar/packages/pulsar-ternjs
$ npm install tern-node-express

Add the plugin to your .tern-project file:

{
  "ecmaVersion": 8,
  "libs": [
    "browser"
  ],
  "loadEagerly": [
    "app/**/*.js"
  ],
  "plugins": {
    "node-express": {}
  }
}

Third party plugins are still an issue and sometimes do not work as expected, especially if the plugin requires a tern version that does not match the tern version that is used by pulsar-ternjs.

Restart the server: Packages -> Pulsar Ternjs -> Restart server

.tern-project created/modified

Features

pulsar-ternjs

pulsar-ternjs

Click any item in the generated reference-list and navigate directly to file and position

pulsar-ternjs