//////////////////////////////////////////////////////////////////////// // Register Code Completion Handler Application.onCompletion = function(/*IRange*/ selection ) { if ( ActiveDocument.Syntax.IsInheritedFrom("js") ) { var completion_set = CompletionSet(); // add as a string completion_set.Add("Variable1"); // add as a completion item. To refer style you can use relative syntax e.g. "variable", // absolute "js:method" or at all pass Syntax object directly completion_set.Add(CompletionItem("Variable2", "js:methods")); this.ShowCompletionList(selection, completion_set, true); return true; // event is handled } // event is not handled, editor shall execute default logic return false; };