components/org.wso2.carbon.siddhi.editor.core/src/main/resources/web/js/source-editor/completion-engine.js
/**
             * add attributes of stream references in select section of the aggregation definition
             * (stream as reference)
             *
             * @private
             * @param {string[]} regexResults Array of groups from the regex execution of the query
             * @param {string} fullEditorText Complete editor text before the cursor
             * @param {int} attributePriority priority to be set as attribute priority
             * @param {int} streamPriority priority to be set as stream priority
             */
add attributes of stream references in select section of the aggregation definition
(stream as reference)


add attributes of stream references in select section of the aggregation definition ( stream as reference )
function addAttributesOfStreamReferencesAsCompletionsFromAggregationDefinition(regexResults,
                                                                                             fullEditorText,
                                                                                             attributePriority,
                                                                                             streamPriority) {
                var aggregationInput = regexResults[4];
                var sourceReferenceSearchRegex = new RegExp(regex.aggregation.input.streamReference, "ig");
                var referenceToSourceMap = [];
                var sourceReferenceMatch;
                while (sourceReferenceMatch = sourceReferenceSearchRegex.exec(aggregationInput)) {
                    if (getSource(regexResults, fullEditorText, sourceReferenceMatch[1],
                            [constants.STREAMS])) {
                        referenceToSourceMap[sourceReferenceMatch[2]] = sourceReferenceMatch[1];
                    }
                }
                addAttributesOfSourceReferencesAsCompletions(
                    regexResults, fullEditorText, referenceToSourceMap, attributePriority,
                    streamPriority, [constants.STREAMS]
                );
            }
function addAttributesOfStreamReferencesAsCompletionsFromAggregationDefinition ( regexResults , fullEditorText , attributePriority , streamPriority ) { var aggregationInput = regexResults [ 4 ] ; var sourceReferenceSearchRegex = new RegExp ( regex . aggregation . input . streamReference , "ig" ) ; var referenceToSourceMap = [ ] ; var sourceReferenceMatch ; while ( sourceReferenceMatch = sourceReferenceSearchRegex . exec ( aggregationInput ) ) { if ( getSource ( regexResults , fullEditorText , sourceReferenceMatch [ 1 ] , [ constants . STREAMS ] ) ) { referenceToSourceMap [ sourceReferenceMatch [ 2 ] ] = sourceReferenceMatch [ 1 ] ; } } addAttributesOfSourceReferencesAsCompletions ( regexResults , fullEditorText , referenceToSourceMap , attributePriority , streamPriority , [ constants . STREAMS ] ) ; }
add attributes of stream references in select section of the aggregation definition
 (stream as reference)
add attributes of stream references in select section of the aggregation definition ( stream as reference )
// Getting the reference to source map