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

Wrong syntax highlighting on ECR #112

Closed MatheusRich closed 3 years ago

MatheusRich commented 4 years ago

A weird one on ECR: image

Using the ERB highlighting: image

I'm using the One Dark PRO theme

sol-vin commented 3 years ago

My issue may be related #128

sol-vin commented 3 years ago

@asterite confirmed fixed my issue #128 with #129 , but it didn't fix this issue. I can confirm it is still present.

asterite commented 3 years ago

Of course, it doesn't seem to be related to string interpolation :-)

I'll see if I can see what's going on...

asterite commented 3 years ago

It would have been helpful to have the textual thing, not an image... oh well...

asterite commented 3 years ago

I won't fix it but your best bet is to copy this one from Ruby and adapt it to Crystal: https://github.com/rubyide/vscode-ruby/blob/master/packages/vscode-ruby/syntaxes/erb.cson.json

MatheusRich commented 3 years ago

Another one: %w is not interpreted as string.

Crystal: image

Ruby: image

Here's the code:

%w[some WORDS in HERE]
asterite commented 3 years ago

Thank you! But these are all different bugs, I would open separate issues for them.

MatheusRich commented 3 years ago

@asterite I thought it would make sense to keep this Highlight issues together, but I'll open another issue. Thanks!

max-bertinetti commented 3 years ago

@MatheusRich can you please provide a sample file to see the situation about this ticket?

MatheusRich commented 3 years ago

@maxbertinetti here it is:

<% (1..10).each do |index| %>
  <tr class="<%= index.odd? ? "odd" : "even" %>">
<% end %>
max-bertinetti commented 3 years ago

@MatheusRich I think is not correct the way you are trying to render this. You must use single quote outside and double inside.

BTW in v0.8.2

image