Spec-Zone.ru › Homebrew

Class: Parser::Diagnostic

Inherits:
Object
  • Object
  • Parser::Diagnostic
show all
Defined in:
sorbet/rbi/parser@3.3.8.0.rbi

Overview

source://parser//lib/parser/diagnostic.rb#31

Defined Under Namespace

Classes: Engine

Constant Summary collapse

LEVELS =

Collection of the available diagnostic levels.

source://parser//lib/parser/diagnostic.rb#37

Returns:

  • (Array)
T.let(T.unsafe(nil), Array)

Instance Method Summary collapse

  • #arguments ⇒ Symbol

    source://parser//lib/parser/diagnostic.rb#39.

  • #highlights ⇒ Array<Parser::Source::Range>

    Supplementary error-related source ranges.

  • #initialize(level, reason, arguments, location, highlights = T.unsafe(nil)) ⇒ Diagnostic constructor

    source://parser//lib/parser/diagnostic.rb#49.

  • #level ⇒ Symbol

    source://parser//lib/parser/diagnostic.rb#39.

  • #location ⇒ Parser::Source::Range

    Main error-related source range.

  • #message ⇒ String

    source://parser//lib/parser/diagnostic.rb#69.

  • #reason ⇒ Symbol

    source://parser//lib/parser/diagnostic.rb#39.

  • #render ⇒ Array<String>

    Renders the diagnostic message as a clang-like diagnostic.

Constructor Details

#initialize(level, reason, arguments, location, highlights = T.unsafe(nil)) ⇒ Diagnostic

source://parser//lib/parser/diagnostic.rb#49

Parameters:

  • level (Symbol)
  • reason (Symbol)
  • arguments (Hash)
  • location (Parser::Source::Range)
  • highlights (Array<Parser::Source::Range>) (defaults to: T.unsafe(nil))


1720
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 1720

def initialize(level, reason, arguments, location, highlights = T.unsafe(nil)); end

Instance Method Details

#arguments ⇒ Symbol

source://parser//lib/parser/diagnostic.rb#39

Returns:

  • (Symbol) —

    extended arguments that describe the error

See Also:

  • MESSAGES


1727
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 1727

def arguments; end

#highlights ⇒ Array<Parser::Source::Range>

Supplementary error-related source ranges.

source://parser//lib/parser/diagnostic.rb#40

Returns:

  • (Array<Parser::Source::Range>)


1735
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 1735

def highlights; end

#level ⇒ Symbol

source://parser//lib/parser/diagnostic.rb#39

Returns:

  • (Symbol) —

    diagnostic level

See Also:

  • LEVELS


1742
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 1742

def level; end

#location ⇒ Parser::Source::Range

Main error-related source range.

source://parser//lib/parser/diagnostic.rb#40

Returns:

  • (Parser::Source::Range)


1750
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 1750

def location; end

#message ⇒ String

source://parser//lib/parser/diagnostic.rb#69

Returns:

  • (String) —

    the rendered message.



1756
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 1756

def message; end

#reason ⇒ Symbol

source://parser//lib/parser/diagnostic.rb#39

Returns:

  • (Symbol) —

    reason for error

See Also:

  • MESSAGES


1763
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 1763

def reason; end

#render ⇒ Array<String>

Renders the diagnostic message as a clang-like diagnostic.

source://parser//lib/parser/diagnostic.rb#86

Examples:

diagnostic.render # =>
# [
#   "(fragment:0):1:5: error: unexpected token $end",
#   "foo +",
#   "    ^"
# ]

Returns:

  • (Array<String>)


1778
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 1778

def render; end

© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.
https://docs.brew.sh/rubydoc/Parser/Diagnostic.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API