function inlineImageViewerProvider(hostEditor, pos) {

        // Only provide image viewer if the selection is within a single line
        var sel = hostEditor.getSelection(false);
        if (sel.start.line !== sel.end.line) {
            return null;
        }

        // Always use the selection start for determining the image file name. The pos
        // parameter is usually the selection end.
        var fileName = _getStringAtPos(hostEditor, hostEditor.getSelection(false).start);
        if (fileName === "") {
            return null;
        }

        // Check for valid file extensions
        if (!/(\.png|\.jpg|\.jpeg|\.gif|\.webp|\.svg)$/i.test(fileName)) {
            return null;
        }

        // TODO: Check for relative path
        var projectPath = ProjectManager.getProjectRoot().fullPath;

        if (fileName.indexOf(projectPath) !== 0) {
            fileName = projectPath + fileName;
        }
        var result = new $.Deferred();

        var imageViewer = new InlineImageViewer(fileName.substr(fileName.lastIndexOf("/")), fileName);
        imageViewer.load(hostEditor);

        result.resolve(imageViewer);

        return result.promise();
    }
This function is registered with EditManager as an inline editor provider. It creates an inline editor
when cursor is on a JavaScript function name, find all functions that match the name
and show (one/all of them) in an inline editor.

@param {!Editor} editor
@param {!{line:Number, ch:Number}} pos
@return {$.Promise} a promise that will be resolved with an InlineWidget
     or null if we're not going to provide anything.