Module: LiveEditing::ProcessFileChanged

Extended by:
ProcessFileChanged
Included in:
ProcessFileChanged
Defined in:
lib/holistic/ruby/parser/live_editing/process_file_changed.rb

Instance Method Summary collapse

Instance Method Details

#call(application:, file_path:, content:) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/holistic/ruby/parser/live_editing/process_file_changed.rb', line 7

def call(application:, file_path:, content:)
  # TODO: do not build the AST twice
  return unless HasValidSyntax[content]

  references_to_recalculate = identify_references_to_recalculate(application:, file_path:)

  delete_scopes_in_file(application:, file_path:)
  delete_references_in_file(application:, file_path:)

  parse_again(application:, file_path:, content:)

  recalculate_type_inference(application:, references: references_to_recalculate)
end