mirror of
https://github.com/coder/code-server.git
synced 2025-07-30 21:45:08 +08:00
chore(vscode): update to 1.54.2
This commit is contained in:
@ -120,7 +120,7 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
|
||||
let child: cp.ChildProcess | undefined;
|
||||
let connectDriver: typeof connectElectronDriver;
|
||||
|
||||
copyExtension(options, 'vscode-notebook-tests');
|
||||
copyExtension(options.extensionsPath, 'vscode-notebook-tests');
|
||||
|
||||
if (options.web) {
|
||||
await launch(options.userDataDir, options.workspacePath, options.codePath, options.extensionsPath);
|
||||
@ -138,23 +138,36 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
|
||||
'--disable-telemetry',
|
||||
'--no-cached-data',
|
||||
'--disable-updates',
|
||||
'--disable-keytar',
|
||||
'--disable-crash-reporter',
|
||||
`--extensions-dir=${options.extensionsPath}`,
|
||||
`--user-data-dir=${options.userDataDir}`,
|
||||
'--driver', handle
|
||||
];
|
||||
|
||||
if (process.platform === 'linux') {
|
||||
args.push('--disable-gpu'); // Linux has trouble in VMs to render properly with GPU enabled
|
||||
}
|
||||
|
||||
if (options.remote) {
|
||||
// Replace workspace path with URI
|
||||
args[0] = `--${options.workspacePath.endsWith('.code-workspace') ? 'file' : 'folder'}-uri=vscode-remote://test+test/${URI.file(options.workspacePath).path}`;
|
||||
|
||||
if (codePath) {
|
||||
// running against a build: copy the test resolver extension
|
||||
copyExtension(options, 'vscode-test-resolver');
|
||||
copyExtension(options.extensionsPath, 'vscode-test-resolver');
|
||||
}
|
||||
args.push('--enable-proposed-api=vscode.vscode-test-resolver');
|
||||
const remoteDataDir = `${options.userDataDir}-server`;
|
||||
mkdirp.sync(remoteDataDir);
|
||||
|
||||
if (codePath) {
|
||||
// running against a build: copy the test resolver extension into remote extensions dir
|
||||
const remoteExtensionsDir = path.join(remoteDataDir, 'extensions');
|
||||
mkdirp.sync(remoteExtensionsDir);
|
||||
copyExtension(remoteExtensionsDir, 'vscode-notebook-tests');
|
||||
}
|
||||
|
||||
env['TESTRESOLVER_DATA_FOLDER'] = remoteDataDir;
|
||||
}
|
||||
|
||||
@ -186,11 +199,11 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
|
||||
return connect(connectDriver, child, outPath, handle, options.logger);
|
||||
}
|
||||
|
||||
async function copyExtension(options: SpawnOptions, extId: string): Promise<void> {
|
||||
const testResolverExtPath = path.join(options.extensionsPath, extId);
|
||||
if (!fs.existsSync(testResolverExtPath)) {
|
||||
async function copyExtension(extensionsPath: string, extId: string): Promise<void> {
|
||||
const dest = path.join(extensionsPath, extId);
|
||||
if (!fs.existsSync(dest)) {
|
||||
const orig = path.join(repoPath, 'extensions', extId);
|
||||
await new Promise((c, e) => ncp(orig, testResolverExtPath, err => err ? e(err) : c()));
|
||||
await new Promise<void>((c, e) => ncp(orig, dest, err => err ? e(err) : c()));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user