Giter Club home page Giter Club logo

language-coffee-script's Introduction

Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our official announcement

CoffeeScript language support in Atom

macOS Build Status Windows Build status Dependency Status

Adds syntax highlighting and snippets to CoffeeScript files in Atom.

Originally converted from the CoffeeScript TextMate bundle.

Contributions are greatly appreciated. Please fork this repository and open a pull request to add snippets, make grammar tweaks, etc.

language-coffee-script's People

Contributors

50wliu avatar abe33 avatar adrianlee44 avatar alhadis avatar cuberoot avatar damieng avatar darangi avatar fuqcool avatar hggeorg avatar ingramz avatar itsmapleleaf avatar jasonrudolph avatar jonboiser avatar kevinsawicki avatar lee-dohm avatar lenaic avatar maxbrunsfeld avatar mnquintana avatar notbobthebuilder avatar pchaigno avatar peterdavehello avatar prenaudin avatar roryokane avatar smashwilson avatar stickel avatar tad-lispy avatar thedaniel avatar torn4dom4n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

language-coffee-script's Issues

Not highlighting functions

Everything after do keyword is function except function declaration, and it should be highlighted accordingly
ci1

Single quote character problematic in CoffeeScript

Hi :)

I initially posted this issue over at github-linguist/linguist#2529, and they referred me over here:

