Using content assist

In this section you will use content assist to finish writing a new method. Open the file as_environment_manager.magik in Magik editor if you do not already have it open and select example() method in the Outline view. If the file does not contain such a method see Adding new methods for instructions on how to add this method.

  1. Change the method in a following manner:

    _method as_environment_manager.example(var1, var2)
    vars << rope.new()
    var
    _endmethod

  2. With your cursor at the end of the word var, press Ctrl+Space to activate content assist. The content assist window with a list of proposals will appear. Scroll the list to see available choices.

    Content assist

  3. Select vars local variable and press Enter. The name for vars variable is inserted.
  4. After word vars type ".". Content assist window will activate automatically. In class field type ^rope$ to list all methods available for exemplar rope. Single-click various items in the list to view any available help for each item.

    Content assist filtered

  5. Select add() from the list and press Enter. The code for the add(thing) method is inserted.
  6. Complete the line as follows:

    vars.add(var1)

  7. Save the file.

Related concepts

Magik editor

Related reference

Magik Content Assist
Magik Editor Preferences