atom / language-ruby

Ruby package for Atom
Other
101 stars 145 forks source link

Add more scopes to the tree-sitter grammar #244

Closed Ben3eeE closed 6 years ago

Ben3eeE commented 6 years ago

Requirements

Description of the Change

There were a couple of missing scope mappings that made the tree-sitter grammar not match the textmate grammar.

Alternate Designs

N/A

Benefits

Matches the textmate grammar more closely

Verification process

I used the following ruby file to test these new scope mappings

class OrderItem < ApplicationRecord

end

imablock do |param1, param2|
  OrderItem
end

def imablock(param1, param2)
end

def predicate?(date: start_on)
  do_a_thing
end

{key: CONSTANT, key2: 123, key3: false, key4: :symbol}

image

Applicable Issues

Fixes https://github.com/tree-sitter/tree-sitter-ruby/issues/94 Fixes https://github.com/atom/language-ruby/issues/243 Fixes https://github.com/atom/language-ruby/issues/242 Fixes https://github.com/atom/language-ruby/issues/241

Ben3eeE commented 6 years ago

image

With base16-tomorow-dark. Latest commit.

It seems that variable.constant is not styled in one-dark-syntax so it looks the same as my previous screenshot.

Ben3eeE commented 6 years ago

image

Added #241 to this PR as well so it fixes all open issues. I will merge and make a release PR on atom/atom once it's green.

Image is latest commit one-dark-syntax.