Sha256: 9bd57105eebe8d02b70242959d4258640506785f2729e5da26960e1d838f60b0

Contents?: true

Size: 596 Bytes

Versions: 10

Compression:

Stored size: 596 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  # The RuboCop's built-in LSP module.
  module LSP
    module_function

    # Returns true when LSP is enabled, false when disabled.
    #
    # @return [Boolean]
    def enabled?
      @enabled ||= false
    end

    # Enable LSP.
    #
    # @return [void]
    def enable
      @enabled = true
    end

    # Disable LSP.
    #
    # @return [void]
    def disable(&block)
      if block
        original = @enabled
        @enabled = false
        yield
        @enabled = original
      else
        @enabled = false
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
rubocop-1.69.0 lib/rubocop/lsp.rb
rubocop-1.68.0 lib/rubocop/lsp.rb
rubocop-1.67.0 lib/rubocop/lsp.rb
rubocop-1.66.1 lib/rubocop/lsp.rb
rubocop-1.66.0 lib/rubocop/lsp.rb
rubocop-1.65.1 lib/rubocop/lsp.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/rubocop-1.64.1/lib/rubocop/lsp.rb
rubocop-1.65.0 lib/rubocop/lsp.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/rubocop-1.64.1/lib/rubocop/lsp.rb
rubocop-1.64.1 lib/rubocop/lsp.rb