class RubyLsp::ERBDocument::ERBScanner
def scan_char
def scan_char char = @source[@current_pos] case char when "<" if next_char == "%" @inside_ruby = true @current_pos += 1 push_char(" ") if next_char == "=" && @source[@current_pos + 2] == "=" @current_pos += 2 push_char(" ") elsif next_char == "=" || next_char == "-" @current_pos += 1 push_char(" ") end else push_char( char, #: as !nil ) end when "-" if @inside_ruby && next_char == "%" && @source[@current_pos + 2] == ">" @current_pos += 2 push_char(" ") @inside_ruby = false else push_char( char, #: as !nil ) end when "%" if @inside_ruby && next_char == ">" @inside_ruby = false @current_pos += 1 push_char(" ") else push_char( char, #: as !nil ) end when "\r" @ruby << char @host_language << char if next_char == "\n" @ruby << next_char @host_language << next_char @current_pos += 1 end when "\n" @ruby << char @host_language << char else push_char( char, #: as !nil ) end end