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-2.8.1 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.2/lib/rubocop/lsp/severity.rb
rubocop-1.60.2 lib/rubocop/lsp/severity.rb
study_line-0.2.7 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/lsp/severity.rb
study_line-0.2.6 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/lsp/severity.rb
study_line-0.2.5 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/lsp/severity.rb
study_line-0.2.4 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/lsp/severity.rb
study_line-0.2.3 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/lsp/severity.rb
study_line-0.2.2 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/lsp/severity.rb
rubocop-1.60.1 lib/rubocop/lsp/severity.rb
study_line-0.2.1 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/lsp/severity.rb
study_line-0.2.0 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/lsp/severity.rb
rubocop-1.60.0 lib/rubocop/lsp/severity.rb
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.2.8 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.2.7 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.2.6 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.2.5 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb
harbr-0.2.4 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/lsp/severity.rb