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/type_check.rb,
lib/solargraph/diagnostics/update_errors.rb,
lib/solargraph/diagnostics/rubocop_helpers.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: RubocopHelpers, Severities Classes: Base, RequireNotFound, Rubocop, TypeCheck, 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:



22
23
24
# File 'lib/solargraph/diagnostics.rb', line 22

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:



37
38
39
# File 'lib/solargraph/diagnostics.rb', line 37

def reporter name
  reporter_hash[name]
end

.reportersArray<String>

Get an array of reporter names.

Returns:



29
30
31
# File 'lib/solargraph/diagnostics.rb', line 29

def reporters
  reporter_hash.keys - ['type_not_defined'] # @todo Hide type_not_defined for now
end