Live Template Order of Variable Completion

If a variable appears twice in a live template is there a way to fill in the second copy of the variable before the first. Or else have the first version of the variable copy what gets entered in the second?

Example live template:

import * as $module$ from 'N/$module$'

I would like to be able to fill in the second $module$ before the first because I get completion on the second $module$ through Typsecript, which I do not get on the first $module$ variable.

0
2 comments

Hi there,

Use 2 variables.

import * as $moduleName$ from 'N/$module$'

Then:

  • Set the desired order in which they should be processed (rearrange them -- 2nd one should be filled first)
  • Assign the value of $module$ variable to $moduleName$

This way they both will have the same text in the end while you fill it only once.

More with pics: http://stackoverflow.com/a/41634968/783119

2
Avatar
Permanently deleted user

Great, that's what I'm looking for. Didn't know I could set the default value of one variable to another. Thanks.

0

Please sign in to leave a comment.