Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Syntax highlighting broken when using dot to reference object property #306

Closed
@meetaig

Description

@meetaig

Prerequisites

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.

Before pic:
cuda_file_before_zoom

After pic:
cuda_file_after_zoom

Steps to Reproduce

  1. Have a cuda (.cu) file open showing a class method.
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions