Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Re: Template Variables in CDT

this are wrong templates for you, you were looking for code templates, like:

<templates>
<template name="for" description="%forLoop" context="org.eclipse.cdt.ui.text.templates.c" id="org.eclipse.cdt.ui.text.templates.c.for" enabled="true">for (${var} = 0; ${var} &lt; ${max}; ++${var}) {
	${line_selection}${cursor}
}</template>
...
</templates>

Elena Laskavaia wrote:
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.cdt.doc.isv/guide/projectTemplateEngine/exampletemplate.html

Matt Grosvenor wrote:

   Hi All,
   I have been messing about for a few days with the
   "org.eclipse.ui.editors.templates" extension point. I am trying to
   to create some custom template variables for use in the CDT that I
   think will be generally useful to everyone. I can do this flawlessly
   in the JDT but have yet to figure out how to make it happen in the
   CDT. Is there a way to make this happen or do I need to edit the CDT
   source directly? Where would I go to find the CDT source? I have
   hunted around the ecplise.org website and found very little. The
   online CVS viewer seems to have no CDT sources.

   This is what I have so far. If I repalce ???? with "java" the plugin
   works. But, I need the plugin to work in the CDT rather than the JDT.

   <?xml version="1.0" encoding="UTF-8"?>
   <?eclipse version="3.4"?>
   <plugin>
     <extension
point="org.eclipse.ui.editors.templates"> <resolver
                    class="xxxx"
                    contextTypeId="???"
                    description="xxxxx"
                    name="xxxx"
                    type="xxxx"
                />      </extension>
   </plugin>

   mattg

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top