components/org.wso2.carbon.siddhi.editor.core/src/main/resources/web/js/source-editor/completion-engine.js
/**
             * Handle the having suggestions for the query
             *
             * @private
             * @param {string[]} regexResults Array of groups from the regex execution of the query
             * @param {string} fullEditorText Complete editor text before the cursor
             */
Handle the having suggestions for the query
@private
@param {string[]} regexResults Array of groups from the regex execution of the query
@param {string} fullEditorText Complete editor text before the cursor
Handle the having suggestions for the query @private @param { string [] } regexResults Array of groups from the regex execution of the query @param { string } fullEditorText Complete editor text before the cursor
function handleHavingSuggestions(regexResults, fullEditorText) {
                var havingClause = regexResults[10];
                var afterHavingClauseRegex = new RegExp("\\s+[a-zA-Z_0-9]*$");
                if (afterHavingClauseRegex.test(havingClause)) {
                    addCompletions(["order by", "limit", "output", "insert", "delete", "update",
                        "update or insert into"]
                        .map(function (completion) {
                            return {value: completion + " ", priority: 2};
                        }
                    ));
                }
                addAttributesOfSourcesAsCompletionsFromQueryIn(
                    regexResults, fullEditorText, 3, 2,
                    [constants.STREAMS, constants.EVENT_TABLES, constants.WINDOWS, constants.AGGREGATIONS]
                );
                addAttributesOfStandardStatefulSourcesAsCompletionsFromQueryIn(
                    regexResults, fullEditorText, 3, 2
                );
                addAttributesOfStreamOrTableReferencesAsCompletionsFromQueryIn(
                    regexResults, fullEditorText, 3, 2
                );
                addCompletions(suggestions.logicalOperatorList.map(function (suggestion) {
                    return Object.assign({}, suggestion, {
                        priority: 2
                    });
                }));
            }
function handleHavingSuggestions ( regexResults , fullEditorText ) { var havingClause = regexResults [ 10 ] ; var afterHavingClauseRegex = new RegExp ( "\\s+[a-zA-Z_0-9]*$" ) ; if ( afterHavingClauseRegex . test ( havingClause ) ) { addCompletions ( [ "order by" , "limit" , "output" , "insert" , "delete" , "update" , "update or insert into" ] . map ( function ( completion ) { return { value : completion + " " , priority : 2 } ; } ) ) ; } addAttributesOfSourcesAsCompletionsFromQueryIn ( regexResults , fullEditorText , 3 , 2 , [ constants . STREAMS , constants . EVENT_TABLES , constants . WINDOWS , constants . AGGREGATIONS ] ) ; addAttributesOfStandardStatefulSourcesAsCompletionsFromQueryIn ( regexResults , fullEditorText , 3 , 2 ) ; addAttributesOfStreamOrTableReferencesAsCompletionsFromQueryIn ( regexResults , fullEditorText , 3 , 2 ) ; addCompletions ( suggestions . logicalOperatorList . map ( function ( suggestion ) { return Object . assign ( { } , suggestion , { priority : 2 } ) ; } ) ) ; }
Handle the having suggestions for the query
 @private
 @param {string[]} regexResults Array of groups from the regex execution of the query
 @param {string} fullEditorText Complete editor text before the cursor
Handle the having suggestions for the query @private @param { string [] } regexResults Array of groups from the regex execution of the query @param { string } fullEditorText Complete editor text before the cursor
// Regexps used for identifying the suggestions // Testing to find the relevant suggestion