Thanks! I'm still stuck on Atom, but the good thing is that Atom was so far ahead that it has full support for the language server protocol 🙈
I also have been trying @zed.dev a lot, I like it. But it still somehow doesn't feel quite right, yet.
@marcoroth.dev
Full-Stack Web Developer • OSS Contributor • Electronic Music Addict • Ruby/Rails, JavaScript/Stimulus, Crystal • Hotwire Contributors Team • StimulusReflex Core. Website: marcoroth.dev Building: rubyevents.org | rubyconferences.org | gem.sh | hotwire.io
Thanks! I'm still stuck on Atom, but the good thing is that Atom was so far ahead that it has full support for the language server protocol 🙈
I also have been trying @zed.dev a lot, I like it. But it still somehow doesn't feel quite right, yet.
I guess we can also show the method signature and a link to the docs too:
Also, this understanding can be used by the `Herb::Engine` to optimize which parts of the template can be precompiled as most of it is effectively static HTML.
Isn't that confusing too, as it's not really valid HTML?
Action View tag helpers can get confusing when you're trying to figure out what the exact HTML output will look like.
The Herb Language Server can now show you what they evaluate to on hover, and convert between tag helpers and HTML in-place with a single click.
Yeah, I think I know what you mean. I think the GitLens plugin used to do something similar. I need to look into what API they are using. Good idea, thank you!
That's a good point, and I think I'd also like that more!
Sadly, there doesn't seem to be support for an option like that. At least VS Code only provides these options.
"When pressed" means you have to hold "Ctrl+Option"
How do we feel about Inlay Hints in HTML+ERB files for closing tags?
I'm torn, but the good thing is that most editors allow to disable Inlay Hints if you don't like them.
Is this something people would want to use Inlay Hints for? I'd love to hear your opinion!
Got a working version of this in my forked Zed version by implementing custom LSP requests 😅
I wonder why this hasn't been implemented in @zed.dev 🤔
Yeah, looks like it's not possible yet: github.com/zed-industri...
That's quite a bizarre choice to not support that 🤔
I actually implemented that as well as I have been doing that too. But it's a separate custom block-comment request you can bind to a shortcut.
But I realized that I only have been doing that because my editor kept messing it up. I thought it would be sad to bake in that workaround into the LSP 😅
Hopefully it's Thyme-saving!
I got to work on another thing that has been bothering me for a long time: toggling comments in HTML+ERB files.
Sadly the Language Server Protocol doesn't support this with a dedicated request, but you can implement it using a custom request plus a small config in the editor.
Jira, so you get the full and real experience, obviously 🥸
I'm sure we could make something work, as Zed seems super configurable.
Maybe we can/need to bake it directly into the Zed Ruby Extension.
Maybe @vitallium.bsky.social has an idea on how to approach that 👀
Turns out the secret ingredient was Herb all along 🪄🌿
My current tooling can't even handle removing the trailing %> when uncommenting.
This is magical!! 🪄✨
At least for VS Code we can pre-configure it out of the box in the VS Code extension!
github.com/marcoroth/he...
I got to work on another thing that has been bothering me for a long time: toggling comments in HTML+ERB files.
Sadly the Language Server Protocol doesn't support this with a dedicated request, but you can implement it using a custom request plus a small config in the editor.
I really like how this new `erb-no-duplicate-branch-elements` linter rule and its autofix are shaping up!
This level of understanding, awareness, and integration still feels purely magical.
We've had a lot of issues and PRs around updates - events, new videos, changelog, and more. I tried to bring all that together in the newsletter. ♥️
Let me know what you think and if you have ideas for March! ✨
Hello friends! This is our first edition of the Ruby Events Newsletter!
Find recent events, released videos, and a changelog within. Let us know if there's anything you want to see in March's edition? 🤩
www.rubyevents.org/announcement...
I really like how this new `erb-no-duplicate-branch-elements` linter rule and its autofix are shaping up!
This level of understanding, awareness, and integration still feels purely magical.
The `textDocument/documentHighlight` request in the Language Server Protocol is kinda neat!
The Herb Language Server will use it to highlight matching ERB control flow keywords and HTML tag pairs when you place your cursor on them.
Week 07/08 - Video recorder UI, Dynamic Partial Rendering, and more!
This pull request improves the parser's error reporting for HTML close tags that are missing their closing `>` by introducing a new `UnclosedCloseTagError`. Given this input: ```html+erb <% case Date.today.cwday %> <% when 6 %> <p>Today is Saturday</p <% else %> <p>Today is not a day of the week</p> <% end %> ``` Previously, when parsing `</p` (missing closing `>`), the error was reported on the next tag (e.g., `<% else %>`) instead of on the `</p` itself. Additionally, the next token (e.g., `<%`) would get incorrectly consumed as the `tag_closing` of the `HTMLCloseTagNode`.
These kinds of small fixes are oddly satisfying to get right. This ships in the next version of Herb! 🙌
This pull request improves the parser's error reporting for HTML close tags that are missing their closing `>` by introducing a new `UnclosedCloseTagError`. Given this input: ```html+erb <% case Date.today.cwday %> <% when 6 %> <p>Today is Saturday</p <% else %> <p>Today is not a day of the week</p> <% end %> ``` Previously, when parsing `</p` (missing closing `>`), the error was reported on the next tag (e.g., `<% else %>`) instead of on the `</p` itself. Additionally, the next token (e.g., `<%`) would get incorrectly consumed as the `tag_closing` of the `HTMLCloseTagNode`.
These kinds of small fixes are oddly satisfying to get right. This ships in the next version of Herb! 🙌
Awesome, thanks for giving it a go! 🙏