class RubyLsp::ERBDocument

def parse!

: -> bool
@override
def parse!
  return false unless @needs_parsing
  @needs_parsing = false
  scanner = ERBScanner.new(@source)
  scanner.scan
  @host_language_source = scanner.host_language
  # Use partial script to avoid syntax errors in ERB files where keywords may be used without the full context in
  # which they will be evaluated
  @parse_result = Prism.parse_lex(scanner.ruby, partial_script: true)
  @code_units_cache = @parse_result.code_units_cache(@encoding)
  true
end