Sha256: 2fec412066e4f4fcb19531a8dd9caeea4d41c323181c0fdd82e5425a00cbcc3b

Contents?: true

Size: 681 Bytes

Versions: 17

Compression:

Stored size: 681 Bytes

Contents

# typed: strict
# frozen_string_literal: true

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

        sig { params(position: Document::PositionShape).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

17 entries across 17 versions & 2 rubygems

Version Path
study_line-0.1.6 vendor/bundle/ruby/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.13.1 lib/ruby_lsp/requests/support/selection_range.rb
study_line-0.1.5 vendor/bundle/ruby/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_lsp/requests/support/selection_range.rb
study_line-0.1.4 vendor/bundle/ruby/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_lsp/requests/support/selection_range.rb
study_line-0.1.3 vendor/bundle/ruby/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_lsp/requests/support/selection_range.rb
study_line-0.1.2 vendor/bundle/ruby/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_lsp/requests/support/selection_range.rb
study_line-0.1.1 vendor/bundle/ruby/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.13.0 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.12.5 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.12.4 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.12.3 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.12.2 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.12.1 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.12.0 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.11.2 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.11.1 lib/ruby_lsp/requests/support/selection_range.rb
ruby-lsp-0.11.0 lib/ruby_lsp/requests/support/selection_range.rb