-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruby TextObjects and more file extensions #2143
Ruby TextObjects and more file extensions #2143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a nit but lines 3 and 24 are indented by one space. Can we use two for the sake of consistency?
What do you think about a class selector for singleton classes? (I'm not sure if I have the right terminology here.) module Foo
class << self
# ..
end
end I think a query like (singleton_class
value: (_)
(_)+ @class.inside) @class.around might cover it. |
Nice, I added it too. |
I did tests for Classes using these variations: class Bar
# ...
end
class Bar < Foo
# ...
end
class Bar < Foo::Test
# ...
end
class Bar::Foo
# ...
end
class Bar::Foo < Foo
# ...
end
class Bar::Foo < Foo::Test
# ...
end
module Bar
class Foo
# ...
end
end
module Bar
class Foo < Bar
# ...
end
end
class Bar
class Foo
# ...
end
def test
# ...
end
end
module Foo
class << self
# ...
end
end
Class.new do
# ...
end But I had to do this test manually. @the-mikedavis do you know if we have Unit Tests for it? I'm pretty sure that a future update on https://github.com/tree-sitter/tree-sitter-ruby could break it. |
There isn't currently test infrastructure for queries although I think it's a good idea. Highlights queries could use the existing tree-sitter testing syntax and textobjects might be able to use some recent testing utilities around selections within Helix. We pin the grammar repository versions in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this, these look great!
thanks for this @danillos! |
It includes Ruby TextObjects and more Ruby file extensions
It is my first time working with Tree-Sitter, improvements are welcome.