Sha256: f370f561e86c9bd820b6db42431cd422567777510347ad8233a2eb2de6430da8

Contents?: true

Size: 1.56 KB

Versions: 12

Compression:

Stored size: 1.56 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::Declarations::ModuleTypeParams::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_loc: (Integer pos, location: Location::WithChildren[untyped, untyped] | Location | nil, array: Array[component]) -> bool

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rbs-1.6.2 sig/locator.rbs
rbs-1.6.1 sig/locator.rbs
rbs-1.6.0 sig/locator.rbs
rbs-1.5.1 sig/locator.rbs
rbs-1.5.0 sig/locator.rbs
rbs-1.4.0 sig/locator.rbs
rbs-1.3.3 sig/locator.rbs
rbs-1.3.2 sig/locator.rbs
rbs-1.3.1 sig/locator.rbs
rbs-1.3.0 sig/locator.rbs
rbs-1.2.1 sig/locator.rbs
rbs-1.2.0 sig/locator.rbs