Method: PlatformosCheck::LanguageServer::DiagnosticsManager#initialize

Defined in:
lib/platformos_check/language_server/diagnostics_manager.rb

#initializeDiagnosticsManager

This class exists to facilitate LanguageServer diagnostics tracking.

Motivations:

1. The first time we lint, we want all the errors from all the files.
2. If we fix all the errors in a file, we have to send an empty array for that file.
3. If we do a partial check, we should consider the whole platformos_app diagnostics as valid, and return cached results
4. We should be able to create WorkspaceEdits from diagnostics, so that the ExecuteCommandEngine can do its job
5. We should clean up diagnostics that were applied by the client


21
22
23
24
25
# File 'lib/platformos_check/language_server/diagnostics_manager.rb', line 21

def initialize
  @latest_diagnostics = {} # { [Pathname(relative_path)] => Diagnostic[] }
  @mutex = Mutex.new
  @first_run = true
end