src/JSUtils/node/TernNodeDomain.js
function getTernProperties(fileInfo, offset, type) {

    var request = buildRequest(fileInfo, "properties", offset),
        i;
    //_log("tern properties: request " + request.type + dir + " " + file);
    try {
        ternServer.request(request, function (error, data) {
            var properties = [];
            if (error) {
                _log("Error returned from Tern 'properties' request: " + error);
            } else {
                //_log("tern properties: completions = " + data.completions.length);
                properties = data.completions.map(function (completion) {
                    return {value: completion, type: completion.type, guess: true};
                });
            }
            // Post a message back to the main thread with the completions
            self.postMessage({type: type,
                              file: _getNormalizedFilename(fileInfo.name),
                              offset: offset,
                              properties: properties
                });
        });
    } catch (e) {
        _reportError(e, fileInfo.name);
    }
}
function getTernProperties(fileInfo, offset, type) {

    var request = buildRequest(fileInfo, "properties", offset),
        i;
    //_log("tern properties: request " + request.type + dir + " " + file);
    try {
        ternServer.request(request, function (error, data) {
            var properties = [];
            if (error) {
                _log("Error returned from Tern 'properties' request: " + error);
            } else {
                //_log("tern properties: completions = " + data.completions.length);
                properties = data.completions.map(function (completion) {
                    return {value: completion, type: completion.type, guess: true};
                });
            }
            // Post a message back to the main thread with the completions
            self.postMessage({type: type,
                              file: _getNormalizedFilename(fileInfo.name),
                              offset: offset,
                              properties: properties
                });
        });
    } catch (e) {
        _reportError(e, fileInfo.name);
    }
}
function getTernProperties ( fileInfo , offset , type ) { var request = buildRequest ( fileInfo , "properties" , offset ) , i ; //_log("tern properties: request " + request.type + dir + " " + file); try { ternServer . request ( request , function ( error , data ) { var properties = [ ] ; if ( error ) { _log ( "Error returned from Tern 'properties' request: " + error ) ; } else { //_log("tern properties: completions = " + data.completions.length); properties = data . completions . map ( function ( completion ) { return { value : completion , type : completion . type , guess : true } ; } ) ; } // Post a message back to the main thread with the completions self . postMessage ( { type : type , file : _getNormalizedFilename ( fileInfo . name ) , offset : offset , properties : properties } ) ; } ) ; } catch ( e ) { _reportError ( e , fileInfo . name ) ; } }
Get all the known properties for guessing.

@param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
- type of update, name of file, and the text of the update.
For "full" updates, the whole text of the file is present. For "part" updates,
the changed portion of the text. For "empty" updates, the file has not been modified
and the text is empty.
@param {{line: number, ch: number}} offset -
the offset into the file where we want completions for
@param {string} type     - the type of the message to reply with.
Get all the known properties for guessing .