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 visit key consume_space(want_preserve_whitespace: !@align_hash_keys) track_hash_key # Don't output `=>` for keys that are `label: value` # or `"label": value` if symbol || !(key[0] == :@label || key[0] == :dyna_symbol) consume_op "=>" consume_space(want_preserve_whitespace: !@align_hash_keys) end visit value end