file-templates icon indicating copy to clipboard operation
file-templates copied to clipboard

Petition Placeholder

Open obelich opened this issue 10 years ago • 8 comments

Hiyas i like this addon but it need a placeholder to add code when is used the template like snippets using ${1:NameHolder} thanks :)

obelich avatar Sep 25 '15 17:09 obelich

Yes, it's useful, and I also need prerepalce ${author},which defined at settings file。Thanks

nealsun avatar Oct 12 '15 13:10 nealsun

+1~~~

findfly618 avatar Oct 22 '15 05:10 findfly618

I need ${datetime_now} place holder

twz915 avatar Nov 05 '15 01:11 twz915

If shortcuts are available to open special template is awesome, such as CMD + SHIFT + P to open php.tmpl, CONTROL + ALT + R to open ruby.tmpl

twz915 avatar Nov 05 '15 01:11 twz915

I will look into this shortly.

Are we thinking it best to have:

  • named placeholders that correspond to some variable or function
  • numbered placeholders for easy tabbing

Arcath avatar Nov 05 '15 10:11 Arcath

I'm not sure this is what you mean by numbered placeholders, but prompting to replace $n when creating a file would be amazingly useful already for me:

class $1 {
private:
public:
    $1();
    ~$1();
};

but if I could get a prompt asking "What should I replace ClassName with?" it could lead to more interesting templates. And would give them a little more sense too:

class ${ClassName} {
private:
public:
    ${ClassName}();
    ~${ClassName}();
};

Honestly, I vote for the second option, but wouldn't mind getting the first one.

DonRyuDragoni avatar Nov 10 '15 18:11 DonRyuDragoni

The second option makes more sense to me.

I am aiming for it to popup during create with inputs for all your placeholders like you suggest. Its just getting time at the moment to work on it.

Arcath avatar Nov 26 '15 15:11 Arcath

this feature would become another reason for me to leave webstorm once and for all.

tusharmath avatar Jan 28 '16 05:01 tusharmath