components/org.wso2.carbon.siddhi.editor.core/src/main/resources/web/js/source-editor/completion-engine.js
/**
         * Prepare a snippet from the processor
         * Snippets are objects that can be passed into the ace editor to add snippets to the completions provided
         *
         * @private
         * @param {Object} processorMetaData The processor object with relevant parameters
         * @return {Object} snippet
         */
Prepare a snippet from the processor
Snippets are objects that can be passed into the ace editor to add snippets to the completions provided

@private
@param {Object} processorMetaData The processor object with relevant parameters
@return {Object} snippet
Prepare a snippet from the processor Snippets are objects that can be passed into the ace editor to add snippets to the completions provided @private @param { Object } processorMetaData The processor object with relevant parameters @return { Object } snippet
function generateSnippetFromProcessorMetaData(processorMetaData) {
            var snippetVariableCount = 0;
            var snippetText = "snippet " + processorMetaData.name + "\n\t" + processorMetaData.name;
            if (processorMetaData.parameters) {
                snippetText += "(";
                for (var i = 0; i < processorMetaData.parameters.length; i++) {
                    var parameter = processorMetaData.parameters[i];
                    if (i != 0) {
                        snippetText += ", ";
                    }
                    snippetText += "${" + (snippetVariableCount + 1) + ":" + parameter.name + "}";
                    snippetVariableCount++;
                }
                snippetText += ")\n";
            }
            var snippet = aceModules.snippetManager.parseSnippetFile(snippetText)[0];
            if (processorMetaData.description || processorMetaData.returnType || processorMetaData.parameters) {
                snippet.description = utils.generateDescriptionForProcessor(processorMetaData);
            }
            return snippet;
        }
function generateSnippetFromProcessorMetaData ( processorMetaData ) { var snippetVariableCount = 0 ; var snippetText = "snippet " + processorMetaData . name + "\n\t" + processorMetaData . name ; if ( processorMetaData . parameters ) { snippetText += "(" ; for ( var i = 0 ; i < processorMetaData . parameters . length ; i ++ ) { var parameter = processorMetaData . parameters [ i ] ; if ( i != 0 ) { snippetText += ", " ; } snippetText += "${" + ( snippetVariableCount + 1 ) + ":" + parameter . name + "}" ; snippetVariableCount ++ ; } snippetText += ")\n" ; } var snippet = aceModules . snippetManager . parseSnippetFile ( snippetText ) [ 0 ] ; if ( processorMetaData . description || processorMetaData . returnType || processorMetaData . parameters ) { snippet . description = utils . generateDescriptionForProcessor ( processorMetaData ) ; } return snippet ; }
Prepare a snippet from the processor
 Snippets are objects that can be passed into the ace editor to add snippets to the completions provided
Prepare a snippet from the processor Snippets are objects that can be passed into the ace editor to add snippets to the completions provided