lib/solargraph/diagnostics/rubocop.rb
# Convert a RuboCop offense to an LSP diagnostic
#
# @param off [Hash] Offense received from Rubocop
# @return [Hash] LSP diagnostic
Convert a RuboCop offense to an LSP diagnostic
Convert a RuboCop offense to an LSP diagnostic
def offense_to_diagnostic off
        {
          range: offense_range(off).to_hash,
          severity: SEVERITIES[off['severity']],
          source: off['cop_name'],
          message: off['message'].gsub(/^#{off['cop_name']}\:/, '')
        }
      end
def offense_to_diagnostic off { range : offense_range ( off ) . to_hash , severity : SEVERITIES [ off [ 'severity' ] ] , source : off [ 'cop_name' ] , message : off [ 'message' ] . gsub ( / ^ #{ off [ 'cop_name' ] } \: / , '' ) } end
Convert a RuboCop offense to an LSP diagnostic
Convert a RuboCop offense to an LSP diagnostic
# 1 = Error, 2 = Warning, 3 = Information, 4 = Hint
None
Hash
off
Offense received from Rubocop
Offense received from Rubocop