Sha256: 45ae49ce1fafe0b13ec5ecbff0aab37d779f89d06be9e8543d0ccea5d33e2234
Contents?: true
Size: 1.56 KB
Versions: 7
Compression:
Stored size: 1.56 KB
Contents
module LanguageServer module Protocol module Interfaces class Diagnostic def initialize(range:, severity: nil, code: nil, source: nil, message:) @attributes = {} @attributes[:range] = range @attributes[:severity] = severity if severity @attributes[:code] = code if code @attributes[:source] = source if source @attributes[:message] = message @attributes.freeze end # # The range at which the message applies. # # @return [Range] def range attributes.fetch(:range) end # # The diagnostic's severity. Can be omitted. If omitted it is up to the # client to interpret diagnostics as error, warning, info or hint. # # @return [number] def severity attributes.fetch(:severity) end # # The diagnostic's code. Can be omitted. # # @return [string | number] def code attributes.fetch(:code) end # # A human-readable string describing the source of this # diagnostic, e.g. 'typescript' or 'super lint'. # # @return [string] def source attributes.fetch(:source) end # # The diagnostic's message. # # @return [string] def message attributes.fetch(:message) end attr_reader :attributes def to_json(*args) attributes.to_json(*args) end end end end end
Version data entries
7 entries across 7 versions & 2 rubygems