vscode-elixir-ls
vscode-elixir-ls copied to clipboard
Elixir embeddings not tokenized properly in HTLM sigil block
Elixir embeddings (like <%= %>) are not tokenized properly in ~L""" """ as opposed to .(l)eex files

Code
# Elixir
~L"""
<div class="one <%= if(true, do: "ok", else: "") %>">
</div>
"""
<%# HTML Elixir %>
<div class="one <%= if(true, do: "ok", else: "") %>">
</div>
Details
The ~L sigil includes all the rules that .(l)eex files use:
https://github.com/elixir-lsp/vscode-elixir-ls/blob/00023f4cbeda1b0aefd4043b3e1ce733bc9e20d6/syntaxes/elixir.json#L1585-L1589
However, the Elixir HTML tokenizer has this special configuration:
https://github.com/elixir-lsp/vscode-elixir-ls/blob/00023f4cbeda1b0aefd4043b3e1ce733bc9e20d6/syntaxes/html-eex.json#L5-L14
My guess is that "include" refers only to rules, so this additional configuration doesn't apply in the Elixir tokenizer. Mirroring "injections" into elixir.json seems to help, though I may be missing some other alternative.
Environment
- VSCode ElixirLS version: 0.7.0