123456789_123456789_123456789_123456789_123456789_

Class: RuboCop::AST::PrismDiagnostic

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Parser::Diagnostic
Defined in: lib/rubocop/ast/prism_parser.rb

Overview

A syntax error or a warning that parser has no message for, reported with the message of Prism.

Constant Summary

::Parser::Diagnostic - Inherited

LEVELS

Class Method Summary

Instance Attribute Summary

::Parser::Diagnostic - Inherited

#arguments,
#highlights

Supplementary error-related source ranges.

#level,
#location

Main error-related source range.

#message, #reason

Instance Method Summary

::Parser::Diagnostic - Inherited

#render

Renders the diagnostic message as a clang-like diagnostic.

#first_line_only

If necessary, shrink a Range so as to include only the first line.

#last_line_only

If necessary, shrink a Range so as to include only the last line.

#render_line

Renders one source line in clang diagnostic style, with highlights.

Constructor Details

.new(message, level, reason, location) ⇒ PrismDiagnostic

[ GitHub ]

  
# File 'lib/rubocop/ast/prism_parser.rb', line 10

def initialize(message, level, reason, location)
  @message = message
  super(level, reason, {}, location, [])
end

Instance Attribute Details

#message (readonly)

[ GitHub ]

  
# File 'lib/rubocop/ast/prism_parser.rb', line 8

attr_reader :message