steep icon indicating copy to clipboard operation
steep copied to clipboard

`steep check` fails with `Diagnostic ID: RBS::UnknownTypeName` when referencing third-party library

Open jodosha opened this issue 4 years ago • 0 comments

👋 Hello and thanks for steep.

I'm trying steep with hanami-api, which depends on hanami-router.

When running steep check I get these errors:

⚡ bundle exec steep check
# ...

sig/hanami/api/block/context.rbs:7:6: [error] Cannot find type `Hanami::Router::Block::Context`
│ Diagnostic ID: RBS::UnknownTypeName
│
└       class Context < Hanami::Router::Block::Context
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sig/hanami/api/router.rbs:4:4: [error] Cannot find type `::Hanami::Router`
│ Diagnostic ID: RBS::UnknownTypeName
│
└     class Router < ::Hanami::Router
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These Ruby source files are doing the proper require to get the third-party code (hanami-router) loaded.


When I add hanami-router to Steepfile as a library, then I get a different error:

# Steepfile
 target :lib do
   signature "sig"
   check "lib"

   library "hanami-router"
end
⚡ bundle exec steep check
#<RBS::EnvironmentLoader::UnknownLibraryError: Cannot find type definitions for library: hanami-router ([nil])>
  # stacktrace ...

Does it means that third-party libraries need to ship with RBS files themselves, otherwise steep doesn't work?

It seems a chicken-egg problem here. What am I doing wrong?

jodosha avatar Nov 19 '21 16:11 jodosha