Skip to content

This is a hack of the sublime plugin 'tern_for_sublime', adding CoffeeScript support.

Notifications You must be signed in to change notification settings

eosterberg/coffeescript_tern_for_sublime

Repository files navigation

Tern for Sublime Text

This is a tweak of the sublime plugin 'tern_for_sublime', adding code-completion for CoffeeScript.

It is based on this fork of the official Tern.js library. I just upgraded it to the latest version of CoffeeScript (1.7.1).

Installation

Check out the code in this repository into a subdirectory of your Sublime Text's Packages directory.

cd /path/to/sublime-text-N/Packages
git clone https://github.com/eosterberg/coffeescript_tern_for_sublime.git

The dependencies are included in this repo.

This plugin is just a ugly hack and wont work together with the original plugin. If you want to enjoy Tern for JavaScript, you can use sublime-tern, which is another Tern plugin for Sublime. It works really well.

Configuration

Tern uses .tern-project files to configure loading libraries and plugins for a project. See the Tern docs for details.

To get autocompletion from multiple sources, add COMPILED .js files (not .coffee) to the "loadEagerly" list in your .tern-project

"loadEagerly": [
    "*.js",
    "anotherFolder/*.js"
]

This is a bit limited and wont work as well as the original plugin, but its still useful.

Automatically Showing Completions

Add {"selector": "source.coffee", "characters": "."} to your auto_complete_triggers preference array to automatically show completions after a dot is typed following an object name.

Example:

"auto_complete_triggers": [ {"selector": "text.html", "characters": "<"}, {"selector": "source.coffee", "characters": "."} ]

Ensure that your auto_complete preference is set to true. It's enabled by default.

Enjoy!

About

This is a hack of the sublime plugin 'tern_for_sublime', adding CoffeeScript support.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages