Shopify / ruby-lsp

An opinionated language server for Ruby
https://shopify.github.io/ruby-lsp/
MIT License
1.54k stars 146 forks source link

Syntax highlight of parens is broken when using heredoc as argument #1790

Open eggplants opened 1 year ago

eggplants commented 1 year ago

Operating System

MacOS

Ruby version

3.0.6

Project has a bundle

Ruby version manager being used

rbenv

Description

With paren:

def a(arg1, arg2)
  p arg1, arg2
end

a(<<~EOS.chomp, 1)
  123123
EOS
スクリーンショット 2023-08-25 14 22 21

Without paren:

def a(arg1, arg2)
  p arg1, arg2
end

a <<~EOS.chomp, 1
  123123
EOS
スクリーンショット 2023-08-25 14 25 40
vinistock commented 1 year ago

For anyone who ends up investigating this, it is related to the grammar file. We do not push semantic highlighting tokens for heredocs or parenthesis as they are not ambiguous tokens.

github-actions[bot] commented 11 months ago

This issue is being marked as stale because there was no activity in the last 2 months

SampsonCrowley commented 7 months ago

Is there any update here? this isn't only a problem with parens. Ruby syntax doesn't recognize squiggly heredoc blocks as a string either:

Screenshot 2024-02-24 at 13 18 13