src/features/JumpToDefManager.js
function _doJumpToDef() {
        var request = null,
            result = new $.Deferred(),
            jumpToDefProvider = null,
            editor = EditorManager.getActiveEditor();

        if (editor) {
            // Find a suitable provider, if any
            var language = editor.getLanguageForSelection(),
                enabledProviders = _providerRegistrationHandler.getProvidersForLanguageId(language.getId());


            enabledProviders.some(function (item, index) {
                if (item.provider.canJumpToDef(editor)) {
                    jumpToDefProvider = item.provider;
                    return true;
                }
            });

            if (jumpToDefProvider) {
                request = jumpToDefProvider.doJumpToDef(editor);

                if (request) {
                    request.done(function () {
                        result.resolve();
                    }).fail(function () {
                        result.reject();
                    });
                } else {
                    result.reject();
                }
            } else {
                result.reject();
            }
        } else {
            result.reject();
        }

        return result.promise();
    }
function _doJumpToDef() {
        var request = null,
            result = new $.Deferred(),
            jumpToDefProvider = null,
            editor = EditorManager.getActiveEditor();

        if (editor) {
            // Find a suitable provider, if any
            var language = editor.getLanguageForSelection(),
                enabledProviders = _providerRegistrationHandler.getProvidersForLanguageId(language.getId());


            enabledProviders.some(function (item, index) {
                if (item.provider.canJumpToDef(editor)) {
                    jumpToDefProvider = item.provider;
                    return true;
                }
            });

            if (jumpToDefProvider) {
                request = jumpToDefProvider.doJumpToDef(editor);

                if (request) {
                    request.done(function () {
                        result.resolve();
                    }).fail(function () {
                        result.reject();
                    });
                } else {
                    result.reject();
                }
            } else {
                result.reject();
            }
        } else {
            result.reject();
        }

        return result.promise();
    }
function _doJumpToDef ( ) { var request = null , result = new $ . Deferred ( ) , jumpToDefProvider = null , editor = EditorManager . getActiveEditor ( ) ; if ( editor ) { // Find a suitable provider, if any var language = editor . getLanguageForSelection ( ) , enabledProviders = _providerRegistrationHandler . getProvidersForLanguageId ( language . getId ( ) ) ; enabledProviders . some ( function ( item , index ) { if ( item . provider . canJumpToDef ( editor ) ) { jumpToDefProvider = item . provider ; return true ; } } ) ; if ( jumpToDefProvider ) { request = jumpToDefProvider . doJumpToDef ( editor ) ; if ( request ) { request . done ( function ( ) { result . resolve ( ) ; } ) . fail ( function ( ) { result . reject ( ) ; } ) ; } else { result . reject ( ) ; } } else { result . reject ( ) ; } } else { result . reject ( ) ; } return result . promise ( ) ; }
Asynchronously asks providers to handle jump-to-definition.
@return {!Promise} Resolved when the provider signals that it's done; rejected if no
provider responded or the provider that responded failed.
Asynchronously asks providers to handle jump - to - definition .