rbs icon indicating copy to clipboard operation
rbs copied to clipboard

URI is missing

Open mullermp opened this issue 1 year ago • 3 comments

I am trying to state that an accessor (called :uri) is of type URI but it fails. Does this exist and I am doing something wrong, or is it missing?

sig/lib/hearth/request.rbs:5:23: [error] Cannot find type `URI`
│ Diagnostic ID: RBS::UnknownTypeName
│
└     attr_accessor uri: URI

mullermp avatar Aug 29 '23 16:08 mullermp

URI type signatures exist here. https://github.com/ruby/rbs/tree/master/stdlib/uri/0

stdlib require loaded in some way. The recommended way is rbs collection. https://github.com/ruby/rbs/blob/master/docs/collection.md

ksss avatar Aug 30 '23 01:08 ksss

Thanks for the quick response. Shouldn't URI be included by default since it's in stdlib? I'm a bit confused why it would be considered third party. I will have to look to see how to integrate this with GH actions..

mullermp avatar Aug 30 '23 22:08 mullermp

We need to require 'uri' to use URI. However, I think it is a constant that does not exist in an environment that does not require 'uri' and would be included in the mistakes we want to detect.

ksss avatar Aug 31 '23 01:08 ksss