crystal-lang-tools / vscode-crystal-lang

Yet another VSCode extension for Crystal Programming Language
https://marketplace.visualstudio.com/items?itemName=crystal-lang-tools.crystal-lang
MIT License
276 stars 58 forks source link

Heredoc syntax highlighting is incorrect #149

Closed HertzDevil closed 9 months ago

HertzDevil commented 2 years ago

Screenshot_20211006_002204

For comparison, here is how the same code looks like in Ruby:

Screenshot_20211006_002300

(It appears they use only the last heredoc name as the delimiter for all heredocs that immediately follow.)

HertzDevil commented 2 years ago

This happens with GitHub itself too, so it should not be used as a guide of correctness:

# crystal
foo(<<-EOS, 1)
abcde
EOS

foo(<<-EOS, <<-MSG)
  1
  EOS
  2
  MSG
# ruby
foo(<<-EOS, 1)
abcde
EOS

foo(<<-EOS, <<-MSG)
  1
  EOS
  2
  MSG

Related: crystal-lang-tools/language-crystal#29

nobodywasishere commented 9 months ago

I don't think this is possible to fix without tree-sitter or an LSP, due to the complexity of Heredocs.