Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Jun 20, 2024
1 parent fbc43b5 commit 1df800c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESIGN_AND_ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Interested in contributing? Check out the issues tagged with [help-wanted] or [g

## Guessed types

Guessed types is an experimental features where the Ruby LSP attempts to identify the type of a receiver based on its
Guessed types is an experimental feature where the Ruby LSP attempts to identify the type of a receiver based on its
identifier name. For example:

```ruby
Expand Down
3 changes: 1 addition & 2 deletions lib/ruby_lsp/listeners/hover.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ def on_call_node_enter(node)

if type.is_a?(TypeInferrer::GuessedType)
title << " | guessed receiver: #{type.name}"
link = "https://github.com/Shopify/ruby-lsp/blob/main/DESIGN_AND_ROADMAP.md#guessed-types"
@response_builder.push("[Learn more about guessed types](#{link})\n", category: :links)
@response_builder.push("[Learn more about guessed types](#{GUESSED_TYPES_URL})\n", category: :links)
end

categorized_markdown_from_index_entries(title, methods).each do |category, content|
Expand Down
3 changes: 1 addition & 2 deletions lib/ruby_lsp/listeners/signature_help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def on_call_node_enter(node)

extra_links = if type.is_a?(TypeInferrer::GuessedType)
title << "guessed receiver: #{type.name}"
link = "https://github.com/Shopify/ruby-lsp/blob/main/DESIGN_AND_ROADMAP.md#guessed-types"
"[Learn more about guessed types](#{link})"
"[Learn more about guessed types](#{GUESSED_TYPES_URL})"
end

signature_help = Interface::SignatureHelp.new(
Expand Down
3 changes: 1 addition & 2 deletions lib/ruby_lsp/requests/completion_resolve.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def perform

extra_links = if @item.dig(:data, :guessed_type)
label << " | guessed receiver: #{owner_name}"
link = "https://github.com/Shopify/ruby-lsp/blob/main/DESIGN_AND_ROADMAP.md#guessed-types"
"[Learn more about guessed types](#{link})"
"[Learn more about guessed types](#{GUESSED_TYPES_URL})"
end

@item[:labelDetails] = Interface::CompletionItemLabelDetails.new(
Expand Down
1 change: 1 addition & 0 deletions lib/ruby_lsp/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module RubyLsp
end,
String,
)
GUESSED_TYPES_URL = "https://github.com/Shopify/ruby-lsp/blob/main/DESIGN_AND_ROADMAP.md#guessed-types"

# A notification to be sent to the client
class Message
Expand Down

0 comments on commit 1df800c

Please sign in to comment.