chore(vscode): update to 1.56.0

This commit is contained in:
Akash Satheesan
2021-04-30 20:25:17 +05:30
1749 changed files with 88014 additions and 43316 deletions

View File

@@ -18,7 +18,7 @@ export class LineDecoder {
private stringDecoder: sd.StringDecoder;
private remaining: string | null;
constructor(encoding: string = 'utf8') {
constructor(encoding: BufferEncoding = 'utf8') {
this.stringDecoder = new sd.StringDecoder(encoding);
this.remaining = null;
}

View File

@@ -56,8 +56,9 @@ export const virtualMachineHint: { value(): number } = new class {
const interfaces = networkInterfaces();
for (let name in interfaces) {
if (Object.prototype.hasOwnProperty.call(interfaces, name)) {
for (const { mac, internal } of interfaces[name]) {
const networkInterface = interfaces[name];
if (networkInterface) {
for (const { mac, internal } of networkInterface) {
if (!internal) {
interfaceCount += 1;
if (this._isVirtualMachineMacAdress(mac.toUpperCase())) {

View File

@@ -34,10 +34,13 @@ function doGetMac(): Promise<string> {
return new Promise((resolve, reject) => {
try {
const ifaces = networkInterfaces();
for (const [, infos] of Object.entries(ifaces)) {
for (const info of infos) {
if (validateMacAddress(info.mac)) {
return resolve(info.mac);
for (let name in ifaces) {
const networkInterface = ifaces[name];
if (networkInterface) {
for (const { mac } of networkInterface) {
if (validateMacAddress(mac)) {
return resolve(mac);
}
}
}
}

View File

@@ -379,7 +379,7 @@ export class LineProcess extends AbstractProcess<LineData> {
this.stderrLineDecoder = stderrLineDecoder;
}
protected handleClose(data: any, cc: ValueCallback<SuccessData>, pp: ProgressCallback<LineData>, ee: ErrorCallback): void {
protected override handleClose(data: any, cc: ValueCallback<SuccessData>, pp: ProgressCallback<LineData>, ee: ErrorCallback): void {
const stdoutLine = this.stdoutLineDecoder ? this.stdoutLineDecoder.end() : null;
if (stdoutLine) {
pp({ line: stdoutLine, source: Source.stdout });

View File

@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as os from 'os';
import { release, userInfo } from 'os';
import * as platform from 'vs/base/common/platform';
import { getFirstAvailablePowerShellInstallation } from 'vs/base/node/powershell';
import * as processes from 'vs/base/node/processes';
@@ -11,10 +11,10 @@ import * as processes from 'vs/base/node/processes';
/**
* Gets the detected default shell for the _system_, not to be confused with VS Code's _default_
* shell that the terminal uses by default.
* @param p The platform to detect the shell of.
* @param os The platform to detect the shell of.
*/
export async function getSystemShell(p: platform.Platform, env: platform.IProcessEnvironment): Promise<string> {
if (p === platform.Platform.Windows) {
export async function getSystemShell(os: platform.OperatingSystem, env: platform.IProcessEnvironment): Promise<string> {
if (os === platform.OperatingSystem.Windows) {
if (platform.isWindows) {
return getSystemShellWindows();
}
@@ -22,11 +22,11 @@ export async function getSystemShell(p: platform.Platform, env: platform.IProces
return processes.getWindowsShell(env);
}
return getSystemShellUnixLike(p, env);
return getSystemShellUnixLike(os, env);
}
export function getSystemShellSync(p: platform.Platform, env: platform.IProcessEnvironment): string {
if (p === platform.Platform.Windows) {
export function getSystemShellSync(os: platform.OperatingSystem, env: platform.IProcessEnvironment): string {
if (os === platform.OperatingSystem.Windows) {
if (platform.isWindows) {
return getSystemShellWindowsSync(env);
}
@@ -34,13 +34,13 @@ export function getSystemShellSync(p: platform.Platform, env: platform.IProcessE
return processes.getWindowsShell(env);
}
return getSystemShellUnixLike(p, env);
return getSystemShellUnixLike(os, env);
}
let _TERMINAL_DEFAULT_SHELL_UNIX_LIKE: string | null = null;
function getSystemShellUnixLike(p: platform.Platform, env: platform.IProcessEnvironment): string {
function getSystemShellUnixLike(os: platform.OperatingSystem, env: platform.IProcessEnvironment): string {
// Only use $SHELL for the current OS
if (platform.isLinux && p === platform.Platform.Mac || platform.isMacintosh && p === platform.Platform.Linux) {
if (platform.isLinux && os === platform.OperatingSystem.Macintosh || platform.isMacintosh && os === platform.OperatingSystem.Linux) {
return '/bin/bash';
}
@@ -55,7 +55,7 @@ function getSystemShellUnixLike(p: platform.Platform, env: platform.IProcessEnvi
try {
// It's possible for $SHELL to be unset, this API reads /etc/passwd. See https://github.com/github/codespaces/issues/1639
// Node docs: "Throws a SystemError if a user has no username or homedir."
unixLikeTerminal = os.userInfo().shell;
unixLikeTerminal = userInfo().shell;
} catch (err) { }
}
@@ -86,7 +86,7 @@ function getSystemShellWindowsSync(env: platform.IProcessEnvironment): string {
return _TERMINAL_DEFAULT_SHELL_WINDOWS;
}
const isAtLeastWindows10 = platform.isWindows && parseFloat(os.release()) >= 10;
const isAtLeastWindows10 = platform.isWindows && parseFloat(release()) >= 10;
const is32ProcessOn64Windows = env.hasOwnProperty('PROCESSOR_ARCHITEW6432');
const powerShellPath = `${env['windir']}\\${is32ProcessOn64Windows ? 'Sysnative' : 'System32'}\\WindowsPowerShell\\v1.0\\powershell.exe`;
return isAtLeastWindows10 ? powerShellPath : processes.getWindowsShell(env);