-
Notifications
You must be signed in to change notification settings - Fork 213
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
base: main
Are you sure you want to change the base?
Conversation
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
3ae4d4c
to
ab082e3
Compare
ab082e3
to
aaa27d3
Compare
aaa27d3
to
ae11a22
Compare
f0d252e
to
cd2f5bc
Compare
cd2f5bc
to
847ba97
Compare
a9f9809
to
c7d8d1e
Compare
This pull request is being marked as stale because there was no activity in the last 2 months |
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!