Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_js_analyze): inline variable considering initializer #3777

Merged
merged 2 commits into from
Nov 17, 2022

Conversation

xunilrj
Copy link
Contributor

@xunilrj xunilrj commented Nov 17, 2022

Summary

Fixes #3697.
Better together with #3740.

This PR increments the code action "inline variable" considering the type of the initializer.
There is a chance that we may want to revisit this in the future, because some expressions do not make sense to be inlined. Example:

const a = (1, (x) => {}, true);

Don't know why someone would write this, but this sure do not make sense to be inlined.

Test Plan

> cargo test -p rome_js_analyze -- inline_variable

@xunilrj xunilrj requested a review from a team November 17, 2022 11:46
@netlify
Copy link

netlify bot commented Nov 17, 2022

Deploy Preview for docs-rometools canceled.

Name Link
🔨 Latest commit 1081e53
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/63761fbf94b04d0007f297e2

@github-actions
Copy link

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 45879 45879 0
Passed 44936 44936 0
Failed 943 943 0
Panics 0 0 0
Coverage 97.94% 97.94% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 39 39 0
Passed 36 36 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.31% 92.31% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5946 5946 0
Passed 1621 1621 0
Failed 4325 4325 0
Panics 0 0 0
Coverage 27.26% 27.26% 0.00%

ts/babel

Test result main count This PR count Difference
Total 588 588 0
Passed 519 519 0
Failed 69 69 0
Panics 0 0 0
Coverage 88.27% 88.27% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16257 16257 0
Passed 12397 12397 0
Failed 3860 3860 0
Panics 0 0 0
Coverage 76.26% 76.26% 0.00%

@xunilrj xunilrj merged commit 41f1764 into main Nov 17, 2022
@xunilrj xunilrj deleted the feature/inline-var-considering-initializer branch November 17, 2022 18:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Rome VSCode extension crashes for closure function passing itself as an argument
2 participants