-
Notifications
You must be signed in to change notification settings - Fork 93
Sigil heredoc support #468
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
Conversation
I just realized that triple quotes are valid for all sigils, so a "true fix" might require a different change. iex(1)> ~c""" ...(1)> foo bar ...(1)> """ 'foo bar\n' iex(2)> ~r""" ...(2)> foo bar ...(2)> """ ~r/foo bar\n/ iex(3)> ~W""" ...(3)> foo bar ...(3)> """ ["foo", "bar"] iex(4)> |
Could you add the full list of supported sigils from: https://github.com/elixir-editors/emacs-elixir/pull/454/files It won't be perfect but I think it would be good enough for now. |
dbfd195
to
bb081e6
Compare
@axelson Done! 😁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! ❤️
@@ -265,7 +265,7 @@ is used to limit the scan." | |||
(unless (elixir-syntax-in-string-or-comment-p) | |||
(let ((heredoc-p (save-excursion | |||
(goto-char (match-beginning 0)) | |||
(looking-at-p "~[sS]\\(?:'''\\|\"\"\"\\)")))) | |||
(looking-at-p "~[BCDELNRSTUbcersw]\\(?:'''\\|\"\"\"\\)")))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@axelson we should generate tests for these new sigils as it's really easy to break and not notice day-to-day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's a good point and it would be good to include tests for them
The syntax highlighting for LiveView with heredocs is broken:

This (single character) change make the

~L
sigil support heredocs:Ideally I would like to apply the interpolation face inside of
<% ... %>
, but I'm not really sure how to approach that and this change stands on its own.