zed icon indicating copy to clipboard operation
zed copied to clipboard

HTML syntax highlighting broken in ERB files

Open drale2k opened this issue 1 year ago • 3 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

Since the latest Zed update (v0.136.2) syntax highlighting is broken in ERB files. As can be seen in the screenshot, ruby code is highlighted while HTML is not.

I installed the Ruby extension after the update and restarted Zed multiple times.

Environment

Zed: v0.136.2 (Zed) OS: macOS 14.2.1 Memory: 64 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Screenshot 2024-05-23 at 02 54 06

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

drale2k avatar May 23 '24 00:05 drale2k

Yeah, I think there is an issue. I can replicate it too by following these steps:

  1. Quit any Zed running instances. This is important.
  2. Start Zed and open any ERB file. You should see the uncolored HTML.
  3. But if you close file and open it again, then everything should be fine.

vitallium avatar May 24 '24 08:05 vitallium

Closing and opening the file indeed works, i am almost embarrassed i didn't try that. I closed and opened the Editor 20 times though 😅

drale2k avatar May 24 '24 12:05 drale2k

I also see this, and was about to report it. If you edit the file, it usually colours the immediate area correctly, but often not the entire file. This sometimes spontaneously happens as well, it's not exclusively when you open the file for the first time.

TimSullivan avatar Oct 09 '24 17:10 TimSullivan

See also:

  • https://github.com/zed-industries/zed/issues/19572

notpeter avatar Nov 05 '24 22:11 notpeter

The same issue with .js.erb files. JavaScript is not highlighted.

ERB Language

image

JavaScript Language

image

Zed: v0.166.1 (Zed) OS: macOS 12.7.6 Memory: 16 GiB Architecture: x86_64

ZombieHarvester avatar Dec 20 '24 16:12 ZombieHarvester

This is weird, the injected language highlighting is working for other languages (like .astro files) but not erb. I was able to workaround this by closing the file and reopening it, so it might be the result of flaky behavior or something going wrong the first time the file is loaded

probably-neb avatar Feb 05 '25 17:02 probably-neb

Seems like an ongoing issue across all platform. I can confirm it happens on Ubuntu too.

Image

Nicktriez avatar Mar 26 '25 13:03 Nicktriez

it started after add any ruby code in <%%> and after this file will be broken. But it will repair after any code modification, till <%%>

https://github.com/user-attachments/assets/a3e902e9-609a-4be1-a9ef-d58f6903db3c

Set27 avatar Mar 26 '25 16:03 Set27

Sorry for poor experience everyone. The fix will go out tomorrow.

maxbrunsfeld avatar Jun 11 '25 04:06 maxbrunsfeld