tree-sitter / tree-sitter-typescript

TypeScript grammar for tree-sitter
MIT License
332 stars 103 forks source link

bug: Inconsistent results between WASM and local parsing #280

Closed konsalex closed 4 hours ago

konsalex commented 4 months ago

Did you check existing issues?

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

tree-sitter 0.20.9

Describe the bug

Currently there is a mismatch between the local parsing using tree-sitter-typescript and using the online playground.

File I am testing can be found here.

The local version give me an error, with an exit code 1, while online playground works as expected.

(ERROR [0, 0] - [2658, 0]
  (comment [0, 0] - [6, 3])
  (import_statement [7, 0] - [7, 95]
    (import_clause [7, 7] - [7, 67]
      (named_imports [7, 7] - [7, 67]
        (import_specifier [7, 8] - [7, 15]
          name: (identifier [7, 8] - [7, 15]))
        (import_specifier [7, 17] - [7, 31]
          name: (identifier [7, 17] - [7, 31]))
        (import_specifier [7, 33] - [7, 38]
.......

Steps To Reproduce/Bad Parse Tree

  1. Parse this file locally with tree-sitter parse '....angular/packages/core/test/acceptance/integration_spec.ts'
  2. Parse this file inside the playground

Expected Behavior/Parse Tree

Get parsed like in the playground

Repro

// Cannot add one: `There was an error creating your issue: body is too long (maximum is 65536 characters).`

Just use the links added above
amaanq commented 4 hours ago

I think it's fixed locally, I cannot reproduce now. Ensure you use the latest version of the cli + grammar, and if you still see the issue let me know, thanks