You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let _ = DB::setv1
{
name : request.body.name
email : request.body.email
username : request.body.username
time : Date::now
coc : request.body.coc == "on"
}
request.body.email
Attendees
let query = "email=" ++ AWS::urlencode request.body.email
which reuses request.body.email three times. I want to extract request.body.email so the code is like this:
let email = request.body.email
let _ = DB::setv1
{
name : request.body.name
email : email
username : request.body.username
time : Date::now
coc : request.body.coc == "on"
}
email
Attendees
let query = "email=" ++ AWS::urlencode email
There exists a refactoring command extract-variable which will just create the let and replace it in the current position. This new command should replace request.body.email in all places that are in scope.
The text was updated successfully, but these errors were encountered:
Yes, very much so (that's what the good-early-bug tag is intended to convey 🙂 ).
You can copy the extract-variable code and modify it, and that should get you most of the way there (see the getting started guide for getting the basics of contributing!
I have code like this:
which reuses
request.body.email
three times. I want to extractrequest.body.email
so the code is like this:There exists a refactoring command
extract-variable
which will just create thelet
and replace it in the current position. This new command should replacerequest.body.email
in all places that are in scope.The text was updated successfully, but these errors were encountered: