cursorless: Scope `funk` doesn't match on Class methods - ruby

I was hoping to try and fix this myself as a way to get familiar with how cursorless + tree sitter works but it might take me a bit to get up to speed. Here is the issue:

Given this code:

class Test
  class << self
    # `take funk` doesn't work
    def baz
    end
  end

  # `take funk` doesn't work
  def self.foo
    new.process
  end

  # `take funk` doesn't work
  def Test.bar
    new.process
  end

  # `take funk` works :D
  def process
    puts "process"
  end
end

Current use cases/scopes not covered:

  • "change funk" on a function defined self.
  • "change funk" on a function defined ClassName.
  • "change funk" on a function defined within class << self .... end block

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (13 by maintainers)

Most upvoted comments

Heyo @richardmcmillen, interjecting here. I’m Will Sommers on the Talon slack and wheels on Handsfree Discord. Reach out if you have questions. I’m happy to answer there as well if it helps with a quicker feedback loop!

Heyo @richardmcmillen — thanks for adding this and apologies for missing it initially. I added another example in your code example and added a check list. When recording a test, it is best to use change or chuck instead of take since it is easier to see what happened in the test example. Please reach out in Slack if you have any questions or run into problems trying to implement this.

@pokey, no idea what to call whatever is inside class << self, thoughts?

Fwiw the best place to start is prob the docs for adding a new language. You can ignore a lot of it, eg around using new language PR template etc. We’re hoping to refactor those docs a bit so that they are more useful for just fixing up existing language, but hopefully that info gets you in the right direction