
import '../vscode/src/vs/editor/common/services/editorWebWorkerMain.js';
import { start } from '../vscode/src/vs/editor/editor.worker.start.js';

function initialize(createFn) {
    let requestHandler;
    const foreignModule = new Proxy({}, {
        get(_target, propKey) {
            if (propKey === '$initialize') {
                return async (data) => {
                    if (!requestHandler) {
                        requestHandler = createFn(context, data);
                    }
                };
            }
            return requestHandler?.[propKey];
        }
    });
    const context = start(foreignModule);
}

export { initialize };
