sxzz / ast-explorer

AST Explorer: For most popular front-end languages and parsers.
https://ast.sxzz.moe
GNU Affero General Public License v3.0
105 stars 13 forks source link

Add tree-sitter / web-tree-sitter parser #25

Open 0xdevalias opened 7 months ago

0xdevalias commented 7 months ago

Clear and concise description of the problem

As a developer using ast-explorer, I want to be able to see the AST's parsed by tree-sitter / web-tree-sitter

Suggested solution

It would be really cool if AST Explorer was able to support 'Semantic' and/or 'Tree-Sitter':


Tree sitter's WASM distribution seems to be able to create an AST in browser:

npmjs.com/package/web-tree-sitter

Originally posted by @privatenumber in https://github.com/fkling/astexplorer/issues/622#issue-1087317072

See also:

Alternative

No response

Additional context

Validations

sxzz commented 7 months ago

I tried web-tree-sitter, but it seems like it cannot be loaded via CDN. There's a path error, which could be caused by tree-sitter itself, and it's even not an ESM module...

sxzz commented 7 months ago

About semantic, it cannot run on browsers, I guess.

0xdevalias commented 7 months ago

True true; that sucks :(