mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 09:35:41 -05:00
Merge from vscode 1ce89e2cb720d69c496c2815c4696ee4fd4429a6 (#6779)
* Merge from vscode 1ce89e2cb720d69c496c2815c4696ee4fd4429a6 * redisable accounts because of issues
This commit is contained in:
@@ -293,12 +293,9 @@ function topStep<T>(array: ReadonlyArray<T>, compare: (a: T, b: T) => number, re
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns a new array with all falsy values removed. The original array IS NOT modified.
|
||||
* @returns New array with all falsy values removed. The original array IS NOT modified.
|
||||
*/
|
||||
export function coalesce<T>(array: ReadonlyArray<T | undefined | null>): T[] {
|
||||
if (!array) {
|
||||
return array as T[]; // {{SQL CARBON EDIT}} @anthonydresser strict-null-checks
|
||||
}
|
||||
return <T[]>array.filter(e => !!e);
|
||||
}
|
||||
|
||||
@@ -306,9 +303,6 @@ export function coalesce<T>(array: ReadonlyArray<T | undefined | null>): T[] {
|
||||
* Remove all falsey values from `array`. The original array IS modified.
|
||||
*/
|
||||
export function coalesceInPlace<T>(array: Array<T | undefined | null>): void {
|
||||
if (!array) {
|
||||
return;
|
||||
}
|
||||
let to = 0;
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
if (!!array[i]) {
|
||||
|
||||
@@ -127,8 +127,7 @@ export class DisposableStore implements IDisposable {
|
||||
|
||||
markTracked(t);
|
||||
if (this._isDisposed) {
|
||||
console.warn(new Error('Registering disposable on object that has already been disposed of').stack);
|
||||
t.dispose();
|
||||
console.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack);
|
||||
} else {
|
||||
this._toDispose.add(t);
|
||||
}
|
||||
|
||||
@@ -49,3 +49,26 @@ export namespace Schemas {
|
||||
|
||||
export const userData: string = 'vscode-userdata';
|
||||
}
|
||||
|
||||
class RemoteAuthoritiesImpl {
|
||||
private readonly _hosts: { [authority: string]: string; };
|
||||
private readonly _ports: { [authority: string]: number; };
|
||||
private readonly _connectionTokens: { [authority: string]: string; };
|
||||
|
||||
constructor() {
|
||||
this._hosts = Object.create(null);
|
||||
this._ports = Object.create(null);
|
||||
this._connectionTokens = Object.create(null);
|
||||
}
|
||||
|
||||
public set(authority: string, host: string, port: number): void {
|
||||
this._hosts[authority] = host;
|
||||
this._ports[authority] = port;
|
||||
}
|
||||
|
||||
public setConnectionToken(authority: string, connectionToken: string): void {
|
||||
this._connectionTokens[authority] = connectionToken;
|
||||
}
|
||||
}
|
||||
|
||||
export const RemoteAuthorities = new RemoteAuthoritiesImpl();
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { isWindows, isMacintosh, setImmediate } from 'vs/base/common/platform';
|
||||
import { isWindows, isMacintosh, setImmediate, IProcessEnvironment } from 'vs/base/common/platform';
|
||||
|
||||
interface IProcess {
|
||||
platform: string;
|
||||
env: object;
|
||||
env: IProcessEnvironment;
|
||||
|
||||
cwd(): string;
|
||||
nextTick(callback: (...args: any[]) => void): number;
|
||||
|
||||
Reference in New Issue
Block a user