lib/ruby_lsp/requests/support/common.rb in ruby-lsp-0.5.1 vs lib/ruby_lsp/requests/support/common.rb in ruby-lsp-0.6.0
- old
+ new
@@ -3,10 +3,12 @@
module RubyLsp
module Requests
module Support
module Common
+ # WARNING: Methods in this class may be used by Ruby LSP extensions such as https://github.com/Shopify/ruby-lsp-rails,
+ # or extensions by created by developers outside of Shopify, so be cautious of changing anything.
extend T::Sig
sig { params(node: SyntaxTree::Node).returns(Interface::Range) }
def range_from_syntax_tree_node(node)
loc = node.location
@@ -53,37 +55,24 @@
sig do
params(
node: SyntaxTree::Node,
title: String,
command_name: String,
- path: String,
- name: String,
- test_command: String,
- type: String,
+ arguments: T.nilable(T::Array[T.untyped]),
+ data: T.nilable(T::Hash[T.untyped, T.untyped]),
).returns(Interface::CodeLens)
end
- def create_code_lens(node, title:, command_name:, path:, name:, test_command:, type:)
+ def create_code_lens(node, title:, command_name:, arguments:, data:)
range = range_from_syntax_tree_node(node)
- arguments = [
- path,
- name,
- test_command,
- {
- start_line: node.location.start_line - 1,
- start_column: node.location.start_column,
- end_line: node.location.end_line - 1,
- end_column: node.location.end_column,
- },
- ]
Interface::CodeLens.new(
range: range,
command: Interface::Command.new(
title: title,
command: command_name,
arguments: arguments,
),
- data: { type: type },
+ data: data,
)
end
end
end
end