Sha256: 48b23be23973e688e92490b22579537a00b60f464f584fc8671d813513002bb4
Contents?: true
Size: 854 Bytes
Versions: 19
Compression:
Stored size: 854 Bytes
Contents
# typed: strict # frozen_string_literal: true module RubyLsp module Requests # :nodoc: class BaseRequest < SyntaxTree::Visitor extend T::Sig extend T::Helpers include Support::Common abstract! sig { params(document: Document).void } def initialize(document) @document = document super() end sig { abstract.returns(Object) } def run; end # Syntax Tree implements `visit_all` using `map` instead of `each` for users who want to use the pattern # `result = visitor.visit(tree)`. However, we don't use that pattern and should avoid producing a new array for # every single node visited sig { params(nodes: T::Array[T.nilable(SyntaxTree::Node)]).void } def visit_all(nodes) nodes.each { |node| visit(node) } end end end end
Version data entries
19 entries across 19 versions & 1 rubygems