Skip to content

Report candidates on closing list terminators #34871

@DanielRosenwasser

Description

@DanielRosenwasser

From @robpalme: https://twitter.com/robpalmer2/status/1190383568612184064

function base_init() {
{
    
}

    function me() {
    
}

https://www.typescriptlang.org/play/?ssl=8&ssc=1&pln=9&pc=1#code/GYVwdgxgLglg9mABAIwIYGcCmB9GYZQAUAlIgN4BQliNiFAvhRbYqJLAogLaYnnO0GFIA

Motivation

When an ending curly brace (or similar) is missing, we can give some better hints to the user.

In some cases, this might be because a stray } throws parsing off.

Suggestion

It would be very cool to explain a possible reason that the user is getting a '}' expected error:

}
~
This '}' occurs at the same indentation level, but corresponds to a different brace.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions