-
Notifications
You must be signed in to change notification settings - Fork 193
Improve support for hovering over a gem in Gemfile #3344
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. |
@@ -92,6 +92,14 @@ def initialize(response_builder, global_state, uri, node_context, dispatcher, so | |||
|
|||
#: (Prism::StringNode node) -> void | |||
def on_string_node_enter(node) | |||
if @path && File.basename(@path) == GEMFILE_NAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same check as in on_call_node_enter
. It could be extracted out, e.g. is_gemfile?
.
a5fb4df
to
fd32e5d
Compare
fd32e5d
to
f1de537
Compare
source = <<~RUBY | ||
gem 'rake' | ||
RUBY | ||
|
||
# We need to pretend that Sorbet is not a dependency or else we can't properly test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, I think these were leftover from a copy and paste.
Motivation
Currently you can hover over an entry in the
Gemfile
to reveal information about a gem, but this works only for thegem
call and not the string containing the gem name.Implementation
Added behaviour to the
on_string_node_enter
callback.Automated Tests
Included
Manual Tests
Can be verified with Ruby LSP's own Gemfile, using this branch.