Skip to content

autoformat issue: => in a function call aligned with => in a different function call #161

@lelutin

Description

@lelutin

The autoformat function is apparently going beyond the boundaries of the hash inside the function call and aligns things across different function calls. This is wrong and it shouldn't happen.

simplest reproducer:

longer_function_name('some value', 'some other value', { 'blah' => 'moo' })      
ensure_resource('file', '/something', { 'ensure' => 'file' }) 

with the cursor placed on the => (or anywhere inside that hash), press gqi} to trigger autoalignment.

The result is the following:

longer_function_name('some value', 'some other value', { 'blah' => 'moo' })      
ensure_resource('file', '/something', { 'ensure'                => 'file' })

the autoformat function should stop processing at the {} boundaries, at least for hashrocket alignment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions