Sha256: 9843ae8a752991a0ac54eb3e5e6720c5c94cbed6ded7e1370a6b091e882bd22f

Contents?: true

Size: 1.62 KB

Versions: 20

Compression:

Stored size: 1.62 KB

Contents

module RBS
  # Locator helps finding RBS elements based on locations in the RBS source text.
  #
  class Locator
    type component = Symbol
                   | Types::t
                   | MethodType
                   | AST::Declarations::t
                   | AST::Members::t
                   | AST::TypeParam
                   | AST::Declarations::Class::Super
                   | AST::Declarations::Module::Self

    # Array of _top-level_ declarations.
    #
    attr_reader decls: Array[AST::Declarations::t]

    def initialize: (decls: Array[AST::Declarations::t]) -> void

    def buffer: () -> Buffer

    # Returns list of components.
    # Inner component comes first.
    #
    def find: (line: Integer, column: Integer) -> Array[component]

    # Returns pair of the inner most symbol and outer components.
    # It ensures the array starts with a AST/type component.
    #
    def find2: (line: Integer, column: Integer) -> [Symbol?, Array[component]]?

    def find_in_decl: (Integer pos, decl: AST::Declarations::t, array: Array[component]) -> bool

    def find_in_member: (Integer pos, member: AST::Members::t, array: Array[component]) -> bool

    def find_in_method_type: (Integer pos, method_type: MethodType, array: Array[component]) -> bool

    def find_in_type: (Integer pos, type: Types::t, array: Array[component]) -> bool

    def find_in_type_param: (Integer pos, type_param: AST::TypeParam, array: Array[component]) -> bool

    def find_in_loc: (Integer pos, location: Location[untyped, untyped]?, array: Array[component]) -> bool

    def test_loc: (Integer pos, location: Location[untyped, untyped]?) -> bool
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/rbs-2.8.4/sig/locator.rbs
rbs-3.0.0.dev.2 sig/locator.rbs
rbs-2.8.4 sig/locator.rbs
rbs-2.8.3 sig/locator.rbs
rbs-3.0.0.dev.1 sig/locator.rbs
rbs-2.8.2 sig/locator.rbs
rbs-2.8.1 sig/locator.rbs
rbs-2.8.0 sig/locator.rbs
rbs-2.8.0.pre.1 sig/locator.rbs
rbs-2.7.0 sig/locator.rbs
rbs-2.7.0.pre.3 sig/locator.rbs
rbs-2.7.0.pre.2 sig/locator.rbs
rbs-2.7.0.pre.1 sig/locator.rbs
rbs-2.6.0 sig/locator.rbs
rbs-2.5.1 sig/locator.rbs
rbs-2.5.0 sig/locator.rbs
rbs-2.4.0 sig/locator.rbs
rbs-2.3.2 sig/locator.rbs
rbs-2.3.1 sig/locator.rbs
rbs-2.3.0 sig/locator.rbs