-
Notifications
You must be signed in to change notification settings - Fork 23
Description
I've spent a bit of time with this and I'm quite pleased with the concept and the workflow even in this early stage. Kudos!
I think there's a fantastic opportunity here to zoom out to the ecosystem level and really fine-tune the DX around authoring code, documentation, type hints, and checking all as a single unit of effort—as is possible in many other language ecosystems.
To that end, what might the relationship be between these inline RBS comments and YARDoc? Consider the following:
# Convert a Markdown string into HTML output.
#
# @param input [String] the Markdown to convert
# @return [String]
def markdownify(input)
# ...
endWith RBS inline, I could instead write this:
# Convert a Markdown string into HTML output.
#
# @rbs input: String - the Markdown to convert
# @rbs returns String
def markdownify(input)
# ...
endBut now I'm not going to get documentation for my code. Would I have to duplicate?
# Convert a Markdown string into HTML output.
#
# @rbs input: String
# @param input [String] the Markdown to convert
# @rbs returns String
# @return [String]
def markdownify(input)
# ...
endHmm. 😐
A few possible directions to go:
- Add
@rbstag support to YARD. I honestly have no idea how easy that might be though. - Support some common YARD tags in addition to
@rbs. This starts wading into https://github.com/AaronC81/sord territory though, not sure if that would ever be in scope. - Add or document modular plugin feature so a third-party could offer support for YARD tags.
For additional context, I've been using YARD + Solargraph + VSCode for my Ruby dev environment for several years now, and the experience is pretty good overall (even though I'm not using it for type checking, just autocomplete/tips/jump/etc.). I'd love to see a day I can use YARD + Steep with inline RBS and really get a best-of-all-worlds experience. 🤩