Skip to content

Formatting using statements in explicit blocks #763

@RobertCraigie

Description

@RobertCraigie

imo it'd be quite cool if there was a way to format using statements like this

const proc = await glide.process.spawn("cat");

{await using writer = proc.stdin.get_writer();
  await writer.write("first\n");
  await writer.write("second\n");
  await writer.write("third");
}

const text = await proc.stdout.text();

compared to the default formatting that currently looks like this

{
  await using writer = proc.stdin.get_writer();
  await writer.write("first\n");
  await writer.write("second\n");
  await writer.write("third");
}

where there's less of a visual distinction between the "important" part of the block, the using statement, and the rest of the block.

note: I'm unsure if there's already been discussion about special formatting for using in other places.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions