https://github.com/nfour/sublime-coffeescript-syntax
https://github.com/nfour/sublime-coffeescript-syntax
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nfour/sublime-coffeescript-syntax
- Owner: nfour
- Created: 2015-04-11T06:36:09.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-04-11T10:53:09.000Z (over 11 years ago)
- Last Synced: 2024-10-11T23:11:24.946Z (almost 2 years ago)
- Size: 121 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Coffeescript .tmLanguage

This is built off of [Better CoffeeScript](https://packagecontrol.io/packages/Better%20CoffeeScript).
### Features
- Adds function call highlighting scope `meta.function-call.coffee`
This includes `fn 1`, `fn(1)`
```
fn ++something
fn( {something: 1} )
fn
something: 1
```
- Removes a lot of variable assignment scopes that cannot be always gauranteed.
In this example, `something` can't be detected with `.tmLanguage` hightlighting
```coffee
{
something
} = stuff
```
There are many more instances of this. The philosophy is that everything is a variable until specified otherwise. Object keys for example are kept.
- Dots in `some.thing.here()` are always highlighted, in parameter lists etc.
- `{}[]().=>->""''` characters are ensured scopes
- Adds JSX highlighting.
+ Not 100% complete but works for most cases at the moment. Some nesting scenarios produce bad highliting, need to look into it further.
### Install
- Clone this repo into `./Data/Packages/`.
- Select this `CoffeeScript` for your CoffeeScript files in the statusbar's dropdown.
- To use this `.tmLanguage` alongside another addon; simply replace it. With packaged apps this would mean creating the path `./Data/Packages/Better CoffeeScript/CoffeeScript.tmLanguage` (Thus overwriting the file inside the package in `./Data/Installed Packages/` package). There may be an easier way but I have found trying to co-habitat with two identically named synates results in this one reverting.
### Further work
- I will eventually rewrite the whole thing using the new YAML ST3 highlighting syntax which apparently allows for more flexibility. This should ensure better coverage.