Skip to content
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

rdoc comments are not parsed #443

Closed
jtmkrueger opened this issue Aug 29, 2024 · 2 comments
Closed

rdoc comments are not parsed #443

jtmkrueger opened this issue Aug 29, 2024 · 2 comments

Comments

@jtmkrueger
Copy link

After reading through Shopify/ruby-lsp#2181 I understand why yard will be skipped but what about parsing rdoc here in the ruby-lsp-rails addon?
rdoc is used throughout rails. A good example of where this would be great is when looking at the hover documentation for ActiveRecord::ModelSchema::ClassMethods#table_name (please don't judge my actual use case here lol):

Image

Compare this to how it's parsed at api.rubyonrails.org:

Image

Correctly parsing this rdoc would, in my humble opinion, aid in readability.

@vinistock
Copy link
Member

Thank you for the suggestion.

Unfortunately, the language server protocol specification only supports plain text and markdown, which is why RDoc documentation looks mangled and doesn't get properly rendered. The language server has no control over how it gets rendered.

The only way to have something like this work would be proposing a change to the specification to support RDoc as a possible format and then adding support for parsing RDoc in editors. However, that's very unlikely to happen since the spec tries to be programming language agnostic and RDoc is only used in Ruby - which is the reason why they went with Markdown, which is generally used by many programming languages. I doubt they would accept adding and maintaining a format that is specific to one language.

Generally, my understanding is that the RDoc format was created before Markdown existed. At this point, Markdown is much more wide spread and well known, so I think it would be beneficial for RDoc to default to Markdown instead of its own syntax.

In regards to the Rails documentations, we have proposed to the Rails team to migrate the documentation to Markdown syntax exactly for compatibility with language servers. My understanding is that they are looking into it.

@vinistock vinistock closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2024
@jtmkrueger
Copy link
Author

Thanks for the response @vinistock I found rails/rails#50759 and will follow along there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants