src/document/DocumentCommandHandlers.js
function handleDocumentOpen(commandData) {
        var result = new $.Deferred();
        handleFileOpen(commandData)
            .done(function (file) {
                // if we succeeded with an open file
                //  then we need to resolve that to a document.
                //  getOpenDocumentForPath will return null if there isn't a
                //  supporting document for that file (e.g. an image)
                var doc = DocumentManager.getOpenDocumentForPath(file.fullPath);
                result.resolve(doc);
            })
            .fail(function (err) {
                result.reject(err);
            });

        return result.promise();

    }
function handleDocumentOpen(commandData) {
        var result = new $.Deferred();
        handleFileOpen(commandData)
            .done(function (file) {
                // if we succeeded with an open file
                //  then we need to resolve that to a document.
                //  getOpenDocumentForPath will return null if there isn't a
                //  supporting document for that file (e.g. an image)
                var doc = DocumentManager.getOpenDocumentForPath(file.fullPath);
                result.resolve(doc);
            })
            .fail(function (err) {
                result.reject(err);
            });

        return result.promise();

    }
function handleDocumentOpen ( commandData ) { var result = new $ . Deferred ( ) ; handleFileOpen ( commandData ) . done ( function ( file ) { // if we succeeded with an open file //  then we need to resolve that to a document. //  getOpenDocumentForPath will return null if there isn't a //  supporting document for that file (e.g. an image) var doc = DocumentManager . getOpenDocumentForPath ( file . fullPath ) ; result . resolve ( doc ) ; } ) . fail ( function ( err ) { result . reject ( err ) ; } ) ; return result . promise ( ) ; }
Opens the given file, makes it the current file, does NOT add it to the workingset
@param {FileCommandData} commandData
fullPath: File to open;
silent: optional flag to suppress error messages;
paneId: optional PaneId (defaults to active pane)
@return {$.Promise} a jQuery promise that will be resolved with @type {Document}
Opens the given file makes it the current file does NOT add it to the workingset