lib/ruby_lsp/requests/support/common.rb in ruby-lsp-0.11.2 vs lib/ruby_lsp/requests/support/common.rb in ruby-lsp-0.12.0
- old
+ new
@@ -8,11 +8,11 @@
# WARNING: Methods in this class may be used by Ruby LSP addons such as
# https://github.com/Shopify/ruby-lsp-rails, or addons by created by developers outside of Shopify, so be
# cautious of changing anything.
extend T::Sig
- sig { params(node: YARP::Node).returns(Interface::Range) }
+ sig { params(node: Prism::Node).returns(Interface::Range) }
def range_from_node(node)
loc = node.location
Interface::Range.new(
start: Interface::Position.new(
@@ -21,33 +21,33 @@
),
end: Interface::Position.new(line: loc.end_line - 1, character: loc.end_column),
)
end
- sig { params(location: YARP::Location).returns(Interface::Range) }
+ sig { params(location: Prism::Location).returns(Interface::Range) }
def range_from_location(location)
Interface::Range.new(
start: Interface::Position.new(
line: location.start_line - 1,
character: location.start_column,
),
end: Interface::Position.new(line: location.end_line - 1, character: location.end_column),
)
end
- sig { params(node: T.nilable(YARP::Node), range: T.nilable(T::Range[Integer])).returns(T::Boolean) }
+ sig { params(node: T.nilable(Prism::Node), range: T.nilable(T::Range[Integer])).returns(T::Boolean) }
def visible?(node, range)
return true if range.nil?
return false if node.nil?
loc = node.location
range.cover?(loc.start_line - 1) && range.cover?(loc.end_line - 1)
end
sig do
params(
- node: YARP::Node,
+ node: Prism::Node,
title: String,
command_name: String,
arguments: T.nilable(T::Array[T.untyped]),
data: T.nilable(T::Hash[T.untyped, T.untyped]),
).returns(Interface::CodeLens)
@@ -64,10 +64,10 @@
),
data: data,
)
end
- sig { params(title: String, entries: T::Array[RubyIndexer::Index::Entry]).returns(Interface::MarkupContent) }
+ sig { params(title: String, entries: T::Array[RubyIndexer::Entry]).returns(Interface::MarkupContent) }
def markdown_from_index_entries(title, entries)
markdown_title = "```ruby\n#{title}\n```"
definitions = []
content = +""
entries.each do |entry|