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

@@ -887,7 +887,7 @@ export class LinkedMap<K, V> implements Map<K, V> {
this._tail = undefined;
}
else if (item === this._head) {
// This can only happend if size === 1 which is handle
// This can only happen if size === 1 which is handled
// by the case above.
if (!item.next) {
throw new Error('Invalid list');
@@ -896,7 +896,7 @@ export class LinkedMap<K, V> implements Map<K, V> {
this._head = item.next;
}
else if (item === this._tail) {
// This can only happend if size === 1 which is handle
// This can only happen if size === 1 which is handled
// by the case above.
if (!item.previous) {
throw new Error('Invalid list');
@@ -1028,7 +1028,7 @@ export class LRUCache<K, V> extends LinkedMap<K, V> {
this.checkTrim();
}
get(key: K, touch: Touch = Touch.AsNew): V | undefined {
override get(key: K, touch: Touch = Touch.AsNew): V | undefined {
return super.get(key, touch);
}
@@ -1036,7 +1036,7 @@ export class LRUCache<K, V> extends LinkedMap<K, V> {
return super.get(key, Touch.None);
}
set(key: K, value: V): this {
override set(key: K, value: V): this {
super.set(key, value, Touch.AsNew);
this.checkTrim();
return this;
@@ -1048,3 +1048,47 @@ export class LRUCache<K, V> extends LinkedMap<K, V> {
}
}
}
/**
* Wraps the map in type that only implements readonly properties. Useful
* in the extension host to prevent the consumer from making any mutations.
*/
export class ReadonlyMapView<K, V> implements ReadonlyMap<K, V>{
readonly #source: ReadonlyMap<K, V>;
public get size() {
return this.#source.size;
}
constructor(source: ReadonlyMap<K, V>) {
this.#source = source;
}
forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void {
this.#source.forEach(callbackfn, thisArg);
}
get(key: K): V | undefined {
return this.#source.get(key);
}
has(key: K): boolean {
return this.#source.has(key);
}
entries(): IterableIterator<[K, V]> {
return this.#source.entries();
}
keys(): IterableIterator<K> {
return this.#source.keys();
}
values(): IterableIterator<V> {
return this.#source.values();
}
[Symbol.iterator](): IterableIterator<[K, V]> {
return this.#source.entries();
}
}