atom / language-ruby

Ruby package for Atom
Other
100 stars 144 forks source link

Final `end` does not get highlighted after a block with a rescue inside a method #274

Closed calebmeyer closed 4 years ago

calebmeyer commented 5 years ago

Prerequisites

Description

Ruby 2.6 added the ability to do a rescue without a corresponding begin inside a block. That means code like

arr.each do |thing|
  begin
    try(thing)
  rescue error
    handle_it
  end
end

can be rewritten a little shorter (omitting the begin, and fixing the indentation):

arr.each do |thing|
  try(thing)
rescue error
  handle_it
end

Steps to Reproduce

  1. Put a block like the above into a method

Expected behavior: All end tags are syntax highlighted

Actual behavior: The method's end tag loses highlighting: image

Reproduces how often: 100% of the time

Versions

atom --version

Atom    : 1.40.0
Electron: 3.1.10
Chrome  : 66.0.3359.181
Node    : 10.2.0

apm --version
apm  2.4.2
npm  6.2.0
node 10.2.1 x64
atom 1.40.0
python 3.7.2
git 2.16.2.windows.1
visual studio

OS: Windows 10 Enterprise (1809)

Additional Information

None at this time

alxtz commented 4 years ago

Hi @calebmeyer , I think this problem is in the upstream https://github.com/tree-sitter/tree-sitter-ruby

since the tree sitter parser I'm testing doesn't recognize the syntax in the first place

image

image

calebmeyer commented 4 years ago

Closing this in favor of https://github.com/tree-sitter/tree-sitter-ruby/issues/112 then