Add Ruby language injections (#8796)

This adds support for Ruby heredoc's syntax highlighting. The injection
was directly taken from the tree-sitter
[documentation](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection).

It is quite simple, but has the drawback of only showing highlighting
once the heredoc is fully written and next line is started. This is due
to the fact that we use the last line of the heredoc to determine the
language. As using the first one would require some cleaning up that we
cannot do trivially. (I might have not fully understood the behaviour of
the `#match?` predicate, which could help us)

Fixes #4473



Release Notes:

- Added Ruby language injections
([#4473](https://github.com/zed-industries/zed/issues/4473)).

<img width="359" alt="image"
src="https://github.com/zed-industries/zed/assets/11378424/5115b875-a32d-4f28-b21f-471495169266">
This commit is contained in:
Ulysse Buonomo 2024-05-10 12:00:51 -04:00 committed by GitHub
parent 400e938997
commit 4f256c7577
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,2 @@
(heredoc_body
(heredoc_end) @language) @content