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.


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

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

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

Find a reporter by name.


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

def reporter name
  reporter_hash[name]
end

.reportersArray<String>

Get an array of reporter names.


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

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