mirror of
https://github.com/coder/code-server.git
synced 2026-05-06 04:25:19 +02:00
fix(lib/vscode): get vscode to compile
This commit is contained in:
@@ -15,6 +15,23 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { ExtensionKind } from 'vs/platform/extensions/common/extensions';
|
||||
import { env } from 'vs/base/common/process';
|
||||
|
||||
|
||||
function parsePathArg(arg: string | undefined, process: NodeJS.Process): string | undefined {
|
||||
if (!arg) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Determine if the arg is relative or absolute, if relative use the original CWD
|
||||
// (VSCODE_CWD), not the potentially overridden one (process.cwd()).
|
||||
const resolved = resolve(arg);
|
||||
|
||||
if (normalize(arg) === resolved) {
|
||||
return resolved;
|
||||
}
|
||||
|
||||
return resolve(process.env['VSCODE_CWD'] || process.cwd(), arg);
|
||||
}
|
||||
|
||||
export interface INativeEnvironmentPaths {
|
||||
|
||||
/**
|
||||
@@ -173,6 +190,19 @@ export abstract class AbstractNativeEnvironmentService implements INativeEnviron
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE@coder: add extraExtensionPaths and extraBuiltinExtensionPaths
|
||||
* Code location changed after 1.54 (was earlier directly in NativeEnvironmentService).
|
||||
*/
|
||||
@memoize
|
||||
get extraExtensionPaths(): string[] {
|
||||
return (this._args['extra-extensions-dir'] || []).map((p) => <string>parsePathArg(p, process));
|
||||
}
|
||||
@memoize
|
||||
get extraBuiltinExtensionPaths(): string[] {
|
||||
return (this._args['extra-builtin-extensions-dir'] || []).map((p) => <string>parsePathArg(p, process));
|
||||
}
|
||||
|
||||
@memoize
|
||||
get extensionDevelopmentKind(): ExtensionKind[] | undefined {
|
||||
return this.args.extensionDevelopmentKind?.map(kind => kind === 'ui' || kind === 'workspace' || kind === 'web' ? kind : 'workspace');
|
||||
|
||||
Reference in New Issue
Block a user