Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coffeescript indent error reported on incorrect line #1568

Closed
davidbau opened this issue Aug 26, 2013 · 0 comments
Closed

Coffeescript indent error reported on incorrect line #1568

davidbau opened this issue Aug 26, 2013 · 0 comments

Comments

@davidbau
Copy link

The coffeescript mode in ACE reports indent errors on the wrong line (on the last nonempty line before the unexpected indent, rather than the line of the unexpected indent), even though the coffeescript compiler itself used by ACE reports the right line. (This is confusing to students who are learning about indent-sensitive syntax.)

I spent about an hour trying to debug why there is a difference but didn't get to the bottom of it - maybe a coffeescript parser expert could help.

To repro in ACE, do the following:
(1) Visit http://ace.c9.io/build/kitchen-sink.html
(2) Switch to coffeescript mode
(3) Erase the document and just type a four-word program with the third and fourth word on a second line that is indented, like this

a b
   c d

(4) Observe: unexpected indent error reported on the first line; expect it should be reported on the second line.
(5) Also, note if a bunch of empty lines are inserted between the two lines, the error stays on the first line, far from the actual problem.

Note that coffeescript itself reports on the proper line - for example, visit "Try Coffeescript" on http://coffeescript.org/ and enter the same program text. The error is reported on line #2, and if you create more empty lines, the error follows the right line downward.

adamjimenez pushed a commit to adamjimenez/ace that referenced this issue Mar 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant