Discussion:
How to use templates...
Krist van Besien
2015-02-14 09:49:36 UTC
Permalink
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
--
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-geppetto+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Henrik Lindberg
2015-02-16 00:46:41 UTC
Permalink
Post by Krist van Besien
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.
- 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?
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
Post by Krist van Besien
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
For more options, visit https://groups.google.com/d/optout.
--
Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/
--
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-geppetto+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...