function registerEditorOpener(opener) {
    const codeEditorService = StandaloneServices.get(ICodeEditorService);
    return codeEditorService.registerCodeEditorOpenHandler(async (input, source, sideBySide) => {
        var _a;
        if (!source) {
            return null;
        }
        const selection = (_a = input.options) === null || _a === void 0 ? void 0 : _a.selection;
        let selectionOrPosition;
        if (selection && typeof selection.endLineNumber === 'number' && typeof selection.endColumn === 'number') {
            selectionOrPosition = selection;
        }
        else if (selection) {
            selectionOrPosition = { lineNumber: selection.startLineNumber, column: selection.startColumn };
        }
        if (await opener.openCodeEditor(source, input.resource, selectionOrPosition)) {
            return source; // return source editor to indicate that this handler has successfully handled the opening
        }
        return null; // fallback to other registered handlers
    });
}
Registers a handler that is called when a resource other than the current model should be opened in the editor (e.g. "go to definition").
The handler callback should return `true` if the request was handled and `false` otherwise.

Returns a disposable that can unregister the opener again.

If no handler is registered the default behavior is to do nothing for models other than the currently attached one.