Adds error messages for failed operations

Adds showHistory command support to CodeLens
Fixes and improve the showHistory explorer
Refactoring
This commit is contained in:
Eric Amodio
2016-11-10 03:22:43 -05:00
parent 562afeaaad
commit f4410be30a
25 changed files with 584 additions and 305 deletions

View File

@@ -43,6 +43,12 @@ export namespace Iterables {
return typeof source[Symbol.iterator] === 'function';
}
export function last<T>(source: Iterable<T>): T {
let item: T;
for (item of source) { /* noop */ }
return item;
}
export function* map<T, TMapped>(source: Iterable<T> | IterableIterator<T>, mapper: (item: T) => TMapped): Iterable<TMapped> {
for (const item of source) {
yield mapper(item);