class TypeProf::Diagnostic
Constants
- SEVERITY
- TAG
Attributes
Public Class Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/diagnostic.rb, line 3 def initialize(node, meth, msg, tags: nil) @node = node @meth = meth @msg = msg @tags = tags end
Public Instance Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/diagnostic.rb, line 16 def code_range @node.send(@meth) end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/diagnostic.rb, line 10 def reuse(new_node) @node = new_node end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/diagnostic.rb, line 23 def to_lsp(severity: :error) json = { range: code_range.to_lsp, source: "TypeProf", message: @msg, } json[:severity] = SEVERITY[severity] json[:tags] = @tags.map {|tag| TAG[tag] } if @tags json end