-
Notifications
You must be signed in to change notification settings - Fork 558
Document RBS block syntax #8828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
website/docs/rbs-support.md
<
8000
span title="Label: Outdated" data-view-component="true" class="Label Label--secondary">
Outdated
Show resolved
Hide resolved
1115625
to
b0dc475
Compare
website/docs/rbs-support.md
Outdated
| [Block type] | `{ (Foo) -> Bar }` | [`T.proc.params(arg: Foo).returns(Bar)`](procs.md) | | ||
| [Optional Block type] | `?{ (Foo) -> Bar }` | [`T.nilable(T.proc.params(arg: Foo).returns(Bar))`](procs.md#optional-blocks) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally had these as a single row with <br>
, but that didn't look great.
This looks better, although the optional block line ends up split over two lines due to the way the table gets formatted. I might try opening a different PR that switches the last column to use actual ```ruby
code blocks, and spread the type_parameters
example over multiple lines, which I suspect would fix that and read better anyway (on top of giving us formatting for the Sorbet code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#8831 is being merged, so I'll rebase ahead of it to streamline review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️ fyi. @jez
36f2b1a
to
844b074
Compare
|
While `sig` style signatures use the same syntax to describe blocks as `Proc`s, RBS syntax doesn't.
Head branch was pushed to by a user without write access
Nevermind, it was the reference link indentation. I've pushed a fix. cc. @jez |
This adds entries to the RBS "quick reference" table for (mandatory) and optional blocks.
Motivation
While
sig
style signatures use the same syntax to describe blocks asProc
s, RBS syntax doesn't.Test plan
This is a documentation only change.