In this section you will learn to use Content Assist to fill in a template for a common loop structure. Open as_environment_manager.magik file in Magik editor, if it is not already opened.
_method as_environment_manager.example_code_templates(values)
vars << rope.new()
for
_endmethod
for", press Ctrl+Space to enable
Content Assist. Repeat pressing Ctrl+Space until Template Proposals appear. You will see a
list of common templates for "for" loop. When you single-click a template, or
select it with the Up or Down arrow keys, you will see the code of the selected
template in its help message. Note that the local array name is determined automatically.

for - full controlled loop entry and press Enter to
confirm the template. The template will be inserted into your source code.




_method as_environment_manager.example_code_templates(values)
vars << rope.new()
_for value _over values.elements()
_loop @values_loop
vars.add(value)
_finally _with value
_endloop
_endmethod

