aerial.nvim/tests/treesitter/ruby_test_singleton.rb
Slotos a2368d1c4b
fix(ts): improve ruby handling of singletons and methods (#293)
Ruby allows us to do a lot of weird stuff, and having weirdness glaring
at us from the side panel can be handy for when we sober up and start
cleaning.

This commit handles a number of singleton class manipulation cases,
as well as adds a reciever information to singleton method declarations.
2023-09-18 10:40:21 -07:00

48 lines
859 B
Ruby

class Klassy
class << self
def ==(other); end
def regular; end
def endless = nil
end
def self.<=>(other); end
def self.regularish; end
def self.endlessish = nil
end
def Explody.>(other); end
def Explody.regularnot; end
def Explody.endlessness = nil
def instance.==(other); end
def instance.regular; end
def instance.endless = nil
def youcandothistoo::==(other); end
def youcandothistoo::regular; end
def youcandothistoo::endless = nil
# This will actually explode in Ruby, but only because integers are special
class << 42
def ==(other); end
def regular; end
def endless = nil
end
class << "42"
def ==(other); end
def regular; end
def endless = nil
end
class << variable
def ==(other); end
def regular; end
def endless = nil
end
class << Constant
def ==(other); end
def regular; end
def endless = nil
end