Skip to content

Loading…

Better compilation errors descriptions #2854

Closed
antonkulaga opened this Issue · 1 comment

4 participants

@antonkulaga

When I have some errors in my coffee script code I get and error messages like this one:

Error: In /home/antonkulaga/denigma/semanticchat/public/semantictasks/test/router_test.coffee, Parse error on line 16: Unexpected '@'
    at Object.parseError (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/parser.js:483:11)
.......and so on and so forth

In such messages there is only one useful info for ordinary developers (who do not understand coffee compiler's internals), the line number. And often this line-number is not the same as in source-code file, especially if coffee-joins are used.
It would be great to seem quotations of code in the errors, to quickly grasp where the error (even if the line number is not accurate)

/home/antonkulaga/denigma/semanticchat/public/semantictasks/test/router_test.coffee, Parse error on line 16: Unexpected '@'

13 describe 'Collab router', ->
14  channels = new Batman.MockChannels()
15  mock = channels.getMock()
16  socket = channels.@socket

    at Object.parseError (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/parser.js:483:11)
.......................
@xixixao
test.coffee:16:21: error: unexpected @
  socket = channels.@socket
                    ^

Should be enough, ready to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.