-
-
Notifications
You must be signed in to change notification settings - Fork 809
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
Extract const code action #3936
Comments
I'm taking a look at this. I'm guessing this should also perform these kinds of conversions? Before: pub fn main() {
let l = ["A", "B", "C"]
list.map(l, run)
} After extracting whole composite type (as long as the contents are all literals): const l = ["A", "B", "C"]
pub fn main() {
list.map(l, run)
} Or after extracting by individual literals: const string = "A"
pub fn main() {
let l = [string, "B", "C"]
list.map(l, run)
} |
Yeah!! |
WIP @ #4228
Next steps
|
If you'd like to PR just a subset of expressions to start that would be good by me! |
Sounds great. I've cleaned it up and put it here #4228 |
I believe this can be closed now, as the relevant PR has been merged |
An action that extracts a highlighted value and replaces it with a const
The text was updated successfully, but these errors were encountered: