function onCompletionCollect(view, selection, set) { // if we are not inside of comments or documentation (Style.Text == 1 ), add our items to the list if ( view.Document.GetStyleFromPos(selection.Start, true).Style.Text != 1 ) { // add item as string, ше would be displayed using default style set.Add("Variable1"); // or explicitely as completion item, if you want to better item customizing options // for example, assigning of special style, as below set.Add(CompletionItem("Variable1", "variable")); } return true; } // create and register completion provider to be used for JavaScript (id="js") and all syntaxes inherited from it Application.RegisterCompletionProvider("js", Application.CompletionProvider(onCompletionCollect));