I came across this when I was looking through a README (https://github.com/zooniverse/Panoptes-Front-End):

<ChangeListener target={auth}>{=>
  <PromiseRenderer promise={auth.checkCurrent()}>{(user) =>
    if user?
      <p>User is {user.display_name}</p>
    else
      <p>Nobody's signed in.</p>
  }</PromiseRenderer>
}</ChangeListener>

The single quote starts a string that doesn't end. I had a go at escaping it and I'm not sure that you can:

<ChangeListener target={auth}>{=>
  <PromiseRenderer promise={auth.checkCurrent()}>{(user) =>
    if user?
      <p>User is {user.display_name}</p>
    else
      <p>Nobody\'s signed in.</p>
  }</PromiseRenderer>
}</ChangeListener>

Is this a bug, or am I missing something incredibly obvious?

All the best,

Mike

entity.name.function is captured in two groups

the name of of a function has two capture groups.
looking at the grammar there seems to be 4 top level capture groups which makes me think it was intentional. (also took a look at the javascript grammar and this seems to be in line with function expressions there too =/ but different to function declarations which only capture the name in one group)

class SomeClass
  initialize: (param) -> null
  <span class="meta function coffee">
    <span class="entity name function coffee">
      "initializ"
      <span class="entity name function coffee">e</span>
   </span>
  </span>

screenshot of the dom:
image

screenshot of the grammar:
image

auto-indent produces non-equivalent coffeescript

hey kev,

awesome job so far on the cs language plugin and atom in general!

i just wanted to document the following scenario:

i have the following coffeescript:

module.exports =
  build_dir: 'build'
  compile_dir: 'bin'
  app_files:
    js: [ 'src/**/*.js', '!src/**/*.spec.js', '!src/assets/**/*.js' ]
    json: [ 'src/**/*.json' ]
    jsunit: [ 'src/**/*.spec.js' ]
    coffee: [ 'src/**/*.coffee', '!src/**/*.spec.coffee' ]
    coffeeunit: [ 'src/**/*.spec.coffee' ]
    atpl: [ 'src/app/**/*.tpl.html' ]
    ctpl: [ 'src/common/**/*.tpl.html' ]
    html: [ 'src/index.html' ]
    less: 'src/less/main.less'
  test_files:
    js: [ 'vendor/angular-mocks/angular-mocks.js' ]
  vendor_files:
    js: [
      'vendor/angular/angular.js'
      'vendor/angular-bootstrap/ui-bootstrap-tpls.min.js'
      'vendor/bower-angular-placeholders/angular-placeholders.js'
      'vendor/angular-ui-router/release/angular-ui-router.js'
      'vendor/angular-ui-utils/modules/route/route.js'
      # tk
      'vendor/jquery/dist/jquery.js'
      'vendor/bootstrap/dist/js/bootstrap.js'
      #'vendor/bootstrap/js/collapse.js'
      #'vendor/bootstrap/js/transition.js'
      'vendor/angular-flash/dist/angular-flash.js'
      'vendor/lodash/dist/lodash.js'
    ]
    css: []
    assets: [ 'vendor/font-awesome/fonts/*' ]
    fonts: [ 'vendor/font-awesome/fonts/*' ]

and when i run auto-indent on it, i get the following (notice how test_files lines up under less) non-equivalent coffeescript:

module.exports =
  build_dir: 'build'
  compile_dir: 'bin'
  app_files:
    js: [ 'src/**/*.js', '!src/**/*.spec.js', '!src/assets/**/*.js' ]
    json: [ 'src/**/*.json' ]
    jsunit: [ 'src/**/*.spec.js' ]
    coffee: [ 'src/**/*.coffee', '!src/**/*.spec.coffee' ]
    coffeeunit: [ 'src/**/*.spec.coffee' ]
    atpl: [ 'src/app/**/*.tpl.html' ]
    ctpl: [ 'src/common/**/*.tpl.html' ]
    html: [ 'src/index.html' ]
    less: 'src/less/main.less'
    test_files:
      js: [ 'vendor/angular-mocks/angular-mocks.js' ]
      vendor_files:
        js: [
          'vendor/angular/angular.js'
          'vendor/angular-bootstrap/ui-bootstrap-tpls.min.js'
          'vendor/bower-angular-placeholders/angular-placeholders.js'
          'vendor/angular-ui-router/release/angular-ui-router.js'
          'vendor/angular-ui-utils/modules/route/route.js'
          # tk
          'vendor/jquery/dist/jquery.js'
          'vendor/bootstrap/dist/js/bootstrap.js'
          #'vendor/bootstrap/js/collapse.js'
          #'vendor/bootstrap/js/transition.js'
          'vendor/angular-flash/dist/angular-flash.js'
          'vendor/lodash/dist/lodash.js'
        ]
        css: []
        assets: [ 'vendor/font-awesome/fonts/*' ]
        fonts: [ 'vendor/font-awesome/fonts/*' ]

regards,
tony.

RegEx: lookbehinds not supported by javascript

I was looking for a regex to identify function names and saw this:

{
  'captures':
    '1':
      'name': 'entity.name.function.coffee'
    '2':
      'name': 'entity.name.function.coffee'
    '3':
      'name': 'variable.parameter.function.coffee'
    '4':
      'name': 'storage.type.function.coffee'
  'match': '(?x)\n\t\t\t\t(?<=^|\\s)\n\t\t\t\t(?=@?[a-zA-Z\\$_])\n\t\t\t\t(\n\t\t\t\t\t@?[a-zA-Z\\$_](\\w|\\$|:|\\.)*\\s*\n\t\t\t\t\t(?=[:=](\\s*\\(.*\\))?\\s*([=-]>))\n\t\t\t\t)\n\t\t\t'
  'name': 'meta.function.coffee'
}

Now the regEx is ported from textmate and equals:

(?x)
(?<=^|\s)
(?=@?[a-zA-Z\$_])
(
    @?[a-zA-Z\$_](\w|\$|:|\.)*\s*
    (?=[:=](\s*\(.*\))?\s*([=-]>))
)

Trying to use it though threw me errors for the content of line 1 and line 2. Upon research it seems that

  • (?<=^|\s) lookbehinds are not supported by javascript.
  • (?x) I dont even know what this is supposed to do?

Removing those makes the regex work perfectly fine. Bug or is atom implementing lookbehinds somewhere else?

Highlighting functions with multi line arguments not working

Consider this:

module.exports=
class Commit extends Treeish

  initialize: (
    ref
    repo
    @tree
    @parents
    @author
    @authoredDate
    @committer
    @committedDate
    @gpgsig
    @message
  ) -> super(ref, repo)

  @parse: (raw, repo) ->
    throw new Error('No valid git repo!!!') unless repo?.isGitRepo
    throw new Error('No raw data!!!') unless (typeof(raw) is 'string')

Your page is rendering it correctly but atom is not:

yousee

Many symbols without scopes

Most of the issues are in the way of parsing variable names.

Load this example into atom. When I say something is not tagged I mean its scope is only .source.coffee.

someFunc = (arg1, arg2, arg3=1, arg4...) ->
  aVariable = 'ok'
  anArray = new Array()
  anArray.slice()           # anArray not tagged
  anArray.otherMethod()     # anArray, otherMethod not tagged
  randomGlobal.prop.omg()   # not tagged

  functionCall(one)         # functionCall not tagged
  functionCall one          # functionCall not tagged

  anObject =
    key1: 'val1'
    key2: (one, two) ->

# Totally messes this line up
grade = (student, period=(if b? then 7 else 6), messages={"A": "Excellent"}) ->
  if student.excellentWork  # not tagged
    "A+"
  else if student.okayStuff # not tagged
    if student.triedHard then "B" else "B-" # student.triedHard not tagged

class Animal extends Being
  constructor: (@name) ->   # @name not tagged the same as @name in the body, should be?
    @name += ' is cool'

# Ok
math =
  root:   Math.sqrt
  square: square
  cube:   (x) -> x * square x

# Ok
heredoc = """
  CoffeeScript subst test #{ 010 + 0xf / 0b10 + "nested string #{ /\n/ }"}
"""

Giving these symbols correct scopes will greatly improve the support in the coming SymbolProvider in the soon-to-be-bundled-in-core autocomplete-plus.

Syntax highlighting gets thrown off by regular expressions

Hi,

I noticed that if I have a line like this in a coffeescript file:

values.map((v) -> v.value.toLowerCase().replace(/ /g, '_')).join('_').replace(/[^0-9a-z_]/g, '')

...the remaining code in the file will not be highlighted correctly. (in fact, it appears that GitHub gets it wrong too)

I am running language-coffee-script version 0.46.1.

More detailed Regular Expression grammar?

I noticed the Javascript language package comes with a nice regexp grammar.

It would be super rad to have that in CoffeeScript, too!

Maybe the JS grammar could even serve as a base, with modifications to support CS features, like block syntax:

/// ^ (
  ?: [-=]>             # function
   | [-+*/%<>&|^!?=]=  # compound assign / compare
   | >>>=?             # zero-fill right shift
   | ([-+:])\1         # doubles
   | ([&|<>])\2=?      # logic / shift
   | \?\.              # soak access
   | \.{2,3}           # range or splat
) ///

