Let's say I have a javascript function like this:
function SetActiveOrderPosition(orderId){
var activeOrder = { };
}
How can I write custom pattern to convert this function to:
SetActiveOrderPosition = function(orderId){
var activeOrder = { };
}
I need this because I am refactoring global functions into object level functions
Hello Marco
I'm afraid ReSharper's Structural Search and Replace doesn't support JavaScript yet. Thank you!
Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
"Develop with pleasure!"
You should be able to achieve this with Visual Studio's built-in Find & Replace, using Regular Expressions:
There's a reference for the perculiar Regex syntax that Visual Studio uses on MSDN:
http://msdn.microsoft.com/en-us/library/2k3te2cs(v=vs.100).aspx