# File lib/ruby_lsp/listeners/document_link.rb, line 68definitialize(response_builder, uri, comments, dispatcher)
# Match the version based on the version in the RBI file name. Notice that the `@` symbol is sanitized to `%40`# in the URI@response_builder = response_builderpath = uri.to_standardized_pathversion_match = path?/(?<=%40)[\d.]+(?=\.rbi$)/.match(path) :nil@gem_version = T.let(version_match&&version_match[0], T.nilable(String))
@lines_to_comments = T.let(
comments.to_hdo|comment|
[comment.location.end_line, comment]
end,
T::Hash[Integer, Prism::Comment],
)
dispatcher.register(
self,
:on_def_node_enter,
:on_class_node_enter,
:on_module_node_enter,
:on_constant_write_node_enter,
:on_constant_path_write_node_enter,
)
end
Public Instance Methods
on_class_node_enter(node)
# File lib/ruby_lsp/listeners/document_link.rb, line 98defon_class_node_enter(node)
extract_document_link(node)
end
on_constant_path_write_node_enter(node)
# File lib/ruby_lsp/listeners/document_link.rb, line 113defon_constant_path_write_node_enter(node)
extract_document_link(node)
end
on_constant_write_node_enter(node)
# File lib/ruby_lsp/listeners/document_link.rb, line 108defon_constant_write_node_enter(node)
extract_document_link(node)
end
on_def_node_enter(node)
# File lib/ruby_lsp/listeners/document_link.rb, line 93defon_def_node_enter(node)
extract_document_link(node)
end
on_module_node_enter(node)
# File lib/ruby_lsp/listeners/document_link.rb, line 103defon_module_node_enter(node)
extract_document_link(node)
end