function _createEditorForDocument(doc, makeMasterEditor, container, range, additionalKeys) {
        var mode = EditorUtils.getModeFromFileExtension(doc.file.fullPath);
        
        return new Editor(doc, makeMasterEditor, mode, container, additionalKeys, range);
    }
Creates a new Editor bound to the given Document. The editor's mode is inferred based on the
file extension. The editor is appended to the given container as a visible child.
@param {!Document} doc  Document for the Editor's content
@param {!boolean} makeMasterEditor  If true, the Editor will set itself as the private "master"
         Editor for the Document. If false, the Editor will attach to the Document as a "slave."
@param {!jQueryObject} container  Container to add the editor to.
@param {{startLine: number, endLine: number}=} range If specified, range of lines within the document
         to display in this editor. Inclusive.
@return {Editor} the newly created editor.