Can Live Template Write Code Into Specific #regions?

Is it possible to configure Live Templates such that they expand into specific #regions? For example, I have defined a Live Template like this:

#region Private Fields

private $TYPE$ _$FIELD$;

#endregion

#region Public Fields

public $TYPE$ $NAME$
{
    get
    {
        return _$FIELD$;
    }
    set
    {
        if (_$FIELD$ != value)
        {
            _$FIELD$ = value;
            NotifyPropertyChanged("$NAME$");
        }
    }
}

#endregion

What I would like to achieve is that if the regions named "Private Fields" and "Public Fields" already exist, expanding this Live Template adds the code to the already existing regions instead of creating new regions. E.g. if I expand the Live Template twice, the resulting code should look like this:

#region Private Fields

private double _left;
private double _top;

#endregion

#region Public Fields

public double Left
{
    get { return _left; }
    set
    {
        if (_left != value)
        {
            _left = value;
            NotifyPropertyChanged("Left");
        }
    }
}

public double Top
{
    get { return _top; }
    set
    {
        if (_top != value)
        {
            _top = value;
            NotifyPropertyChanged("Top");
        }
    }
}

#endregion

Is that possible?

- Frank

2 comments
Comment actions Permalink

Hello
     I'm afraid this is not possible at the moment. You're welcome to put a feature request through http://youtrack.jetbrains.net/issues/RSRP. Thank you!

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

0
Comment actions Permalink

I have created the following feature request in the issue tracker:

    http://youtrack.jetbrains.com/issue/RSRP-288637

Regards
- Frank

0

Please sign in to leave a comment.