and interpolation:

blah = '.*'
///#{blah}///

Thoughts?

Broken symlinks log errors

Fuzzy finder is logging errors for any broken symlinks in the project

ENOENT: no such file or directory, stat '/Users/kevin/github/atom/node_modules/fs-plus/node_modules/.bin/rimraf'
    at Error (native)
    at fs.statSync (fs.js:846:18)
    at Object.fs.statSync (ATOM_SHELL_ASAR.js:206:16)
    at Object.realpathSync (fs.js:1456:12)
    at Object.fs.realpathSync (ATOM_SHELL_ASAR.js:243:29)
    at /Applications/Atom.app/Contents/Resources/app/node_modules/fuzzy-finder/lib/load-paths-handler.js:90:20
    at FSReqWrap.oncomplete (fs.js:77:15)

Wrong syntax highlighting in coffee for inline function without parameterlist

Syntax Highlighting seems off here, as these expressions are equal.
I build atom directly from the repository.
Well a fork actually, created 4th of december.
Couldn't find this in issues for this filter: is:issue is:open syntax Highlighting coffee

Example:

# correct, this has class inline function
obj.method () ->
# wrong, class is entity name function coffee, but this is a call
obj.method ->

# both lines are identical and valid,
#  the second one is actually more idomatic

bildschirmfoto 2015-12-08 um 20 24 56

Error "unmatched parenthesis" with .litcoffee since atom update

