Sha256: 61593f77259da95250d9ef8bd2c6b38dbe00dd5dd4177d18135d3dd8cc398a9e

Contents?: true

Size: 969 Bytes

Versions: 116

Compression:

Stored size: 969 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Lsp
    # Severity for Language Server Protocol of RuboCop.
    # @api private
    class Severity
      SEVERITIES = {
        fatal: LanguageServer::Protocol::Constant::DiagnosticSeverity::ERROR,
        error: LanguageServer::Protocol::Constant::DiagnosticSeverity::ERROR,
        warning: LanguageServer::Protocol::Constant::DiagnosticSeverity::WARNING,
        convention: LanguageServer::Protocol::Constant::DiagnosticSeverity::INFORMATION,
        refactor: LanguageServer::Protocol::Constant::DiagnosticSeverity::HINT,
        info: LanguageServer::Protocol::Constant::DiagnosticSeverity::HINT
      }.freeze

      def self.find_by(rubocop_severity)
        if (severity = SEVERITIES[rubocop_severity.to_sym])
          return severity
        end

        Logger.log("Unknown severity: #{rubocop_severity}")
        LanguageServer::Protocol::Constant::DiagnosticSeverity::HINT
      end
    end
  end
end

Version data entries

116 entries across 116 versions & 9 rubygems

Version Path
harbr-0.2.3 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.2.2 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.2.1 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.2.0 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.99 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.98 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.97 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.96 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.95 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.94 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.93 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.91 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.90 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.89 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.88 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.87 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.86 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.85 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.84 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.1.83 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb