Subject: bug#16811: 24.3.50; [ruby-mode] Implicit hash indentation bug

From: Dmitry Gutov <[email-masked]>
Date: Thu, 20 Feb 2014 08:22:08 +0200

Bozhidar Batsov <[email-masked]> writes:

> Should be:
>
> method('HashSyntax' => {
>          'EnforcedStyle'   => 'ruby19',
>          'SupportedStyles' => %w(ruby19 hash_rockets)
>        },
>        'SpaceAroundOperators' => { 'Enabled' => true })
>
> The fact that the hash is implicit (lacking {}) seems to mess with the
> indentation logic.

Not really. The corresponding example with explicit hash would be

{'HashSyntax' => {
                  'EnforcedStyle'   => 'ruby19',
                  'SupportedStyles' => %w(ruby19 hash_rockets)
                },
 'SpaceAroundOperators' => {
   'Enabled' => true }}

and it has the same problem.

The problem seems to be that (let (smie--parent) (smie-indent--parent))
called between "=>" and "{" doesn't stop at "=>", but goes straight to
the parent "{".

Not sure how to fix that best with the current grammar. Stefan?