You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Losses syntax highlighting and text becomes grey when adding erb tags in Ruby #261
Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
Code after inserted erb text becomes grey and losses syntax highlighting.
Closing the file and then reopening it fixes the issue.
I did see this mentioned in issue #18342 but that was closed and the syntax highlighting doesn't seem to be fixed.
Safe mode does not solve this problem.
Steps to Reproduce
Create .erb file with html
Add erb tag to html element
Text will lose syntax highlighting (see screen recording below)
Start typing <%=@owner.id%> after the "/owners/" in the <input> tag.
**Interesting note:
If I add the "=" after i close the tag it highlights and formats correctly, see 2nd screen recording.
Expected behavior: [What you expect to happen]
Highlighter should highlight syntax correctly
Actual behavior: [What actually happens]
After typing the > in <%=@owner.id%>, the rest of the content loses highlighting (as mentioned above, closing and reopening the file seems to clear things up).
See screen recording:
Screenshot:
When adding the "=" after closing the tag:
Reproduces how often: [What percentage of the time does it reproduce?]
Everytime.
changed the title [-]Code becomes grey when adding erb tags in Ruby[/-][+]Losses syntax highlighting and text becomes grey when adding erb tags in Ruby[/+]on Feb 10, 2019
I've have experienced this issue, and now (1.47) I've got a new one that I think might be related. I can open some erb files that have full color, then open another erb file with no color. With the problem described above, closing and reopening the file would fix it. With this new problem there is no highlighting from open.
Also, adding code above the gray lines seems to do full highlighting, while adding below only highlights the <% %>
I also have the (non-treesitter?) HTML (Rails) and HTML (Ruby - ERB) grammars, and switching to one of those gives full highlighting.
Having the same problem. It seems as soon as I enter a <script></script>, everything goes grey, with occasional, random highlighting. Frustrating because I'm a newbie and the highlighting was very helpful (when it was working).
Reacted by Praii, Heshie Brody, Jan Sengers and RickelmiM
Ah sublime text is up to v4, might have to check it out - came from sublime to atom because there was a nice package called html preview which updates the page on the fly and runs inside atom
Any progress of this? Getting a LOT of issues with ERB files... I mean, A LOT!
Ruby on Rails and ERB files are my main projects, is so annoying that I'm using VSCode.
BTW, I noticed that if I narrow the width of the editor, the syntax works again in some points. I don't know if it's because part of the code is hidden or if the width has something to do with it.
Any progress of this? Getting a LOT of issues with ERB files... I mean, A LOT!
Ruby on Rails and ERB files are my main projects, is so annoying that I'm using VSCode.
BTW, I noticed that if I narrow the width of the editor, the syntax works again in some points. I don't know if it's because part of the code is hidden or if the width has something to do with it.
Just install Sublime Text save yourself the headache
Reacted by Charles McClain, Kai Schneider, Matt Langston and Feather Osborn
Just install Sublime Text save yourself the headache
I'm using VS Code as main editor for Ruby projects. It's a lot of headache for a simple syntax highlight...
TBH, the Atom highlight is very good, it marks the right words even with the name of functions outside the "dictionary". But the problem of colors deactivating is really annoying.
Activity
[-]Code becomes grey when adding erb tags in Ruby[/-][+]Losses syntax highlighting and text becomes grey when adding erb tags in Ruby[/+]rsese commentedon Feb 13, 2019
Thanks for the report, reproduce in 1.34.0 with macOS 10.12.6.
SeaCDragon commentedon Jul 28, 2019
I can still reproduce this in Atom 1.39.0
amingilani commentedon Sep 19, 2019
Still here in 1.40.1
adlkhan commentedon Oct 16, 2019
I can reproduce in Atom 1.40.1, with Ubuntu 18.04.3 LTS
Downgraded atom to 1.33.1, only way to solve this problem atm.
dcchambers commentedon Dec 13, 2019
Atom 1.40.1 / MacOS 10.14.6 still experiencing the same issue with ERB.
dcchambers commentedon Jan 8, 2020
Tested today on Atom 1.41.1 and 1.42 this is no longer happening. Consider this resolved?
SeaCDragon commentedon Jan 21, 2020
unfortunate no we cant. Even on 1.43 this still happens fairly often. I am on Mac
2 remaining items
hayesr commentedon Jun 4, 2020
I've have experienced this issue, and now (1.47) I've got a new one that I think might be related. I can open some erb files that have full color, then open another erb file with no color. With the problem described above, closing and reopening the file would fix it. With this new problem there is no highlighting from open.
Also, adding code above the gray lines seems to do full highlighting, while adding below only highlights the
<% %>I also have the (non-treesitter?) HTML (Rails) and HTML (Ruby - ERB) grammars, and switching to one of those gives full highlighting.
hayesr commentedon Jun 4, 2020
Tinkering further, I believe the following is the problem:
That code will cause the issue in other files, BUT the following does not cause the problem:
(no close to the script tag)
dougc84 commentedon Jun 7, 2020
This is occuring on
.rbfiles as well.shannon-bart commentedon Jun 10, 2020
Having the same problem. It seems as soon as I enter a <script></script>, everything goes grey, with occasional, random highlighting. Frustrating because I'm a newbie and the highlighting was very helpful (when it was working).
AlbertoReg commentedon Jun 22, 2020
I am also experiencing this issue on 1.48.
GrinninBarrett commentedon Jul 10, 2020
Still 1.48, and still experiencing this after adding </script> in a .html document.
erez commentedon Jul 14, 2020
Same here 1.48.0
MatthewKennedy commentedon Aug 15, 2020
Still got this issue in 1.5
samyH commentedon Sep 16, 2020
Can confirm random greyed out lines and/or script tags v1.5.0 pretty annoying
MatthewKennedy commentedon Sep 16, 2020
I gave up on atom and moved to Sublime Text 4, the code highlighting is instant.
I tried VSCode but that was slow at loading the syntax and the colours were inconstiant.
samyH commentedon Sep 16, 2020
Ah sublime text is up to v4, might have to check it out - came from sublime to atom because there was a nice package called html preview which updates the page on the fly and runs inside atom
NAVA-PHOLLAND commentedon Nov 2, 2020
I'm also still seeing this, in Atom 1.52.0 on MacOS 10.15.7
Was this bug possibly introduced with #240?
brunnopleffken commentedon Dec 17, 2020
Any progress of this? Getting a LOT of issues with ERB files... I mean, A LOT!
Ruby on Rails and ERB files are my main projects, is so annoying that I'm using VSCode.
BTW, I noticed that if I narrow the width of the editor, the syntax works again in some points. I don't know if it's because part of the code is hidden or if the width has something to do with it.
samyH commentedon Dec 18, 2020
Just install Sublime Text save yourself the headache
brunnopleffken commentedon Dec 19, 2020
I'm using VS Code as main editor for Ruby projects. It's a lot of headache for a simple syntax highlight...
TBH, the Atom highlight is very good, it marks the right words even with the name of functions outside the "dictionary". But the problem of colors deactivating is really annoying.