With the introduction of object notation to 4D's language, it would be helpful to have an auto complete to help find commands and quickly write code. The autocomplete works differently for dot notation. Instead it looks at the code written in any of the open form editors and if there are any uses of dot notation it will add it to a list of auto complete suggestions.
A helpful and possibly time saving task is to write a method lists out all of the dot notation commands, fields, and frequently used properties and open the method in the method editor on startup to populate the list of suggestions.
This can also help removing suggestions by allowing a restart to reset the list and quickly repopulating the suggestions.
Below is a sample code that contains all of the dot notaction functions as of v17.0 Beta
//Method: FunctionsList IF(False) C_COLLECTION($init) //dataClass $init.all() $init.fromCollection() $init.get() $init.new() $init.newSelection() $init.query() //dataClassAttribute $init.kind() $init.name() //entity $init.clone() $init.diff() $init.drop() $init.first() $init.fromObject() $init.getKey() $init.getStamp() $init.indexOf() $init.isNew() $init.last() $init.lock() $init.next() $init.previous() $init.reload() $init.save() $init.toObject() $init.touched() $init.touchedAttributes() $init.unlock() //entitySelection $init.queryPath() $init.queryPlan() $init.add() $init.and() $init.average() $init.contains() $init.count() $init.distinct() $init.drop() $init.first() $init.isOrdered() $init.last() $init.max() $init.min() $init.minus() $init.or() $init.orderBy() $init.query() $init.slice() $init.sum() $init.toCollection() End if |
Then calling the following on startup will load the functions into the auto complete list:
METHOD OPEN PATH("FunctionsList") |
This can also be expanded for other commonly used attributes or fields.
Below is an example of some fields:
//Method: ListFields C_OBJECT($init) //Table_1 $init:=ds.Table_1.Field_2 $init:=ds.Table_1.Field_3 $init:=ds.Table_1.Field_4 //Table_2 $init:=ds.Table_2.Field_A $init:=ds.Table_2.Field_B $init:=ds.Table_2.Field_C |