This is the error i get when the atom tries to syntax-hilight a .litcoffee file. This problem goes away if i disable language-coffee-script

Atom Version: 1.2.0
System: Mac OS X 10.11.1
Thrown From: Atom Core

Stack Trace

Uncaught Error: end pattern with unmatched parenthesis

At /opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/first-mate/lib/scanner.js:31

Error: end pattern with unmatched parenthesis
    at Error (native)
    at Scanner.module.exports.Scanner.createScanner (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/first-mate/lib/scanner.js:31:24)
    at Scanner.module.exports.Scanner.getScanner (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/first-mate/lib/scanner.js:37:31)
    at Scanner.module.exports.Scanner.findNextMatch (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/first-mate/lib/scanner.js:56:22)
    at Rule.module.exports.Rule.findNextMatch (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/first-mate/lib/rule.js:99:28)
    at Rule.module.exports.Rule.getNextTags (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/first-mate/lib/rule.js:141:21)
    at Grammar.module.exports.Grammar.tokenizeLine (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/first-mate/lib/grammar.js:150:44)
    at TokenizedBuffer.module.exports.TokenizedBuffer.buildTokenizedLineForRowWithText (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:546:28)
    at TokenizedBuffer.module.exports.TokenizedBuffer.buildTokenizedLineForRow (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:532:19)
    at TokenizedBuffer.module.exports.TokenizedBuffer.tokenizeNextChunk (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:292:43)
    at /opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:269:26
    at /opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/underscore-plus/node_modules/underscore/underscore.js:666:47

Commands

  7x -2:22.1.0 blur (atom-text-editor.editor.vim-mode-plus.normal-mode.is-focused)
     -2:19.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -2:15.6.0 core:select-all (atom-text-editor.editor.mini.is-focused)
     -2:13.9.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -2:11.4.0 core:select-all (atom-text-editor.editor.mini.is-focused)
     -2:10.3.0 core:confirm (atom-text-editor.editor.mini.is-focused)
  7x -2:08.6.0 blur (atom-text-editor.editor.mini.is-focused)
     -2:04.6.0 core:close (atom-text-editor.editor.vim-mode-plus.normal-mode.is-focused)
  3x -2:04.5.0 blur (atom-text-editor.editor.vim-mode-plus.normal-mode.is-focused)
  3x -2:00.8.0 core:close (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
 33x -1:51.9.0 blur (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -1:18.6.0 core:confirm (atom-text-editor.editor.mini.is-focused)
  2x -0:40.7.0 blur (atom-text-editor.editor.mini.is-focused)
     -0:37.5.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:37.3.0 core:confirm (atom-text-editor.editor.mini.is-focused)
 10x -0:26 blur (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "minimap",
      "minimap-autohide",
      "minimap-git-diff",
      "minimap-selection",
      "minimap-pigments",
      "last-cursor-position",
      "tidy-tabs",
      "color-tabs",
      "tab-switcher",
      "terminal-panel",
      "tree-view-git-status",
      "pane-split-moves-tab",
      "preview-plus",
      "source-preview",
      "vim-mode",
      "recent-files-fuzzy-finder"
    ],
    "themes": [
      "native-ui",
      "base16-tomorrow-dark-theme"
    ]
  },
  "editor": {
    "invisibles": {},
    "fontFamily": "Monaco",
    "lineHeight": 1.2,
    "softWrap": true,
    "fontSize": 15,
    "preferredLineLength": 120
  }
}

Installed Packages

# User
antialiased, v0.1.0
api-blueprint-preview, v0.6.0
autocomplete-ctags, v0.3.2
autocomplete-modules, v1.3.1
autocomplete-python, v0.10.3
git-log, v0.4.1
language-api-blueprint, v1.0.2
language-cjsx, v0.3.0
language-docker, v1.1.3
language-groovy, v0.4.0
language-javascript-jsx, v0.3.7
markdown-preview-plus, v2.2.2
markdown-scroll-sync, v0.4.2
native-ui, v0.8.1
quick-highlight, v0.3.7
tabs-to-spaces, v0.11.1
vim-mode-plus, v0.2.0

