AaronC81 / sord

Convert YARD docs to Sorbet RBI and Ruby 3/Steep RBS files
https://sord.aaronc.cc
MIT License
293 stars 18 forks source link

Support single overload #168

Closed ohai closed 1 year ago

ohai commented 1 year ago

Outline

This PR adds support for a single "overload" tag. This PR is required to handle YARD documents for C/C++ extension.

Background

The "overload" tag in YARD is used for the following two purposes:

  1. Describing overloaded methods
  2. Write YARD documents for C/C++ extensions

The YARD system can not retrieve signatures of methods written by C/C++, therefore overload tag is usually used to describe such method signatures.

Description

This PR treats such an overload tag by replacing the method signature with the content of the first overload tag. The information contained in the overload tag is also merged into the method object.

Limitation

The second and subsequent overload tags are ignored.

AaronC81 commented 1 year ago

Thanks! I've never seen this before, interesting to know about :)

AaronC81 commented 1 year ago

This change is included in release 5.1.0 and also 6.0.0, so you can pick which to use depending on whether 6.0's breaking change affects you (support for RBS 3.0)