"use strict";const performance=require("./vs/base/common/performance");performance.mark("code/fork/start");const bootstrap=require("./bootstrap"),bootstrapNode=require("./bootstrap-node");bootstrapNode.removeGlobalNodeModuleLookupPaths(),bootstrap.enableASARSupport(),process.env.VSCODE_INJECT_NODE_MODULE_LOOKUP_PATH&&bootstrapNode.injectNodeModuleLookupPath(process.env.VSCODE_INJECT_NODE_MODULE_LOOKUP_PATH),!!process.send&&process.env.VSCODE_PIPE_LOGGING==="true"&&pipeLoggingToParent(),process.env.VSCODE_HANDLES_UNCAUGHT_ERRORS||handleExceptions(),process.env.VSCODE_PARENT_PID&&terminateWhenParentTerminates(),process.env.VSCODE_WILL_SEND_MESSAGE_PORT&&listenForMessagePort(),require("./bootstrap-amd").load(process.env.VSCODE_AMD_ENTRYPOINT);function pipeLoggingToParent(){function u(e){const s=[],c=[];if(e.length)for(let n=0;n<e.length;n++){let o=e[n];if(typeof o>"u")o="undefined";else if(o instanceof Error){const t=o;t.stack?o=t.stack:o=t.toString()}c.push(o)}try{const n=JSON.stringify(c,function(o,t){if(d(t)||Array.isArray(t)){if(s.indexOf(t)!==-1)return"[Circular]";s.push(t)}return t});return n.length>1e5?"Output omitted for a large object that exceeds the limits":n}catch(n){return`Output omitted for an object that cannot be inspected ('${n.toString()}')`}}function E(e){try{process.send&&process.send(e)}catch{}}function d(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function _(e,s){E({type:"__$console",severity:e,arguments:s})}function i(e,s){Object.defineProperty(console,e,{set:()=>{},get:()=>function(){_(s,u(arguments))}})}function f(e,s){const c=process[e],n=c.write;let o="";Object.defineProperty(c,"write",{set:()=>{},get:()=>(t,l,O)=>{o+=t.toString(l);const a=o.length>1048576?o.length:o.lastIndexOf(`
`);a!==-1&&(console[s](o.slice(0,a)),o=o.slice(a+1)),n.call(c,t,l,O)}})}process.env.VSCODE_VERBOSE_LOGGING==="true"?(i("info","log"),i("log","log"),i("warn","warn"),i("error","error")):(console.log=function(){},console.warn=function(){},console.info=function(){},i("error","error")),f("stderr","error"),f("stdout","log")}function handleExceptions(){process.on("uncaughtException",function(r){console.error("Uncaught Exception: ",r)}),process.on("unhandledRejection",function(r){console.error("Unhandled Promise Rejection: ",r)})}function terminateWhenParentTerminates(){const r=Number(process.env.VSCODE_PARENT_PID);typeof r=="number"&&!isNaN(r)&&setInterval(function(){try{process.kill(r,0)}catch{process.exit()}},5e3)}function listenForMessagePort(){process.parentPort&&process.parentPort.on("message",r=>{global.vscodePortsCallback?global.vscodePortsCallback(r.ports):global.vscodePorts=r.ports})}

//# sourceMappingURL=bootstrap-fork.js.map
