How to use templates...

18 views
Skip to first unread message

Krist van Besien

unread,
Feb 14, 2015, 4:49:36 AM2/14/15
to puppet-...@googlegroups.com
hi all,

I have some issues using templates. I wanted to add a template to add the standard boilerplate that goes at the top of each manifest file. However I am not having any success.

I went in to "preference - puppet - pp - templates" and added a template. Gave it a name, set the context to "PuppetManifest" and added a pattern.
Now , according to the eclipse docs when I press "ctrl - space" I should be presented with a list of templates, and this should be on this list. 
However, it isn't. I can't seem to find a way how to use this.
Both these actions do not have the result I expect:
- Typing the first few letters, or the full name I gave to the template, then ctrl+space 
- Selecting a word, and then doing ctrl+space 

In both cases I just et a list with some items ($, if, class etc...) that I can select from. Not my template however.

What am I doing wrong?

Krist

Henrik Lindberg

unread,
Feb 15, 2015, 7:46:51 PM2/15/15
to puppet-...@googlegroups.com
It is very difficult to figure out what the contexts in the long list
really are and when the editor is in one of those contexts. (There is a
ticket to simplify this and only use a single context). To figure out
which context is which requires reading the actual grammar.

You can use the ExpressionList - which is the context anywhere where
statements can occur. I tried that, and the template then shows up last
in the list of suggests. (yes, there is room for improvment). And the
"automatically insert" option does not work either.

I also tried with the "ImportExpression" which also works.

It is far from perfect, but hope that works for you.

Regards
- henrik

> Krist
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Geppetto" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
> puppet-geppet...@googlegroups.com
> <mailto:puppet-geppet...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Reply all
Reply to author
Forward
0 new messages