pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

Lower-case-ing the heredoc language

Open mauricioszabo opened this issue 2 years ago • 8 comments

Two small fixes here:

  1. Usually, on Ruby, "heredocs" are always uppercase. So I'm lower-casing so that it tries to get the right grammar
  2. When a grammar is not found, heredocs are highlighted as strings

mauricioszabo avatar May 23 '23 00:05 mauricioszabo

Typically the injectionRegex has been written to capture either uppercase or lowercase, but I don't have a problem with this. Seems like a more elegant way of handling it.

savetheclocktower avatar May 23 '23 00:05 savetheclocktower

@savetheclocktower just wanted to be sure what do you think about the (heredoc_content) being highlighted as string, but if you don't have any problem with it, I'll just write a test case and be done with this :)

mauricioszabo avatar May 23 '23 00:05 mauricioszabo

Doesn't heredoc_body take care of that?

savetheclocktower avatar May 23 '23 01:05 savetheclocktower

Not really, it was only highlighting around the doc, not the contents

mauricioszabo avatar May 23 '23 01:05 mauricioszabo

So heredoc_content is a child of heredoc_body. We should choose to apply string.unquoted.ruby to one of them, not both, or else the scope will get repeated.

savetheclocktower avatar May 24 '23 00:05 savetheclocktower

Hang on. This feedback still needs to be addressed:

So heredoc_content is a child of heredoc_body. We should choose to apply string.unquoted.ruby to one of them, not both, or else the scope will get repeated

savetheclocktower avatar Jun 09 '23 05:06 savetheclocktower

Ok, @savetheclocktower, it seems that it's better to apply only to heredoc_body because heredoc_content only applies to the inside of the string - so the highlighting could become really weird...

mauricioszabo avatar Jun 21 '23 04:06 mauricioszabo

Perhaps this PR can be updated since we've had quite a lot of Tree-Sitter related fixes implemented since this was originally opened?

Spiker985 avatar Apr 09 '24 21:04 Spiker985