tree-sitter / tree-sitter-typescript

TypeScript grammar for tree-sitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feature: Support auto-accessors syntax

creasty opened this issue · comments

Did you check the tree-sitter docs?

Is your feature request related to a problem? Please describe.

accessor keyword is not supported by the parser.

export class CalendarViewState {
  @observable accessor grid: GridState;
  @observable accessor rowGroups: RowGroupState[] = [];

  ...
}
...
      body: (class_body ; [7, 31] - [15, 1]
        (public_field_definition ; [8, 2] - [8, 38]
          decorator: (decorator ; [8, 2] - [8, 13]
            (identifier)) ; [8, 3] - [8, 13]
          name: (property_identifier) ; [8, 14] - [8, 22]
          (ERROR ; [8, 23] - [8, 27] <<<<<<<<<<<<<<<<<<<<<<<<<<
            (identifier)) ; [8, 23] - [8, 27]
          type: (type_annotation ; [8, 27] - [8, 38]
            (type_identifier))) ; [8, 29] - [8, 38]
        (public_field_definition ; [9, 2] - [9, 54]
          decorator: (decorator ; [9, 2] - [9, 13]
            (identifier)) ; [9, 3] - [9, 13]
          (ERROR ; [9, 14] - [9, 22] <<<<<<<<<<<<<<<<<<<<<<<<<<
            (identifier)) ; [9, 14] - [9, 22]
          name: (property_identifier) ; [9, 23] - [9, 32]
          type: (type_annotation ; [9, 32] - [9, 49]
            (array_type ; [9, 34] - [9, 49]
              (type_identifier))) ; [9, 34] - [9, 47]
          value: (array)) ; [9, 52] - [9, 54]
...

Describe the solution you'd like

Amend the grammar

Describe alternatives you've considered

nil

Additional context