SublimeText / CoffeeScript

Syntax highlighting and checking, commands, shortcuts, snippets, watched compilation and more.
440 stars 64 forks source link

Add Import/Export Keywords #245

Closed audinue closed 2 months ago

audinue commented 7 years ago

This pull request adds import, as, from and export to keyword.other.coffee in CoffeeScript.tmLanguage.

GeoffreyBooth commented 7 years ago

This feels like the wrong place for this. I would think these keywords should be defined near where we define things like for and throw.

nwbauer commented 6 years ago

FWIW, I also wanted this feature. Since this seems like the PR will no go forward, so I thought I would post my workaround here:

  1. With a coffeescript edited document open, go to Tools > Developer > New Syntax from Coffeescript.tmLanguage...

screen shot 2018-02-04 at 4 56 10 pm

  1. When the document opens, change the name: to something different, e.g. name: CoffeeScript Custom

  2. In contexts: main: add the lines

contexts:
  main:
   ...
    - match: '\b(import|as|from|export)\b'
      scope: keyword.operator.coffee
  1. Save the file in the default directory, and now you can use your new Coffeescript Custom syntax!
auvipy commented 4 years ago

https://github.com/aponxi/sublime-better-coffeescript/issues/243 ?

GeoffreyBooth commented 4 years ago

I would be happy to merge in a PR that adds support for the missing keywords, but they should be defined in the proper place in the file. They shouldn’t be overloading debugger.