Closed andyw8 closed 1 week ago
@toddkummer this shipped in v0.3.27, if you want to check it's working wth your gem.
The current version of the gem has an extra level of indirection: the main controller mixin includes two modules that each have the class_methods do
block.
For example, the gem might be implemented by mixing the module into the ApplicationController:
class ApplicationController < ActionController::Base
include Filterameter::DeclarativeFilters
...
Which then uses one more level of includes...
module Filterameter
module DeclarativeFilters
extend ActiveSupport::Concern
include Filterameter::Filterable
include Filterameter::Sortable
...
To finally get to the class_methods do
block...
module Filterameter
module Filterable
extend ActiveSupport::Concern
class_methods do
...
def filter(name, options = {})
...
The extra level of indirection seems to prevent the hover and Go To Definition from working. When I collapse it so that the first include has the class_methods do
block, it does work. Here is a commit that shows that change.
I was leaning towards making that change anyways, so this fix does resolve my issue. I just wanted to share the additional finding with you in case it is valuable.
I think this confirms I am testing all this on the latest version:
$ less .ruby-lsp/Gemfile.lock | grep ruby-lsp-rails
ruby-lsp-rails (0.3.27)
(details to be added)
cc @toddkummer