Up and running

On MAC we clone the code and run it with a bunch of errors:


No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/xxxxxxxxxx/.nvm/versions/node/v1213.. 0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.6. 0
Copy the code

Here to find the reason and solution: www.cnblogs.com/coolestcode…

I performed here: sudo rm – rf/Library/Developer/CommandLineTools this good, yarn install process a bit slow, no hurry.

During the process, there are some errors, but fortunately, it does not affect the operation.

It may not be smooth, but you may also have a phenomenon like this:

Yarn Run v1.22.4 $node build/lib/electron Error creating download stream to download electron- v11.0.2-Darwin-x64.zip internal/streams/legacy.js:59 throw er; // Unhandled stream error in pipe. ^ Error: Request failed with code 403 at Request.<anonymous> (.xxxxxx/vscode/node_modules/github-releases-ms/lib/github.js:56:25)  at Request.emit (events.js:210:5) at Request.onRequestResponse (xxxxx/vscode/node_modules/request/request.js:1066:10) at ClientRequest.emit (events.js:210:5) at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:583:27) at  HTTPParser.parserOnHeadersComplete (_http_common.js:115:17) at TLSSocket.socketOnData (_http_client.js:456:22) at TLSSocket.emit (events.js:210:5) at addChunk (_stream_readable.js:308:12) at readableAddChunk (_stream_readable.js:289:11) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.Copy the code
$ node build/lib/electron internal/streams/legacy.js:59 throw er; // Unhandled stream error in pipe. ^ error: API rate limit exceeded for 61.120.150.78. Authenticated requests get a higher rate limit. Check out the documentation for more details.) at Request._callback (xxx/vscode/node_modules/github-releases-ms/lib/github.js:83:17) at Request.self.callback (xxx/vscode/node_modules/request/request.js:185:22) at Request.emit (events.js:210:5) at Request.<anonymous> (xxxxx/vscode/node_modules/request/request.js:1161:10) at Request.emit (events.js:210:5) at IncomingMessage.<anonymous> (xxxx/vscode/node_modules/request/request.js:1083:12) at Object.onceWrapper (events.js:299:28) at IncomingMessage.emit (events.js:215:7) at endReadableNT (_stream_readable.js:1183:12) at processTicksAndRejections (internal/process/task_queues.js:80:21) error Command failed with exit code 1.Copy the code

But I didn’t seem to do anything. I just had to try a few more times:

➜ vscode git:(master) qualify./scripts/code.sh yarn run v1.22.4 $node build/lib/electron ↓ ffmpeg-v11.0.2-darwin-x64.zip [= = = = = = = = = = = = = = = = = = = =] 100% Downloaded ffmpeg v11.0.2 - Darwin - x64. Zip left electron - v11.0.2 - Darwin - x64. Zip [= = = = = = -- -- -- -- -- -- -- -- -- -- -- -- -- --] 29%Copy the code

It is estimated that the service is unstable

We’re finally running

Development and debugging

If we want the changes to take effect, then:

yarn watch
Copy the code

/scripts/code.sh will report:

[Error: ENOENT: no such file or directory, open 'xxxxx/vscode/out/vs/code/electron-main/main.js'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'xxxxx/vscode/out/vs/code/electron-main/main.js',
  phase: 'loading',
  moduleId: 'vs/code/electron-main/main',
  neededBy: [ '===anonymous1===' ]
}
Copy the code

Finished compilation extensions with 0 errors after 39224ms

SRC /vs/code/electron-main/app/ts

  console.log('hello, i am going to learning vscode');
Copy the code
constructor(
    private readonly mainIpcServer: Server,
    private readonly userEnv: IProcessEnvironment,
    @IInstantiationService private readonly instantiationService: IInstantiationService,
    @ILogService private readonly logService: ILogService,
    @IEnvironmentMainService private readonly environmentService: IEnvironmentMainService,
    @ILifecycleMainService private readonly lifecycleMainService: ILifecycleMainService,
    @IConfigurationService private readonly configurationService: IConfigurationService,
    @IStateService private readonly stateService: IStateService
) {
    super();
    console.log('hello, i am going to learning vscode');
    this.registerListeners();
}
Copy the code

After the main process code is modified, restart./scripts/code.sh

Therefore, you can see that the log is typed:

Yarn Run v1.22.4 $node build/lib/electron ✨ Done in 0.79s. [11:43:17] Syncronizing built-in Extensions... [11:43:17] You can manage built-in extensions with the --builtin flag [11:43:17] [marketplace] [email protected] ➤ ︎ [11:43:17] [marketplace] ︎ ➤ [email protected] ➤ ︎ [11:43:17] [marketplace] [email protected] ➤ [marketplace] [email protected] ➤ ︎ [11:43:17 [11:43:17] [marketplace] [email protected] stocking ︎ (electron) Sending uncompressed crash reports is deprecated and will be removed in a future version of Electron. Set { compress: true } to opt-in to the new behavior. Crash reports will be uploaded gzipped, which most crash reporting servers support. hello, i am going to learning vscode (node:60311) electron: The default of contextIsolation is deprecated and will be changing from false to true in a future release of Electron. See https://github.com/electron/electron/issues/23506 for more informationCopy the code