Skip to content

enh-ruby-add-log-current-method not including nesting modules in result #156

@toddjeff

Description

@toddjeff

I'm using robe and trying to navigate my project.
robe uses enh-ruby-add-log-current-method to resolve the current context.

When I have code like:

module One
  module Two
    class Class
      def method
         blah  # cursor here
      end
    end
  end
end

the call to enh-ruby-add-log-current-method returns Class#method when the expected result should be One::Two::Class#method

Tests, first one fails, second succeeds:

(ert-deftest enh-ruby-nested-modules ()
  (with-temp-enh-rb-string
   "module One\nmodule Two\nclass Class\ndef method\n# blah\nend # method\nend # class\nend # One\nend # Two"
   (search-forward "blah")
   (should (equal "One::Two::Class#method" (enh-ruby-add-log-current-method)))))

(ert-deftest enh-ruby-nested-modules-compact ()
  (with-temp-enh-rb-string
   "class One::Two::Class\ndef method\n# blah\nend # method\nend # class"
   (search-forward "blah")
   (should (equal "One::Two::Class#method" (enh-ruby-add-log-current-method)))))

Related to #96

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions