https://github.com/othree/tern-coffee
Use a work around way to let tern.js play with CoffeeScript.
https://github.com/othree/tern-coffee
Last synced: about 1 year ago
JSON representation
Use a work around way to let tern.js play with CoffeeScript.
- Host: GitHub
- URL: https://github.com/othree/tern-coffee
- Owner: othree
- License: mit
- Created: 2014-06-07T07:47:16.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2018-03-08T00:39:51.000Z (over 8 years ago)
- Last Synced: 2025-03-24T14:40:55.618Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://www.npmjs.org/package/tern-coffee
- Size: 8.79 KB
- Stars: 19
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Tern for CoffeeScript plugins
=============================
Use a work around way to let tern.js play with CoffeeScript.
Requirement
-----------
Tern.js 0.6 and node environment.
Installation
------------
Use npm to install this plugin in tern's directory.
npm install tern-coffee
For example, vim user:
cd ~/.vim/bundle/tern_for_vim
npm install tern-coffee
Then you must let your editor enable tern for CoffeeScript files. Vim user
can install [tern_for_vim_coffee][2]. This is very simple plugin. You must install
both **tern_for_vim** and **tern_for_vim_coffee**
Last part is [.tern-project][3] file. It's required to use a plugin. Remember
to add `coffee` to plugin list.
[2]:https://github.com/othree/tern_for_vim_coffee
[3]:http://ternjs.net/doc/manual.html#configuration
How
---
Marijn [describes][1] how difficult to let tern support a new language. CoffeeScript only have source map support. There is no error tolerance CoffeeScript compiler available. So this is not a perfect solution.
The walk around solution is try to fix the editing CoffeeScript file before compile to JavaScript. Ex:
obj.
Will change to
obj.__fake__
Before compile. There are more fix rules. Not perfect but should ok for normal editing.
The base of source mapping logic is by [mntmn][4].
[1]:https://groups.google.com/d/msg/tern-dev/EQo8zJy4rXM/LCG7p1K3yg0J
[4]:https://github.com/mntmn/tern-coffeescript/blob/master/cs/coffee-reverse.js