src/JSUtils/ScopeManager.js
function trackChange(changeList) {
        var changed = documentChanges, i;
        if (changed === null) {
            documentChanges = changed = {from: changeList[0].from.line, to: changeList[0].from.line};
            if (config.debug) {
                console.debug("ScopeManager: document has changed");
            }
        }

        for (i = 0; i < changeList.length; i++) {
            var thisChange = changeList[i],
                end = thisChange.from.line + (thisChange.text.length - 1);
            if (thisChange.from.line < changed.to) {
                changed.to = changed.to - (thisChange.to.line - end);
            }

            if (end >= changed.to) {
                changed.to = end + 1;
            }

            if (changed.from > thisChange.from.line) {
                changed.from = thisChange.from.line;
            }
        }
    }
function trackChange(changeList) {
        var changed = documentChanges, i;
        if (changed === null) {
            documentChanges = changed = {from: changeList[0].from.line, to: changeList[0].from.line};
            if (config.debug) {
                console.debug("ScopeManager: document has changed");
            }
        }

        for (i = 0; i < changeList.length; i++) {
            var thisChange = changeList[i],
                end = thisChange.from.line + (thisChange.text.length - 1);
            if (thisChange.from.line < changed.to) {
                changed.to = changed.to - (thisChange.to.line - end);
            }

            if (end >= changed.to) {
                changed.to = end + 1;
            }

            if (changed.from > thisChange.from.line) {
                changed.from = thisChange.from.line;
            }
        }
    }
function trackChange ( changeList ) { var changed = documentChanges , i ; if ( changed === null ) { documentChanges = changed = { from : changeList [ 0 ] . from . line , to : changeList [ 0 ] . from . line } ; if ( config . debug ) { console . debug ( "ScopeManager: document has changed" ) ; } } for ( i = 0 ; i < changeList . length ; i ++ ) { var thisChange = changeList [ i ] , end = thisChange . from . line + ( thisChange . text . length - 1 ) ; if ( thisChange . from . line < changed . to ) { changed . to = changed . to - ( thisChange . to . line - end ) ; } if ( end >= changed . to ) { changed . to = end + 1 ; } if ( changed . from > thisChange . from . line ) { changed . from = thisChange . from . line ; } } }
Track the update area of the current document so we can tell if we can send
partial updates to tern or not.

@param {Array.<{from: {line:number, ch: number}, to: {line:number, ch: number},
text: Array<string>}>} changeList - the document changes from the current change event
Track the update area of the current document so we can tell if we can send partial updates to tern or not .