Pattern Catalog to convert string to lambda Follow
I'm trying to convert statements like
BindToText(nameTextEdit, instanceModel.EditItem, "Name");
to
nameTextEdit.BindToText(instanceModel.EditItem, x=>x.Name);
I can write a pattern that will find the first and convert it to
nameTextEdit.BindToText(instanceModel.EditItem, "Name");
but the rest eludes me. Specifying an ID placeholder and enclosing it in quotes doesn't work. I'd settle for
nameTextEdit.BindToText(instanceModel.EditItem, x => x."Name");
using an expression of type string, but that doesn't work either. Any suggestions?
Please sign in to leave a comment.
FWIW, there's an issue about this: http://youtrack.jetbrains.net/issue/RSRP-183035 "Structural search and replace: Cannot perform replacement for identifier when using quotes around identifier in replace pattern."
Thanks! I added my vote for that issue.