I now that Smart Return is used for the return value of a method.
But I'm running into a problem because I would like to have the same thing on the return value of a instance method for my template. For example:
List<Application> listApplication = new List<Application>();
<<Smart Return>> = someInstance.SomeMethod(); //This method should return a List<Application>
The result would be:
listApplication = someInstance.SomeMethod();
The reason I need this besides it being very helpful in general, is because in my template I'm linking the return value in the method to the return value of the instance method I call with that method. For example:
#Method# Template
public <<Link(ReturnValue)>> MethodName()
{
<<Caret>><<FieldStart>><<Link(ReturnValue)>><<FieldEnd>><<BlockAnchor>> <<Link(ReturnValue,FormatParamName)>> = new <<Link(ReturnValue)>>;
<<Link(ReturnValue,FormatParamName)>> = SomeInstance.SomeMethod();
}
What happens when I do this Visual Studio screws up all the formating. So I have a work around for this by using a <<Target>>.
#ReturnValue# Template
<<Link(ReturnValue,FormatParamName)>> = SomeInstance.SomeMethod();
#Method Template#
public <<Link(ReturnValue)>> MethodName()
{
<<Caret>><<FieldStart>><<Link(ReturnValue)>><<FieldEnd>><<BlockAnchor>> <<Link(ReturnValue,FormatParamName)>> = new <<Link(ReturnValue)>>;
<<Target(#ReturnValue#)>>
}
This sovles the format problem, but it creates another problem that I can get the variable name of the return type. I have tried passing the name as a Variable using <<Set>> and <<Get>> but Variables don't seem to get passed with <<Target>>. My only other option is to have a real Smart Return or create a DXCore pluging, but I don't want to because I need to distribute this to other people.
Any other ideas?
Thanks,
Eric