atom / language-ruby

Ruby package for Atom
Other
101 stars 144 forks source link

Syntax highlight of Ruby tags in ERB files is buggy #248

Closed brunnopleffken closed 6 years ago

brunnopleffken commented 6 years ago

Description

Syntax highlight is sometimes buggy when alternating between Ruby tags and HTML tags with Tree Sitter enabled. Even inside the tags itself, sometimes method names and symbols are incorrectly highlighted with the wrong colors.

Worth to mention that when it happens the CPU usage of Atom is high (it froze my Atom instance once).

Steps to Reproduce

  1. It happens quite often when alternating regular HTML with Ruby (<% and %>) tags. I'm unable to reproduce it right now due lack of time, but I'll try to recreate with a piece of code.

EDIT: disabling Tree Sitter in Preferences -> Core turns everything back to normal. I'll keep Tree Sitter disabled until ERB files are correctly rendered.

Expected behavior: Syntax highlight should work properly. Actual behavior: Syntax highlight isn't working properly with Tree Sitter enabled. Reproduces how often:

Versions

macOS Mojave 10.14.1

Atom : 1.32.1 Electron: 2.0.9 Chrome : 61.0.3163.100 Node : 8.9.3

Additional Information

screen shot 2018-11-02 at 02 36 02
Ben3eeE commented 6 years ago

Thanks for taking the time to contribute!

We noticed that this is a duplicate of https://github.com/atom/atom/issues/18342. You may want to subscribe there for updates.

Because we treat our issues list as the Atom team's backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn't an exact duplicate but is closely related.

For information on how to use GitHub's search feature to find out if something is a duplicate before filing, see the How Can I Contribute? section of the Atom CONTRIBUTING guide.

Ben3eeE commented 6 years ago

We have a PR up investigating both the freezing and broken highlight here https://github.com/atom/atom/pull/18375#issuecomment-434875504

maxbrunsfeld commented 6 years ago

Wow, sorry that terrible bug made it out. I believe the highlighting problems are fixed in https://github.com/atom/atom/pull/18375. I'm going to be investigating the issue with the high CPU usage next. We aim to ship fixes for both next week in Atom 1.32.2.

dcjones1 commented 5 years ago

To add on: when I open an ERB file I was previously working on, I no longer have any syntax highlighting. If I turn off tree-parser, it fixes it, but then breaks highlighting for my ruby files.

alexb148 commented 5 years ago

I'm editing a load of working .erb file and the lack of highlighting is useless, despite having language-ruby installed. There's basically no highlighting, as per the image below. As above, if I disable the tree-sitter option, highlighting appears again.

Screenshot 2019-04-05 at 10 06 56

Arcanemagus commented 5 years ago

@alexb148 Please file a new issue with example text that reproduces the problem, thanks!

tomasdelaveau commented 5 years ago

in my case, the highlight appears only after closing and reopening the file. before closing (bottom line is new line): image after saving and reopening: image