atom / language-javascript

JavaScript language package for Atom
Other
194 stars 235 forks source link

JSDoc/Doc Block tab complete breaks highlighting #660

Closed jchook closed 5 years ago

jchook commented 5 years ago

Prerequisites

Description

When using the tab-completion to initiate a "doc block" style comment, the grammar parser gets very confused and labels code immediately outside of the comment as .comment.block.

This screenshot from safe mode:

image

This video from my normal atom env illustrates the problem more clearly:

Peek 2019-09-28 13-18 weird highlighting

Steps to Reproduce

  1. Create a new JavaScript file, using the built-in JS grammar
  2. Write some JS code
  3. Add a doc block comment to the lower part of the code via / * * TAB
  4. Add a doc block comment to the upper part of the code via / * * TAB

Expected behavior:

Correct syntax highlighting

Actual behavior:

The JS grammar labels the JS code immediately below the upper block comment as part of the comment block.

Reproduces how often:

100%

Versions

Atom    : 1.40.1
Electron: 3.1.10
Chrome  : 66.0.3359.181
Node    : 10.2.0
rsese commented 5 years ago

Thanks for the report - just to double check this isn't related to a recently fixed issue, can you confirm if you see this problem in the latest beta (currently 1.41.0-beta1)?

jchook commented 5 years ago

@rsese excellent spidey senses on that. Atom 1.41.0-beta1 does not have the same issue.

BTW, if anyone else ends up here wondering about this issue, I currently set my syntax to Babel as a workaround until 1.41 lands.