class Ameba::Formatter::ExplainFormatter

Overview

A formatter that shows the detailed explanation of the issue at a specific location.

Included Modules

Defined in:

ameba/formatter/explain_formatter.cr

Constant Summary

HEADING = "## "
LINE_BREAK = "\n"
PREFIX = " "

Constructors

Instance Method Summary

Instance methods inherited from module Ameba::Formatter::Util

affected_code(source, location, max_length = 100, placeholder = " ...", prompt = "> ") affected_code

Constructor Detail

def self.new(output, loc) #

Creates a new instance of ExplainFormatter. Accepts output which indicates the io where the explanation will be wrtitten to. Second argument is location which indicates the location to explain.

ExplainFormatter.new output,
  {file: path, line: line_number, column: column_number}

[View source]

Instance Method Detail

def finished(sources) #

Reports the explainations at the @location.


[View source]
def location : Crystal::Location #

[View source]
def output : IO::FileDescriptor | IO::Memory #

[View source]