Syntax highlighting broken when using dot to reference object property #306
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
When editing CUDA or C++ code the syntax highlighting will 'mess up'. This meaning it will color everything below a certain point in the same color. For example it will ignore correctly escaped multiline comments (/* ... */
) and color everything in the comment color. Or, as highlighted below, it will color everything after a .
in the color for an object property. When mistyping a comma after an object the whole source code turns white. Usually that bug stops at the point where the code starts to go out of the view, so when you scroll, you will have correct syntax highlighting in the code that wasn't visible when typing the characters that caused the problem. Restarting atom fixes the issue, until typing one or more of the characters again. Single lines can be correctly highlighted by adding a space or newline.
Steps to Reproduce
- Have a cuda (.cu) file open showing a class method.
- To any variable, add a dot as if to reference a property and then add some letters, as if to access a property of said variable.
Expected behavior:
The syntax highlighting will highlight the property after the dot in red (or whatever color you have chosen to give to properties).
Actual behavior:
The syntax highlighting will highlight everything after the dot in red (or whatever color you have chosen to give to properties).
Reproduces how often:
It seems like this always happens when using the dot, so in this case 100% of the time. On other occasions it is fine for a couple of times and then occurs.
Versions
Atom : 1.32.1
Electron: 2.0.9
Chrome : 61.0.3163.100
Node : 8.9.3
apm 2.1.2
npm 6.2.0
node 8.9.3 x64
atom 1.32.1
python 3.7.0
git 2.7.4
running on Linux Mint 18.1 Serena
Additional Information
It seems to be related to a class of bugs with the tree sitter as for example in atom/language-python#285 and atom/language-python#281