Class: MilkTea::Diagnostic
- Inherits:
-
Data
- Object
- Data
- MilkTea::Diagnostic
- Defined in:
- lib/milk_tea/base.rb
Overview
Unified diagnostic value shared by the linter, sema, and all ControlFlow analyses. severity: :error | :warning | :hint | :info
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#symbol_name ⇒ Object
readonly
Returns the value of attribute symbol_name.
Instance Method Summary collapse
- #error? ⇒ Boolean
- #hint? ⇒ Boolean
- #info? ⇒ Boolean
-
#initialize(path:, line:, column: nil, length: nil, code:, message:, severity: :warning, symbol_name: nil) ⇒ Diagnostic
constructor
A new instance of Diagnostic.
- #warning? ⇒ Boolean
Constructor Details
#initialize(path:, line:, column: nil, length: nil, code:, message:, severity: :warning, symbol_name: nil) ⇒ Diagnostic
Returns a new instance of Diagnostic.
47 |
# File 'lib/milk_tea/base.rb', line 47 def initialize(path:, line:, column: nil, length: nil, code:, message:, severity: :warning, symbol_name: nil) = super |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code
46 47 48 |
# File 'lib/milk_tea/base.rb', line 46 def code @code end |
#column ⇒ Object (readonly)
Returns the value of attribute column
46 47 48 |
# File 'lib/milk_tea/base.rb', line 46 def column @column end |
#length ⇒ Object (readonly)
Returns the value of attribute length
46 47 48 |
# File 'lib/milk_tea/base.rb', line 46 def length @length end |
#line ⇒ Object (readonly)
Returns the value of attribute line
46 47 48 |
# File 'lib/milk_tea/base.rb', line 46 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message
46 47 48 |
# File 'lib/milk_tea/base.rb', line 46 def @message end |
#path ⇒ Object (readonly)
Returns the value of attribute path
46 47 48 |
# File 'lib/milk_tea/base.rb', line 46 def path @path end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity
46 47 48 |
# File 'lib/milk_tea/base.rb', line 46 def severity @severity end |
#symbol_name ⇒ Object (readonly)
Returns the value of attribute symbol_name
46 47 48 |
# File 'lib/milk_tea/base.rb', line 46 def symbol_name @symbol_name end |
Instance Method Details
#error? ⇒ Boolean
49 |
# File 'lib/milk_tea/base.rb', line 49 def error? = severity == :error |
#hint? ⇒ Boolean
51 |
# File 'lib/milk_tea/base.rb', line 51 def hint? = severity == :hint |
#info? ⇒ Boolean
52 |
# File 'lib/milk_tea/base.rb', line 52 def info? = severity == :info |
#warning? ⇒ Boolean
50 |
# File 'lib/milk_tea/base.rb', line 50 def warning? = severity == :warning |