-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syntax highlighting doesn't understand heredocs #58
Comments
Maybe so, but I wish an emacs dev could fix it. |
There is a big problem with syntax highlighting of Raku in general because it has slangs, or sub languages. The slangs are Pod, regex, and quoting. So, a syntax highlighter developer will tend to chose a single way of colouring all of a Pod/regex/quoting section.
Similar sorts of problems exist with POD and regex, which need their own colouring rules. |
this is true, but with regards to heredocs specifically: They're not notably different from Ruby's heredocs which basically every editor handles by just making all the contents be highlighted like any other string regardless of it they can be interpolated or not. I don't see With regards to your example of embedded heredocs, as a human i'm not even sure what the "right" way to highlight that is so i wouldn't complain about an editor's highlighter saying "screw it. it's a comment" examples of ruby heredocs follow. emacs highlights the following heredocs pretty similarily to what github is doing. I feel like "perfect" isn't required here. I think a simple "just treat it like a string" is fine. type = "healthy"
table = "food"
query = <<-SQL
SELECT * FROM #{table}
WHERE #{type} = true
SQL
query = <<~SQL
SELECT * FROM #{table}
WHERE #{type} = true
SQL |
The contents of a heredoc are highlighted as if they were code, instead of a string.
See attached screenshot.
The text was updated successfully, but these errors were encountered: