zed
zed copied to clipboard
HTML syntax highlighting broken in ERB files
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
If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.
No response
Yeah, I think there is an issue. I can replicate it too by following these steps:
- Quit any Zed running instances. This is important.
- Start Zed and open any ERB file. You should see the uncolored HTML.
- But if you close file and open it again, then everything should be fine.
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 😅
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.
See also:
- https://github.com/zed-industries/zed/issues/19572
The same issue with .js.erb files. JavaScript is not highlighted.
ERB Language
JavaScript Language
Zed: v0.166.1 (Zed) OS: macOS 12.7.6 Memory: 16 GiB Architecture: x86_64
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
Seems like an ongoing issue across all platform. I can confirm it happens on Ubuntu too.
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
Sorry for poor experience everyone. The fix will go out tomorrow.