fix(lib/vscode): get vscode to compile

This commit is contained in:
Akash Satheesan
2021-04-09 17:50:11 +05:30
parent 5e63b7f53c
commit f3b1076f1d
4 changed files with 66 additions and 51 deletions

View File

@@ -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');