Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The editor template should be in an XML format. The top-level XML node should be a <templates> node, with <template> nodes as children.

Here is an example of an editor template with a single entry:

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<template autoinsert="true" context="com.aptana.ide.editors.contextType.text/javascript" deleted="false" description="Function" enabled="true" 
        id="com.aptana.ide.editors.js.templates.function.tm" name="fun">function ${name} (${args}) {
	${cursor}
}</template>
</templates>

...

In this section, we will reference the editor template above and convert the template entry into a snippet. From the example above, each <template> node would correspond to a snippet that will want to add to your ruble.

...

  • trigger: The 'name' attribute.
  • expansion: The content inside the <template> node.
  • scope: The editor scope where this snippet will be active (in this case, it would be javascript).

...