Index RBS attribute methods - #970
Conversation
vinistock
left a comment
There was a problem hiding this comment.
Just a few things, but it looks good. I can't believe we forgot attributes on RBS!
| Signatures::Simple(Box::new([])) | ||
| }; | ||
|
|
||
| let definition = Definition::Method(Box::new(MethodDefinition::new( |
There was a problem hiding this comment.
We have specific definitions for AttrWriter, AttrReader and AttrAccessor. Also, attributes don't carry a name offset and regular offset, since there's no distinction.
There was a problem hiding this comment.
The Attr* definitions do not support singleton attribute syntax in RBS, such as attr_reader self.name: String. I can extend them if it's better, but I don't think it would be worthwhile.
There was a problem hiding this comment.
Ah, I see. Yeah, we would need to add a receiver to attributes, but indeed it's not worth it at this time.
I also think that the DSL work might render the Attr* definitions unnecessary, so let's not do it right now 👍
| Signatures::Simple(Box::new([])) | ||
| }; | ||
|
|
||
| let definition = Definition::Method(Box::new(MethodDefinition::new( |
There was a problem hiding this comment.
Ah, I see. Yeah, we would need to add a receiver to attributes, but indeed it's not worth it at this time.
I also think that the DSL work might render the Attr* definitions unnecessary, so let's not do it right now 👍
Index RBS
attr_reader,attr_writer, andattr_accessormembers.RBS attributes are represented as
MethodDefinitions because the existing attribute-definition variants cannot represent singleton attributes such asattr_reader self.foo: String.This includes instance and singleton attributes, visibility, comments, and
deprecatedannotations. Writers are indexed with one required positional parameter.