class Rufo::Formatter
def visit_hash_key_value(node)
def visit_hash_key_value(node) # key => value # # [:assoc_new, key, value] _, key, value = node # If a symbol comes it means it's something like # `:foo => 1` or `:"foo" => 1` and a `=>` # always follows symbol = current_token_kind == :on_symbeg arrow = symbol || !(key[0] == :@label || key[0] == :dyna_symbol) visit key consume_one_dynamic_space @spaces_around_hash_arrow track_hash_key # Don't output `=>` for keys that are `label: value` # or `"label": value` if arrow consume_op "=>" consume_one_dynamic_space @spaces_around_hash_arrow, force_one: @align_hash_keys end visit value end