Open alexr00 opened 5 years ago
From @amerov on November 18, 2018 7:54
@alexr00 It is valid ruby code. Examples: https://github.com/rails/rails/blob/master/activemodel/lib/active_model/attributes.rb#L35 https://github.com/rails/rails/blob/master/activerecord/lib/active_record/persistence.rb#L659 https://github.com/rails/rails/blob/master/activerecord/lib/active_record/nested_attributes.rb#L370
From @rebornix on November 19, 2018 17:7
@alexr00 the heredoc content starts from the line following the heredoc identifier (LOG
in our case) and we can use the heredoc identifier as a variable in that line, so log(<<-LOG)
is a valid function call and <<-LOG
is referring to the content after this line (and also ends with LOG
). https://docs.ruby-lang.org/en/2.5.0/syntax/literals_rdoc.html
For short, )
is not part of the multiline string, our grammar is kind of wrong.
Thanks for checking!
From @amerov on November 8, 2018 21:16
The closing paren gets classified incorrectly as string.unquoted.heredoc.ruby on line 7.
Highlighting example, incorrect on the left, correct on the right.
Copied from original issue: Microsoft/vscode#62812