Class: TypeProf::Diagnostic
- Inherits:
-
Object
- Object
- TypeProf::Diagnostic
- Defined in:
- lib/typeprof/diagnostic.rb
Constant Summary collapse
- SEVERITY =
{ error: 1, warning: 2, info: 3, hint: 4 }
- TAG =
{ unnecessary: 1, deprecated: 2 }
Instance Attribute Summary collapse
-
#msg ⇒ Object
readonly
Returns the value of attribute msg.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
Instance Method Summary collapse
- #code_range ⇒ Object
-
#initialize(node, meth, msg) ⇒ Diagnostic
constructor
A new instance of Diagnostic.
- #reuse(new_node) ⇒ Object
- #to_lsp ⇒ Object
Constructor Details
#initialize(node, meth, msg) ⇒ Diagnostic
Returns a new instance of Diagnostic.
3 4 5 6 7 8 9 |
# File 'lib/typeprof/diagnostic.rb', line 3 def initialize(node, meth, msg) @node = node @meth = meth @msg = msg @severity = :error # TODO: keyword argument @tags = nil # TODO: keyword argument end |
Instance Attribute Details
#msg ⇒ Object (readonly)
Returns the value of attribute msg.
15 16 17 |
# File 'lib/typeprof/diagnostic.rb', line 15 def msg @msg end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity.
15 16 17 |
# File 'lib/typeprof/diagnostic.rb', line 15 def severity @severity end |
Instance Method Details
#code_range ⇒ Object
17 18 19 |
# File 'lib/typeprof/diagnostic.rb', line 17 def code_range @node.send(@meth) end |
#reuse(new_node) ⇒ Object
11 12 13 |
# File 'lib/typeprof/diagnostic.rb', line 11 def reuse(new_node) @node = new_node end |