function getDocText(filePath) {
                if (!FileSystem.isAbsolutePath(filePath) || // don't handle URLs
                        filePath.slice(0, 2) === "//") { // don't handle protocol-relative URLs like //example.com/main.js (see #10566)
                    return (new $.Deferred()).reject().promise();
                }

                var file = FileSystem.getFileForPath(filePath),
                    promise = DocumentManager.getDocumentText(file);

                promise.done(function (docText) {
                    resolvedFiles[name] = filePath;
                    numResolvedFiles++;
                    replyWith(name, filterText(docText));
                });
                return promise;
            }
Helper function to get the text of a given document and send it to tern.
If DocumentManager successfully gets the file's text then we'll send it to the tern node domain.
The Promise for getDocumentText() is returned so that custom fail functions can be used.

@param {string} filePath - the path of the file to get the text of
@return {jQuery.Promise} - the Promise returned from DocumentMangaer.getDocumentText()