I would expect that I can see YARD formatted documentation about a function method in a class. This is particularly useful when I create ruby methods through metaprogramming. Currently, hovering on a method that is created dynamically would not show any information.
However, we will not add support for YARD annotations. There are multiple reasons for that
We try to keep the Ruby LSP's concerns related only to Ruby itself. YARD is a separate gem and not every Ruby developer uses it
When it comes to adding type annotations, a complete gradual type system like Sorbet or Steep yields significantly better results. They provide the ability to narrow types, widen types, use generics, interfaces, etc - things that are not possible to do with YARD annotations
For handling declarations that occur via meta-programming, we are going to explore both options through our addon system and through RBS files. RBS is significantly more expressive and thus we will favour support for that for manually written annotations. And with the addon system we hope to provide APIs for other gems to teach the indexer how to handle their meta-programming DSLs
I have checked that this feature is not already implemented
Use case
This is a feature request to improve Hover.
I would expect that I can see YARD formatted documentation about a function method in a class. This is particularly useful when I create ruby methods through metaprogramming. Currently, hovering on a method that is created dynamically would not show any information.
Code example:
As a side, Solargraph supports parsing YARD directives. And solargraph VS Code plugin shows defined function upon hovering.
Description
RubyLSP should parse YARD directives when parsing code documents.
Implementation
No response