# Dev
No dev packages

Long array with indenting breaks highlighting

Steps to reproduce:

  1. Create new file.
  2. Enter the following code.
state_enums = [ 'AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MP', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'AS', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VI', 'VA', 'WA', 'WV', 'WI', 'WY' ]
state_enums.push('ON', 'QC', 'NS', 'NB', 'MB', 'BC', 'PE', 'AB', 'NL') # Canada`
  1. Now indent the code once by selecting it all and doing cmd/ctrl + ]

What you should see is the code loses it's highlighting after 20 or so index entries but this seems to only be the case when it is indented. Outdenting restores the highlighting.

screen shot 2015-01-21 at 3 38 33 pm

Issues with Literate Coffeescript

The following file is rendered as such in Atom:
Syntax image
As can be seen, the source blocks are not highlighted. Anyone encountering this too?
Please note that the markdown parts are highlighted correctly in the same file.
Atom 0.201

Properly highlight syntax within backticks

Not sure if this is too specific to request (as it is related to React.js), but it would be nice if when using CoffeeScripts backticks to escape code it would properly highlight HTML-like syntax.

Before:
screen shot 2014-05-05 at 3 08 17 pm

After:
screen shot 2014-05-05 at 3 08 29 pm

If this is way out of scope, forgive me!

Wrong syntax highlighting

This expression is valid in CoffeeScript, but is highlighted very weird:

# Wrong:
a = {} if a[0] == 0

# Correct:
a = {} if a[0] != 0

screenshot

litcoffee code block not highlighted properly when after a list

Including code block after a list breaks highlighting. See screenshot (source code on the left, markdown preview on the right):

screen shot 2014-11-03 at 13 05 20

The example text:

Some text in `.litcoffee` file with functions in it.

    a = ->
      m = 'indented function'
      return 'properly formatted ' + m

1. Example
2. List


    b = ->
      m = 'indendet function'
      return 'not highlighted ' + m

1. Another
2. List

With some text after it.

    c = ->
      m = 'indendet function'
      return 'properly highlighted ' + m

Save as file.litcoffee and open in atom.io. Function is not highlighted properly in editor, however markdown preview is fine.

Embedded JS highlighting is broken

