atom / language-coffee-script

CoffeeScript support in Atom
Other
59 stars 56 forks source link

Assignment + list comprehension + function application = broken syntax highlighting #154

Closed nathancarter closed 7 years ago

nathancarter commented 7 years ago

Description

Combining assignment, list comprehension, and function application breaks syntax highlighting in literate mode.

Steps to Reproduce

  1. Create a new file.
  2. Save it with the .litcoffee extension.
  3. Type in text as shown below.
Example comment text, highlighted correctly.

    result = ( foo x for x in get stuff )

Example comment text, highlighted incorrectly.

Expected behavior: All unindented text is treated as Markdown, never as Coffeescript code. For instance, GitHub renders it correctly in the code block above.

Actual behavior: All text after the simple code snippet shown is treated as if it were Coffeescript code, as shown in the screenshot below.

screen shot 2017-10-13 at 10 18 45 am

Reproduces how often: 100%

Versions

Atom : 1.21.0

Electron: 1.6.9

Chrome : 56.0.2924.87

Node : 7.4.0

Mac OS X 10.11.6

nathancarter commented 7 years ago

I don't know if this is related to #153 but the end result of both problems is the same: unindented text in a .litcoffee file should never be anything but Markdown, and to see it treated otherwise is a rather significant syntax highlighting problem.