denoland / deno_ast

Source text parsing, lexing, and AST related functionality for Deno

Home Page:https://crates.io/crates/deno_ast

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add option to apply swc `ts_resolver` on parse

dsherret opened this issue · comments

We should move in this code from deno_lint to this crate so it can be used in the deno lsp. I'm not sure exactly what that entails...

https://github.com/denoland/deno_lint/blob/7825cb95115bfdffc62c076c8f458b3424f7190c/src/ast_parser.rs#L114

Once this is done, we should open up a PR in deno to reuse the ast for linting.

We need to double check if this change won't have impact on other tools. CC @kdy1 can you advise?

It will not affect other tools if they don't use span hygiene to distinguish identifiers.
I don't expect applying ts_resolver twice to break code, because it ignores identifiers with a non-empty syntax context.