nonsequitur / inf-ruby

218 stars 69 forks source link

Is there possible to jump to ruby namespace nested const? #155

Closed zw963 closed 2 years ago

zw963 commented 2 years ago

Following is a example:

module Types
  module UserQuery
    class UserQueryType < Types::BaseObject
      field :current_user, resolver: Types::UserQuery::Resolvers::CurrentUserResolver # case 1
      field :current_user, resolver: Resolvers::CurrentUserResolver  # case 2
  end
end

above case 1 and case 2 field have same effect.

When cursor on the case 1 CurrentUserResolver, robe jump feature is works!

But.

When cursour on the case 2 CurrentUserResolver, will tip Can't find the locatin. but code case 2 actually is working code, totally same as case 1, because Resolvers::CurrentUserResolver is under namespaced module, module Types => module => UserQuery => Resolvers::CurrentUserResolver

I can reproduce this on ruby 3.1.0 with inf-ruby newest master.

Thank you.


Added:

CurrentUserResolver defined like this,

class Types::UserQuery::Resolvers::CurrentUserResolver < Resolvers::Base
end

though, i consider this should not the reason, because another class define like this, not work too.

module Types
  module UserQuery
    class UserNameType
    end
  end
end

And, i use rails 6, autoloading feature use zeitwerk.

dgutov commented 2 years ago

Hi!

Is this about inf-ruby or robe?

zw963 commented 2 years ago

Hi!

Is this about inf-ruby or robe?

Sorry, robe, i will create a issue there.