Skip to content

Add pipe to autoClosingPairs #19682

@unusual-thoughts

Description

@unusual-thoughts

I keep finding myself expecting the | token to auto-close in VS code when writing closures, as it does with brackets, parentheses etc.

It is especially grating because as long as the closing pipe is dangling, syntax doesn't parse at all and editor output can be flooded with transient errors.

As noted in #11192 , the potential downside is for bitwise OR (and match pattern unions), but I would argue that is much less common and offset by the IMO much bigger benefit with respect to closures. Surprisingly, | was previously in surroundingPairs (causing undesired behavior) but never in autoClosingPairs.

As for (lazy) logical ORs, if you press pipe twice you will get the same thing, so there is no downside.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions