From 4a81f2f1c440fb769ff2e3518cf69f65b233dd3d Mon Sep 17 00:00:00 2001 From: Andy Waite Date: Thu, 15 Jun 2023 15:12:51 -0400 Subject: [PATCH] Rename to on_node --- lib/ruby_lsp/event_emitter.rb | 2 +- lib/ruby_lsp/requests/folding_ranges.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ruby_lsp/event_emitter.rb b/lib/ruby_lsp/event_emitter.rb index a058377424..53d2c5df95 100644 --- a/lib/ruby_lsp/event_emitter.rb +++ b/lib/ruby_lsp/event_emitter.rb @@ -53,7 +53,7 @@ def emit_for_target(node) sig { override.params(node: T.nilable(SyntaxTree::Node)).void } def visit(node) - @listeners[:on_visit]&.each { |l| T.unsafe(l).on_visit(node) } + @listeners[:on_node]&.each { |l| T.unsafe(l).on_node(node) } super end diff --git a/lib/ruby_lsp/requests/folding_ranges.rb b/lib/ruby_lsp/requests/folding_ranges.rb index 3592afee1c..9f17400923 100644 --- a/lib/ruby_lsp/requests/folding_ranges.rb +++ b/lib/ruby_lsp/requests/folding_ranges.rb @@ -68,11 +68,11 @@ def initialize(emitter, message_queue) @response = T.let([], ResponseType) @partial_range = T.let(nil, T.nilable(PartialRange)) - emitter.register(self, :on_visit) + emitter.register(self, :on_node) end sig { params(node: T.nilable(SyntaxTree::Node)).returns(T.untyped) } # TODO: fix sig - def on_visit(node) + def on_node(node) visit(node) emit_partial_range end