oxc icon indicating copy to clipboard operation
oxc copied to clipboard

Incorrect `Span` on `BindingIdentifier`

Open DonIsaac opened this issue 6 months ago • 8 comments

Spans for binding identifiers cover the identifier itself and the type annotation on BindingPattern. This was introduced in #2624, and is blocking https://github.com/oxc-project/backlog/issues/84.

Expected Behavior

//    ___________ BindingPattern
const foo: number = 1
//    ^^^-------- TSTypeAnnotation
//    ^^^BindingIdentifier

Actual Behavior

//    ___________ BindingPattern and BindingIdentifier
const foo: number = 1
//       -------- TSTypeAnnotation

DonIsaac avatar Aug 07 '24 18:08 DonIsaac