[Live Template] Create parameter for existing constructor

Answered

 

Is it possible to create "Live Template" for a parameter which would be initialized in existing constructor?

Something like this:

Live Template

// CLASSNAME => Current file name without extension
// NameOfParameter => Suggest name for variable
public readonly POElement<$CLASSNAME$> $NameOfParameter$;

// This is existing contractor which I don't know how to write in template 
// that it didn't create new but searched for existing 
public $CLASS$(IWebDriver driver) : base(driver)
{
    $NameOfParameter$ = new POElement<$CLASSNAME$>(By.$LocatorType$($LOCATOR_PATH$), this);

    // It should not remove existing parameters
}

Thanks for spending your time and reading this :)

1 comment
Comment actions Permalink
Official comment

Hello Yurii!

 

Thank you for contacting us.

There's no such option currently. I've filed corresponding feature request on our issue tracker - https://youtrack.jetbrains.com/issue/RSRP-465509

You are welcome to comment or vote for it.

Thank you.

Please sign in to leave a comment.