Skip to content

Typed property arrow function expressions don't receive function scope #556

@dsifford

Description

@dsifford

TS and JS Grammar Extension version: latest stable release bundled with vscode.

Hi there. I'm not even sure fixing this is possible since this might require a lookahead of variable length.

Having said that, I noticed a difference in scopes between two identical pieces of code, with the exception of one of them has a type and the other doesn't.

Code

class Thing {
    foo: SomeFunc = () => void 0;
//  ^^^ meta.class.tsx meta.field.declaration.tsx meta.definition.property.tsx variable.object.property.tsx

    foo = () => void 0;
//  ^^^ meta.class.tsx meta.field.declaration.tsx meta.definition.property.tsx entity.name.function.tsx
}

Just tossing this out there in the event you weren't aware already. Thanks so much for your hard work on this!

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