daylerees / colour-schemes

Colour schemes for a variety of editors created by Dayle Rees.
http://daylerees.github.io
Other
9.32k stars 1.62k forks source link

TronLegacy: Better support for coffeescript #95

Closed kumarharsh closed 10 years ago

kumarharsh commented 10 years ago

First of all, Fantastic theme. Thanks a lot.

Now, to the issue: I'm writing some big coffee files, and as the program is growing in complexity, my function & argument names have become a little longer, thus for readability's sake, i've to break the function declaration line into two or more lines like so:

  testFunctionWhichBecameLong = (opt_1, opt_2,
                                 opt_3, opt_4) ->
    opt1 * opt2 - opt3 / opt4

These kinds of functions are not being highlighted, and thus the function starts to look like an ugly duckling...

daylerees commented 10 years ago

Hi Kumar,

Can you mail me a nice source file so I can check out how the highlighter fits it. Also could you let me know which CoffeeScript parsing plugin you use.

Thanks!

kumarharsh commented 10 years ago

Sure,

Here is a little code which should show the error:

changeProcessRoles: ({process_id, roles}, opts = {}) ->
  {success, error} = opts
  data = {}
  path = "/processes/#{process_id}/roles"
  url = "#{@base}#{path}#{@query}"
  $http.post(url, roles)
  .success (response) ->
    success?(response)
    return
  .error (response) ->
    error?(response)
    return
  data

changeProcessPerformerRoles: ({process_id, performer_id, roles},
                              opts = {}) ->
    {success, error} = opts
    path = "/processes/#{process_id}/performers/#{performer_id}/roles"
    url = "#{@base}#{path}#{@query}"
    $http.post(url, roles)
    .success (response) ->
      success?(response)
      return
    .error (response) ->
      error?(response)
      return
    return

teamInvite: ({team_id, id, roles}, opts = {}) ->
  {success, error} = opts
  path = "/teams/#{team_id}/invites"
  url = "#{@base}#{path}#{@query}"
  $http.post(url, { id: id, roles: roles })
  .success (response) ->
    success?(response)
    return
  .error (response) ->
    error?(response)
    return
  return

I'm using Sublime Text 2 Build 2221. Coffe-script plugin is jashkenas's coffee-script plugin

Do pay attention to the fact that Github is correctly highlighting the second function, which is not the case in TronLegacy

daylerees commented 10 years ago

Here's how it looks for me:

http://shots.daylerees.com/KCuk

kumarharsh commented 10 years ago

Yes, that is correct, but try breaking any function declaration into two lines...

tron-legacy

daylerees commented 10 years ago

Unfortunately that's a problem with the Syntax parser rather than the theme mate. If you use CTRL+SHIFT+P on a piece of text it will show you the scope in the statusbar. That scope is used to decide which colour to apply. You will notice that the scope changes when you break the line.

It might be worth reporting it to the package owner though :).

I'll fix the "lack of green" though. I just tried the old theme and I see what you mean. I should be able to return that to it's original greenyness :)

kumarharsh commented 10 years ago

Thanks, yes, I started doubting that was the case when no theme was getting the colour... Thanks for your time!

daylerees commented 10 years ago

No problem buddy :) I know it's a big change, but this new mapping + generation system will let me fix themes fast and create a load more themes. I promise it will be good in the long run :)

kumarharsh commented 10 years ago

just a minor correction: the key binding to see the scope is Ctrl+Shift+Alt+P

daylerees commented 10 years ago

Ah it's ctrl+shift+p for me, might be an OS thing. I'm on OSX.

kumarharsh commented 10 years ago

Oh yeah, of course!

daylerees commented 10 years ago

Heya mate, if you update the package you should have nice green vars again now (and other themes will have alternatives). The CSS is a bit more difficult (without breaking other themes) but I'm working on something.

I'm thinking of adding a 'legacy' directory in with the old themes. Just for that option. However on most themes/languages the colour assignment on the new themes should be much better.