Merge VS Code 1.23.1 (#1520)

This commit is contained in:
Matt Irvine
2018-06-05 11:24:51 -07:00
committed by GitHub
parent e3baf5c443
commit 0c58f09e59
3651 changed files with 74249 additions and 48599 deletions

View File

@@ -368,10 +368,12 @@ export class TernarySearchTree<E> {
export class ResourceMap<T> {
protected map: Map<string, T>;
protected readonly map: Map<string, T>;
protected readonly ignoreCase?: boolean;
constructor(private ignoreCase?: boolean) {
constructor() {
this.map = new Map<string, T>();
this.ignoreCase = false; // in the future this should be an uri-comparator
}
public set(resource: URI, value: T): void {
@@ -414,18 +416,10 @@ export class ResourceMap<T> {
return key;
}
}
export class StrictResourceMap<T> extends ResourceMap<T> {
constructor() {
super();
}
public keys(): URI[] {
return keys(this.map).map(key => URI.parse(key));
return keys(this.map).map(URI.parse);
}
}
// We should fold BoundedMap and LinkedMap. See https://github.com/Microsoft/vscode/issues/28496
@@ -743,6 +737,24 @@ export class LinkedMap<K, V> {
this._tail = item;
}
}
public toJSON(): [K, V][] {
const data: [K, V][] = [];
this.forEach((value, key) => {
data.push([key, value]);
});
return data;
}
public fromJSON(data: [K, V][]): void {
this.clear();
for (const [key, value] of data) {
this.set(key, value);
}
}
}
export class LRUCache<K, V> extends LinkedMap<K, V> {