Sha256: 11e48e0f14024e33ede4e665f1ffba8d15705f5c23df9f444ef7b5f4df77d42a

Contents?: true

Size: 684 Bytes

Versions: 58

Compression:

Stored size: 684 Bytes

Contents

# typed: strict
# frozen_string_literal: true

module RubyLsp
  module Requests
    module Support
      class SelectionRange < Interface::SelectionRange
        extend T::Sig

        sig { params(position: T::Hash[Symbol, T.untyped]).returns(T::Boolean) }
        def cover?(position)
          start_covered = range.start.line < position[:line] ||
            (range.start.line == position[:line] && range.start.character <= position[:character])
          end_covered = range.end.line > position[:line] ||
            (range.end.line == position[:line] && range.end.character >= position[:character])
          start_covered && end_covered
        end
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
ruby-lsp-0.23.6 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.23.5 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.23.4 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.23.3 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.23.2 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.23.1 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.23.0 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.22.1 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.22.0 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.21.3 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.21.2 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.21.1 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.21.0 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.20.1 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.20.0 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.19.1 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.19.0 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.18.4 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.18.3 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.18.2 lib/ruby_lsp/requests/support/selection_range.rb