cucumber / language-service

Cucumber Language Service
MIT License
12 stars 21 forks source link

Is Treesitter Overkill for Our Requirements? #182

Open binhtran432k opened 3 months ago

binhtran432k commented 3 months ago

🤔 What's the problem you've observed?

While Treesitter offers certain parsing capabilities, its current stage of development can introduce challenges that may outweigh its benefits for our specific needs. Notably, the significant size of its WASM parsers (~90% of the language service bundle) seems redundant considering our primary need is simply extracting text strings (easily achievable with Javascript regex).

✨ Do you have a proposal for making it better?

I suggest that we use a simple regex solution, such as VSCucumberAutoComplete. Alternatively, we can explore other parser generators like peg.js, langium, lezer (treesitter-like in pure JavaScript), etc.

📚 Any additional context?

This solution addresses nearly all issues associated with Treesitter, including those related to non-functionality in Node versions 19 and above.


This text was originally generated from a template, then edited by hand. You can modify the template here.

helgardferreira commented 1 month ago

Yeah, with the current tree-sitter parsing setup, the language service is falling short of VSCucumberAutoComplete unfortunately.

I'm not sure if it's the version that this project is using, or what exactly, but the parsing isn't even matching with the tree-sitter playground currently. For instance, try parsing a typescript file that uses class decorators and you'll see the parser fail arbitrarily.