Skip to content

Commit

Permalink
Rename to on_node
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Jun 15, 2023
1 parent 6e5c806 commit 4a81f2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ruby_lsp/event_emitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/ruby_lsp/requests/folding_ranges.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4a81f2f

Please sign in to comment.