-
Notifications
You must be signed in to change notification settings - Fork 205
Add hover documentation for reserved keywords #3553
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
Open
mikeygough
wants to merge
25
commits into
main
Choose a base branch
from
add-hover-documentation-for-keywords
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to use the Graphite Merge QueueAdd the label graphite-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
adb884e
to
0acb5f9
Compare
vinistock
reviewed
May 29, 2025
3ae4d4c
to
ab082e3
Compare
ab082e3
to
aaa27d3
Compare
aaa27d3
to
ae11a22
Compare
f0d252e
to
cd2f5bc
Compare
cd2f5bc
to
847ba97
Compare
a9f9809
to
c7d8d1e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
server
This pull request should be included in the server gem's release notes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially closes #2227
This PR adds hover documentation for the following Ruby reserved keywords:
break
case
class
def
defined?
else
ensure
for
module
next
rescue
return
undef
unless
until
when
while
ruby-keyword-hover-documentation-demo.mov
This documentation was written by AI following Shopify's Ruby style guide. It has been reviewed by myself but would appreciate additional, more experienced eyes!
NOTE - The following keywords still need definitions which may require modifying their associated
Prism Node
:alias
and
begin
do
elsif
end
false
if
in
nill
not
or
redo
retry
self
super
then
true
Motivation
We can deliver a better Ruby programming experience if developers can hover over built-in keywords to learn more about how they work!
Implementation
This implementation follows a pattern established by the
yield
keyword. It adds a key value pair to theKEYWORD_DOCS' hash inside
static_docs.rb, writes a keyword specific markdown file that goes into a deeper explanation and extends
hover.rb` to handle keyword specific hover events.Automated Tests
Run
dev t
Manual Tests
Start the Ruby LSP. Use some keywords and checkout the tooltips + related documentation!