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

Hover Definitions for Ruby Keywords #2227

Open
32 of 84 tasks
jamesmengo opened this issue Jun 26, 2024 · 5 comments
Open
32 of 84 tasks

Hover Definitions for Ruby Keywords #2227

jamesmengo opened this issue Jun 26, 2024 · 5 comments
Assignees
Labels
documentation Improvements or additions to documentation pinned This issue or pull request is pinned and won't be marked as stale

Comments

@jamesmengo
Copy link

jamesmengo commented Jun 26, 2024

Set up the tooltips

Add tooltips to these keywords. The markdown files should have the description below and a newbie-friendly description.

Try to avoid having tooltips which are over-zealous (e.g. DefNode will work on any keyword within a method definition).

Tooltips

Write long-form documentation

Write newbie-friendly documentation in .md form for each of the following keywords. Once written, link to it from the tooltip. The link should open the markdown file locally in the editor.

Please see the north star comment from @vinistock below:

Expand thoughts on newbie-friendly documentation

I would expand on certain things and try to be super exhaustive with all aspects of the language. For example, in the methods documentation, what is a method?
In the modules documentation, we could explain that they are Ruby's way of supporting multiple inheritance, since it does not allow for more than on parent class. We should also mention the differences between prepending, including or extending a module

The goal of these docs is to make someone who is new to Ruby (or new to programming altogether) be able to gather a better understanding of how Ruby works from inside the editor. So a good exercise is trying to put yourself into the position of a newbie. What could be confusing? What was unclear when you first started with Ruby?

Long-form docs

Special Cases

@jamesmengo jamesmengo assigned Stivaros and jamesmengo and unassigned st0012 Jun 26, 2024
@Stivaros Stivaros added the documentation Improvements or additions to documentation label Jun 27, 2024
@jamesmengo
Copy link
Author

Following branch contains starters for long-form descriptions + tooltip descriptions
https://github.com/Shopify/ruby-lsp/compare/jm/hd

@Stivaros
Copy link

I've rebased your changes into my branch, thanks!

@andyw8
Copy link
Contributor

andyw8 commented Jun 27, 2024

A false value usually indicating “no value” or “unknown”.

I'd suggest "falsey" rather than false.

@Stivaros
Copy link

A false value usually indicating “no value” or “unknown”.

I'd suggest "falsey" rather than false.

We are pulling these from the official docs, @andyw8. We will hopefully be improving these in our newbie-friendly extended docs, though.

Or do we know the right people to update the official docs with the improved definition?

@Stivaros
Copy link

Spoke to @vinistock and we won't document cases without a corresponding Prism::XNode. For example, the do keyword tends to belong to a CallNode in Prism rather than as a DoNode. In such cases, we will just not document it, but also ensure that hovering over do doesn't show the tooltip for a CallNode.

@vinistock vinistock added the pinned This issue or pull request is pinned and won't be marked as stale label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation pinned This issue or pull request is pinned and won't be marked as stale
Projects
None yet
Development

No branches or pull requests

6 participants