Module: Solargraph::Diagnostics

Defined in:
lib/solargraph/diagnostics.rb,
lib/solargraph/diagnostics/base.rb,
lib/solargraph/diagnostics/rubocop.rb,
lib/solargraph/diagnostics/severities.rb,
lib/solargraph/diagnostics/update_errors.rb,
lib/solargraph/diagnostics/type_not_defined.rb,
lib/solargraph/diagnostics/require_not_found.rb

Overview

The Diagnostics library provides reporters for analyzing problems in code and providing the results to language server clients.

Defined Under Namespace

Modules: Severities Classes: Base, RequireNotFound, Rubocop, TypeNotDefined, UpdateErrors

Class Method Summary collapse

Class Method Details

.register(name, klass) ⇒ void

This method returns an undefined value.

Add a reporter with a name to identify it in .solargraph.yml files.

Parameters:



19
20
21
# File 'lib/solargraph/diagnostics.rb', line 19

def register name, klass
  reporter_hash[name] = klass
end

.reporter(name) ⇒ Class<Solargraph::Diagnostics::Base>

Find a reporter by name.

Parameters:

  • name (String)

    The name with which the reporter was registered

Returns:



34
35
36
# File 'lib/solargraph/diagnostics.rb', line 34

def reporter name
  reporter_hash[name]
end

.reportersArray<String>

Get an array of reporter names.

Returns:

  • (Array<String>)


26
27
28
# File 'lib/solargraph/diagnostics.rb', line 26

def reporters
  reporter_hash.keys
end