If you use backticks (`) to escape raw JavaScript in your Coffeescript file, it seems to break the syntax highlighting / parsing.

The following line causes this:

`import Foo from 'bar'`

It seems that the interior of the backticks is parsed as JavaScript (cool!), but since ES6 supports backticks for string templating, it sees the the ending backtick as the start of an ES6 template string, rather than the terminating escape character in Coffeescript (not cool).

Interestingly, this only seems to appear in Atom v0.189.0. The prior version (v0.188.0) doesn't show this problem. Not sure if this issue belongs here or in the Atom repo, let me know.

RegEx breaks color styling

I have a RegEx for TLDs first thing in a coffeescript file that breaks the color styling for the rest of the file.

/^(http(?:s?)\:\/\/|~\/|\/)?(?:\w+:\w+@)?([A-Za-z0-9-]{1,63}\.)+(COMMUNITY|DIRECTORY|EDUCATION|EQUIPMENT|INSTITUTE|MARKETING|SOLUTIONS|XN--J1AMH|XN--L1ACC|BARGAINS|BOUTIQUE|BUILDERS|CATERING|CLEANING|CLOTHING|COMPUTER|DEMOCRAT|DIAMONDS|GRAPHICS|HOLDINGS|LIGHTING|PARTNERS|PLUMBING|TRAINING|VENTURES|XN--P1AI|ACADEMY|CAREERS|COMPANY|CRUISES|DOMAINS|EXPOSED|FLIGHTS|FLORIST|GALLERY|GUITARS|HOLIDAY|KITCHEN|RECIPES|RENTALS|REVIEWS|SHIKSHA|SINGLES|SUPPORT|SYSTEMS|AGENCY|BERLIN|CAMERA|CENTER|COFFEE|CONDOS|DATING|ESTATE|EVENTS|EXPERT|FUTBOL|KAUFEN|LUXURY|MAISON|MONASH|MUSEUM|NAGOYA|PHOTOS|REPAIR|REPORT|SOCIAL|TATTOO|TIENDA|TRAVEL|VIAJES|VILLAS|VISION|VOTING|VOYAGE|BUILD|CARDS|CHEAP|CODES|DANCE|EMAIL|GLASS|HOUSE|NINJA|PARTS|PHOTO|SHOES|SOLAR|TODAY|TOKYO|TOOLS|WATCH|WORKS|AERO|ARPA|ASIA|BIKE|BLUE|BUZZ|CAMP|CLUB|COOL|COOP|FARM|GIFT|GURU|INFO|JOBS|KIWI|LAND|LIMO|LINK|MENU|MOBI|MODA|NAME|PICS|PINK|POST|QPON|RICH|RUHR|SEXY|TIPS|WANG|WIEN|ZONE|BIZ|CAB|CAT|CEO|COM|EDU|GOV|INT|KIM|MIL|NET|ONL|ORG|PRO|RED|TEL|UNO|WED|XXX|AC|AD|AE|AF|AG|AI|AL|AM|AN|AO|AQ|AR|AS|AT|AU|AW|AX|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BJ|BM|BN|BO|BR|BS|BT|BV|BW|BY|BZ|CA|CC|CD|CF|CG|CH|CI|CK|CL|CM|CN|CO|CR|CU|CV|CW|CX|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EE|EG|ER|ES|ET|EU|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GG|GH|GI|GL|GM|GN|GP|GQ|GR|GS|GT|GU|GW|GY|HK|HM|HN|HR|HT|HU|ID|IE|IL|IM|IN|IO|IQ|IR|IS|IT|JE|JM|JO|JP|KE|KG|KH|KI|KM|KN|KP|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MD|ME|MG|MH|MK|ML|MM|MN|MO|MP|MQ|MR|MS|MT|MU|MV|MW|MX|MY|MZ|NA|NC|NE|NF|NG|NI|NL|NO|NP|NR|NU|NZ|OM|PA|PE|PF|PG|PH|PK|PL|PM|PN|PR|PS|PT|PW|PY|QA|RE|RO|RS|RU|RW|SA|SB|SC|SD|SE|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SR|ST|SU|SV|SX|SY|SZ|TC|TD|TF|TrG|TH|TJ|TK|TL|TM|TN|TO|TP|TR|TT|TV|TW|TZ|UA|UG|UK|US|UY|UZ|VA|VC|VE|VG|VI|VN|VU|WF|WS|YE|YT|ZA|ZM|ZW)(.*)$/mig

screen shot 2014-07-02 at 7 47 31 am

it should look more like

screen shot 2014-07-02 at 7 47 49 am

Atom: 0.106.0
OSX: 10.9.3
Lang-CS: 0.22.0

Caret jumps to the beginning of line, indent is lost

Case 1: step into function definition, put the cursor at the beginning of some line, press Enter
Result: current line indent is lost, text starts from the beginning of line

Case 2: cut some line, paste somewhere inside of the same function
Result: the same as above

syntax for `new`ing inline classes unrecognised

Coffeescript allows for classes to be created and instanciated as follows:

new class
  constructor: ->
    console.log 'I am a dog'

new class Cat
  constructor: ->
    console.log 'I am a cat'

However this syntax is unrecognised, and is formatted as if class were the constructor function's name.

screen shot 2014-07-04 at 15 07 39

Index comments correctly

When inserting new comments in the code, despite the indentation level it always puts the #at the first column, creating compilation and jshint errors.

Color keyword operators as control keywords

I believe that keyword operators such as and|or|isnt should not be the same color as other operators (==|!=|+=) because, while they are still in the same category, they are often used in a different manner.

My proposal is having them receive the same coloring as control keywords.

On the left, the current one. On the right, the proposed change.
Imgur
samplesyntax

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.