Class: ThemeCheck::LanguageServer::RunChecksExecuteCommandProvider

Inherits:
ExecuteCommandProvider show all
Includes:
URIHelper
Defined in:
lib/theme_check/language_server/execute_command_providers/run_checks_execute_command_provider.rb

Instance Method Summary collapse

Methods included from URIHelper

#file_path, #file_uri

Methods inherited from ExecuteCommandProvider

all, command, #command, inherited

Constructor Details

#initialize(diagnostics_engine, storage, linter_config, language_server_config) ⇒ RunChecksExecuteCommandProvider

Returns a new instance of RunChecksExecuteCommandProvider.



10
11
12
13
14
15
# File 'lib/theme_check/language_server/execute_command_providers/run_checks_execute_command_provider.rb', line 10

def initialize(diagnostics_engine, storage, linter_config, language_server_config)
  @diagnostics_engine = diagnostics_engine
  @storage = storage
  @linter_config = linter_config
  @language_server_config = language_server_config
end

Instance Method Details

#execute(_args) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/theme_check/language_server/execute_command_providers/run_checks_execute_command_provider.rb', line 17

def execute(_args)
  @diagnostics_engine.analyze_and_send_offenses(
    @storage.opened_files.map { |relative_path| @storage.path(relative_path) },
    @linter_config,
    only_single_file: @language_server_config.only_single_file?,
    force: true
  )
  nil
end