mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add ._js & ._coffee extensions for Streamline.js.
Streamline.js by Bruno Jouhier (@Sage) is a library/tool that lets you write synchronous-looking JavaScript/CoffeeScript, and have it compile to Node-style asynchronous JavasScript/CoffeeScript. (It's amazing and super elegant.) https://github.com/Sage/streamlinejs From the start, Streamline was designed to be exactly JavaScript/CoffeeScript, so that it works with existing editors and tools. No new keywords or syntax -- it simply reserves `_` as a function parameter name. Streamline files have thus kept `.js` and `.coffee` as extensions, so that no changes need to be made to tools; Streamline has just used the convention of ending file basenames with `_`, like `foo_.js` or `foo_.coffee`. Unfortunately, to get the most optimal Node.js integration, with on-the-fly compilation (like CoffeeScript), files now need to have their own extension. So Bruno has decided to make `._js` and `._coffee` the extensions of choice. The good news is that the language is still exactly JavaScript/CoffeeScript; it's only the extension that's changed. It's simple to add these extensions into our editors, but I'm wondering if we can add this to GitHub too. =) This change is super simple and shouldn't affect any other language, so I hope you guys are open to it. Thanks for your consideration!
This commit is contained in:
@@ -217,6 +217,7 @@ CoffeeScript:
|
|||||||
aliases:
|
aliases:
|
||||||
- coffee
|
- coffee
|
||||||
extensions:
|
extensions:
|
||||||
|
- ._coffee
|
||||||
- .coffee
|
- .coffee
|
||||||
filenames:
|
filenames:
|
||||||
- Cakefile
|
- Cakefile
|
||||||
@@ -586,6 +587,7 @@ JavaScript:
|
|||||||
- node
|
- node
|
||||||
primary_extension: .js
|
primary_extension: .js
|
||||||
extensions:
|
extensions:
|
||||||
|
- ._js
|
||||||
- .bones
|
- .bones
|
||||||
- .jake
|
- .jake
|
||||||
- .js
|
- .js
|
||||||
|
|||||||
@@ -252,6 +252,11 @@ class TestLanguage < Test::Unit::TestCase
|
|||||||
assert_equal Language['PHP'], Language.find_by_extension('php5')
|
assert_equal Language['PHP'], Language.find_by_extension('php5')
|
||||||
assert_equal Language['PowerShell'], Language.find_by_extension('psm1')
|
assert_equal Language['PowerShell'], Language.find_by_extension('psm1')
|
||||||
assert_equal Language['PowerShell'], Language.find_by_extension('ps1')
|
assert_equal Language['PowerShell'], Language.find_by_extension('ps1')
|
||||||
|
|
||||||
|
# Aliases for Streamline.js ( https://github.com/Sage/streamlinejs )
|
||||||
|
assert_equal Language['JavaScript'], Language.find_by_extension('_js')
|
||||||
|
assert_equal Language['CoffeeScript'], Language.find_by_extension('_coffee')
|
||||||
|
|
||||||
assert_nil Language.find_by_extension('.nkt')
|
assert_nil Language.find_by_extension('.nkt')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user