Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API to Semantic to remove unresolved references in bulk #5322

Open
overlookmotel opened this issue Aug 29, 2024 · 1 comment
Open

Add API to Semantic to remove unresolved references in bulk #5322

overlookmotel opened this issue Aug 29, 2024 · 1 comment
Assignees
Labels
A-transformer Area - Transformer / Transpiler

Comments

@overlookmotel
Copy link
Contributor

#5305 added ScopeTree::delete_root_unresolved_reference API to delete an unresolved reference.

@Dunqing said in #5305 (review):

Upon further reflection, I think we may also need to add a high-level API to remove unresolved_references. We usually may need to remove a whole expression or type_annotation, and we also need to figure out if the references are resolved or unresolved. It's painful to remove these 🙃

I agree with Dunqing that this API is needed. Opening this issue to discuss what it'd look like / how it'd work.

@overlookmotel overlookmotel added the A-transformer Area - Transformer / Transpiler label Aug 29, 2024
@overlookmotel overlookmotel changed the title Add API to Semantic to remove Add API to Semantic to remove unresolved references in bulk Aug 30, 2024
@Dunqing
Copy link
Member

Dunqing commented Oct 24, 2024

I have written a BindingMover to move all bindings to a specified scope here. I think we can take a similar way to remove symbol and reference
https://github.com/oxc-project/oxc/blob/410d5bb3c4bf2098f4f222659def3569fc715cc8/crates/oxc_transformer/src/es2017/async_to_generator.rs#L679-L703

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-transformer Area - Transformer / Transpiler
Projects
None yet
Development

No branches or pull requests

2 participants