mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Build with TS 2.7 (#45348)
* Pick up TS 2.7 * Fix formatter in build script * Fix build error for ts 2.7 * Pick up new ts format and tslint versions * Update lock * use 2.7.2 for build * Formatting
This commit is contained in:
parent
b481b00b8e
commit
24eb363974
|
@ -171,9 +171,7 @@ function format(text) {
|
|||
function getRuleProvider(options) {
|
||||
// Share this between multiple formatters using the same options.
|
||||
// This represents the bulk of the space the formatter uses.
|
||||
var ruleProvider = new ts.formatting.RulesProvider();
|
||||
ruleProvider.ensureUpToDate(options);
|
||||
return ruleProvider;
|
||||
return ts.formatting.getFormatContext(options);
|
||||
}
|
||||
function applyEdits(text, edits) {
|
||||
// Apply edits in reverse on the existing text
|
||||
|
|
|
@ -196,9 +196,7 @@ function format(text: string): string {
|
|||
function getRuleProvider(options: ts.FormatCodeSettings) {
|
||||
// Share this between multiple formatters using the same options.
|
||||
// This represents the bulk of the space the formatter uses.
|
||||
let ruleProvider = new (<any>ts).formatting.RulesProvider();
|
||||
ruleProvider.ensureUpToDate(options);
|
||||
return ruleProvider;
|
||||
return (ts as any).formatting.getFormatContext(options);
|
||||
}
|
||||
|
||||
function applyEdits(text: string, edits: ts.TextChange[]): string {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"documentdb": "1.13.0",
|
||||
"mime": "^1.3.4",
|
||||
"minimist": "^1.2.0",
|
||||
"typescript": "2.6.1",
|
||||
"typescript": "2.7.2",
|
||||
"xml2js": "^0.4.17"
|
||||
},
|
||||
"scripts": {
|
||||
|
|
|
@ -427,9 +427,9 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
|||
version "0.14.5"
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||
|
||||
typescript@2.6.1:
|
||||
version "2.6.1"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.1.tgz#ef39cdea27abac0b500242d6726ab90e0c846631"
|
||||
typescript@2.7.2:
|
||||
version "2.7.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836"
|
||||
|
||||
underscore@1.8.3, underscore@~1.8.3:
|
||||
version "1.8.3"
|
||||
|
|
|
@ -114,8 +114,8 @@
|
|||
"sinon": "^1.17.2",
|
||||
"source-map": "^0.4.4",
|
||||
"tslint": "^5.9.1",
|
||||
"typescript": "2.6.1",
|
||||
"typescript-formatter": "4.0.1",
|
||||
"typescript": "2.7.2",
|
||||
"typescript-formatter": "7.1.0",
|
||||
"uglify-es": "^3.0.18",
|
||||
"underscore": "^1.8.2",
|
||||
"vinyl": "^0.4.5",
|
||||
|
|
2
src/typings/gc-signals.d.ts
vendored
2
src/typings/gc-signals.d.ts
vendored
|
@ -6,7 +6,7 @@ declare module 'gc-signals' {
|
|||
* value is stored for later consumption.
|
||||
*/
|
||||
export const GCSignal: {
|
||||
new (id: number): GCSignal;
|
||||
new(id: number): GCSignal;
|
||||
};
|
||||
/**
|
||||
* Consume ids of garbage collected signals.
|
||||
|
|
72
src/typings/keytar.d.ts
vendored
72
src/typings/keytar.d.ts
vendored
|
@ -5,44 +5,44 @@
|
|||
|
||||
declare module 'keytar' {
|
||||
|
||||
/**
|
||||
* Get the stored password for the service and account.
|
||||
*
|
||||
* @param service The string service name.
|
||||
* @param account The string account name.
|
||||
*
|
||||
* @returns A promise for the password string.
|
||||
*/
|
||||
export function getPassword(service: string, account: string): Promise<string | null>;
|
||||
/**
|
||||
* Get the stored password for the service and account.
|
||||
*
|
||||
* @param service The string service name.
|
||||
* @param account The string account name.
|
||||
*
|
||||
* @returns A promise for the password string.
|
||||
*/
|
||||
export function getPassword(service: string, account: string): Promise<string | null>;
|
||||
|
||||
/**
|
||||
* Add the password for the service and account to the keychain.
|
||||
*
|
||||
* @param service The string service name.
|
||||
* @param account The string account name.
|
||||
* @param password The string password.
|
||||
*
|
||||
* @returns A promise for the set password completion.
|
||||
*/
|
||||
export function setPassword(service: string, account: string, password: string): Promise<void>;
|
||||
/**
|
||||
* Add the password for the service and account to the keychain.
|
||||
*
|
||||
* @param service The string service name.
|
||||
* @param account The string account name.
|
||||
* @param password The string password.
|
||||
*
|
||||
* @returns A promise for the set password completion.
|
||||
*/
|
||||
export function setPassword(service: string, account: string, password: string): Promise<void>;
|
||||
|
||||
/**
|
||||
* Delete the stored password for the service and account.
|
||||
*
|
||||
* @param service The string service name.
|
||||
* @param account The string account name.
|
||||
*
|
||||
* @returns A promise for the deletion status. True on success.
|
||||
*/
|
||||
export function deletePassword(service: string, account: string): Promise<boolean>;
|
||||
/**
|
||||
* Delete the stored password for the service and account.
|
||||
*
|
||||
* @param service The string service name.
|
||||
* @param account The string account name.
|
||||
*
|
||||
* @returns A promise for the deletion status. True on success.
|
||||
*/
|
||||
export function deletePassword(service: string, account: string): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Find a password for the service in the keychain.
|
||||
*
|
||||
* @param service The string service name.
|
||||
*
|
||||
* @returns A promise for the password string.
|
||||
*/
|
||||
export function findPassword(service: string): Promise<string | null>;
|
||||
/**
|
||||
* Find a password for the service in the keychain.
|
||||
*
|
||||
* @param service The string service name.
|
||||
*
|
||||
* @returns A promise for the password string.
|
||||
*/
|
||||
export function findPassword(service: string): Promise<string | null>;
|
||||
|
||||
}
|
86
src/typings/lib.ie11_safe_es6.d.ts
vendored
86
src/typings/lib.ie11_safe_es6.d.ts
vendored
|
@ -7,72 +7,72 @@
|
|||
// CHECK WITH http://kangax.github.io/compat-table/es6/#ie11
|
||||
|
||||
interface Map<K, V> {
|
||||
clear(): void;
|
||||
delete(key: K): boolean;
|
||||
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
||||
get(key: K): V;
|
||||
has(key: K): boolean;
|
||||
set(key: K, value?: V): Map<K, V>;
|
||||
readonly size: number;
|
||||
clear(): void;
|
||||
delete(key: K): boolean;
|
||||
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
||||
get(key: K): V;
|
||||
has(key: K): boolean;
|
||||
set(key: K, value?: V): Map<K, V>;
|
||||
readonly size: number;
|
||||
|
||||
// not supported on IE11:
|
||||
// entries(): IterableIterator<[K, V]>;
|
||||
// keys(): IterableIterator<K>;
|
||||
// values(): IterableIterator<V>;
|
||||
// [Symbol.iterator]():IterableIterator<[K,V]>;
|
||||
// [Symbol.toStringTag]: string;
|
||||
// not supported on IE11:
|
||||
// entries(): IterableIterator<[K, V]>;
|
||||
// keys(): IterableIterator<K>;
|
||||
// values(): IterableIterator<V>;
|
||||
// [Symbol.iterator]():IterableIterator<[K,V]>;
|
||||
// [Symbol.toStringTag]: string;
|
||||
}
|
||||
|
||||
interface MapConstructor {
|
||||
new <K, V>(): Map<K, V>;
|
||||
prototype: Map<any, any>;
|
||||
new <K, V>(): Map<K, V>;
|
||||
prototype: Map<any, any>;
|
||||
|
||||
// not supported on IE11:
|
||||
// new <K, V>(iterable: Iterable<[K, V]>): Map<K, V>;
|
||||
// not supported on IE11:
|
||||
// new <K, V>(iterable: Iterable<[K, V]>): Map<K, V>;
|
||||
}
|
||||
declare var Map: MapConstructor;
|
||||
|
||||
|
||||
interface Set<T> {
|
||||
add(value: T): Set<T>;
|
||||
clear(): void;
|
||||
delete(value: T): boolean;
|
||||
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
|
||||
has(value: T): boolean;
|
||||
readonly size: number;
|
||||
add(value: T): Set<T>;
|
||||
clear(): void;
|
||||
delete(value: T): boolean;
|
||||
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
|
||||
has(value: T): boolean;
|
||||
readonly size: number;
|
||||
|
||||
// not supported on IE11:
|
||||
// entries(): IterableIterator<[T, T]>;
|
||||
// keys(): IterableIterator<T>;
|
||||
// values(): IterableIterator<T>;
|
||||
// [Symbol.iterator]():IterableIterator<T>;
|
||||
// [Symbol.toStringTag]: string;
|
||||
// not supported on IE11:
|
||||
// entries(): IterableIterator<[T, T]>;
|
||||
// keys(): IterableIterator<T>;
|
||||
// values(): IterableIterator<T>;
|
||||
// [Symbol.iterator]():IterableIterator<T>;
|
||||
// [Symbol.toStringTag]: string;
|
||||
}
|
||||
|
||||
interface SetConstructor {
|
||||
new <T>(): Set<T>;
|
||||
prototype: Set<any>;
|
||||
new <T>(): Set<T>;
|
||||
prototype: Set<any>;
|
||||
|
||||
// not supported on IE11:
|
||||
// new <T>(iterable: Iterable<T>): Set<T>;
|
||||
// not supported on IE11:
|
||||
// new <T>(iterable: Iterable<T>): Set<T>;
|
||||
}
|
||||
declare var Set: SetConstructor;
|
||||
|
||||
|
||||
interface WeakMap<K, V> {
|
||||
delete(key: K): boolean;
|
||||
get(key: K): V | undefined;
|
||||
has(key: K): boolean;
|
||||
// IE11 doesn't return this
|
||||
// set(key: K, value?: V): this;
|
||||
set(key: K, value?: V): undefined;
|
||||
delete(key: K): boolean;
|
||||
get(key: K): V | undefined;
|
||||
has(key: K): boolean;
|
||||
// IE11 doesn't return this
|
||||
// set(key: K, value?: V): this;
|
||||
set(key: K, value?: V): undefined;
|
||||
}
|
||||
|
||||
interface WeakMapConstructor {
|
||||
new (): WeakMap<any, any>;
|
||||
new <K, V>(): WeakMap<K, V>;
|
||||
// new <K, V>(entries?: [K, V][]): WeakMap<K, V>;
|
||||
readonly prototype: WeakMap<any, any>;
|
||||
new(): WeakMap<any, any>;
|
||||
new <K, V>(): WeakMap<K, V>;
|
||||
// new <K, V>(entries?: [K, V][]): WeakMap<K, V>;
|
||||
readonly prototype: WeakMap<any, any>;
|
||||
}
|
||||
declare var WeakMap: WeakMapConstructor;
|
||||
|
||||
|
|
300
src/typings/mocha.d.ts
vendored
300
src/typings/mocha.d.ts
vendored
|
@ -4,29 +4,29 @@
|
|||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface MochaSetupOptions {
|
||||
//milliseconds to wait before considering a test slow
|
||||
slow?: number;
|
||||
//milliseconds to wait before considering a test slow
|
||||
slow?: number;
|
||||
|
||||
// timeout in milliseconds
|
||||
timeout?: number;
|
||||
// timeout in milliseconds
|
||||
timeout?: number;
|
||||
|
||||
// ui name "bdd", "tdd", "exports" etc
|
||||
ui?: string;
|
||||
// ui name "bdd", "tdd", "exports" etc
|
||||
ui?: string;
|
||||
|
||||
//array of accepted globals
|
||||
globals?: any[];
|
||||
//array of accepted globals
|
||||
globals?: any[];
|
||||
|
||||
// reporter instance (function or string), defaults to `mocha.reporters.Spec`
|
||||
reporter?: any;
|
||||
// reporter instance (function or string), defaults to `mocha.reporters.Spec`
|
||||
reporter?: any;
|
||||
|
||||
// bail on the first test failure
|
||||
bail?: boolean;
|
||||
// bail on the first test failure
|
||||
bail?: boolean;
|
||||
|
||||
// ignore global leaks
|
||||
ignoreLeaks?: boolean;
|
||||
// ignore global leaks
|
||||
ignoreLeaks?: boolean;
|
||||
|
||||
// grep string or regexp to filter tests with
|
||||
grep?: any;
|
||||
// grep string or regexp to filter tests with
|
||||
grep?: any;
|
||||
}
|
||||
|
||||
declare var mocha: Mocha;
|
||||
|
@ -46,7 +46,7 @@ declare var specify: Mocha.ITestDefinition;
|
|||
declare function run(): void;
|
||||
|
||||
interface MochaDone {
|
||||
(error?: any): any;
|
||||
(error?: any): any;
|
||||
}
|
||||
|
||||
declare function setup(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void;
|
||||
|
@ -63,172 +63,172 @@ declare function afterEach(callback: (this: Mocha.IBeforeAndAfterContext, done:
|
|||
declare function afterEach(description: string, callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void;
|
||||
|
||||
declare class Mocha {
|
||||
currentTest: Mocha.ITestDefinition;
|
||||
constructor(options?: {
|
||||
grep?: RegExp;
|
||||
ui?: string;
|
||||
reporter?: string;
|
||||
timeout?: number;
|
||||
reporterOptions?: any;
|
||||
slow?: number;
|
||||
bail?: boolean;
|
||||
});
|
||||
currentTest: Mocha.ITestDefinition;
|
||||
constructor(options?: {
|
||||
grep?: RegExp;
|
||||
ui?: string;
|
||||
reporter?: string;
|
||||
timeout?: number;
|
||||
reporterOptions?: any;
|
||||
slow?: number;
|
||||
bail?: boolean;
|
||||
});
|
||||
|
||||
/** Setup mocha with the given options. */
|
||||
setup(options: MochaSetupOptions): Mocha;
|
||||
bail(value?: boolean): Mocha;
|
||||
addFile(file: string): Mocha;
|
||||
/** Sets reporter by name, defaults to "spec". */
|
||||
reporter(name: string): Mocha;
|
||||
/** Sets reporter constructor, defaults to mocha.reporters.Spec. */
|
||||
reporter(reporter: (runner: Mocha.IRunner, options: any) => any): Mocha;
|
||||
ui(value: string): Mocha;
|
||||
grep(value: string): Mocha;
|
||||
grep(value: RegExp): Mocha;
|
||||
invert(): Mocha;
|
||||
ignoreLeaks(value: boolean): Mocha;
|
||||
checkLeaks(): Mocha;
|
||||
/** Setup mocha with the given options. */
|
||||
setup(options: MochaSetupOptions): Mocha;
|
||||
bail(value?: boolean): Mocha;
|
||||
addFile(file: string): Mocha;
|
||||
/** Sets reporter by name, defaults to "spec". */
|
||||
reporter(name: string): Mocha;
|
||||
/** Sets reporter constructor, defaults to mocha.reporters.Spec. */
|
||||
reporter(reporter: (runner: Mocha.IRunner, options: any) => any): Mocha;
|
||||
ui(value: string): Mocha;
|
||||
grep(value: string): Mocha;
|
||||
grep(value: RegExp): Mocha;
|
||||
invert(): Mocha;
|
||||
ignoreLeaks(value: boolean): Mocha;
|
||||
checkLeaks(): Mocha;
|
||||
/**
|
||||
* Function to allow assertion libraries to throw errors directly into mocha.
|
||||
* This is useful when running tests in a browser because window.onerror will
|
||||
* only receive the 'message' attribute of the Error.
|
||||
*/
|
||||
throwError(error: Error): void;
|
||||
/** Enables growl support. */
|
||||
growl(): Mocha;
|
||||
globals(value: string): Mocha;
|
||||
globals(values: string[]): Mocha;
|
||||
useColors(value: boolean): Mocha;
|
||||
useInlineDiffs(value: boolean): Mocha;
|
||||
timeout(value: number): Mocha;
|
||||
slow(value: number): Mocha;
|
||||
enableTimeouts(value: boolean): Mocha;
|
||||
asyncOnly(value: boolean): Mocha;
|
||||
noHighlighting(value: boolean): Mocha;
|
||||
/** Runs tests and invokes `onComplete()` when finished. */
|
||||
run(onComplete?: (failures: number) => void): Mocha.IRunner;
|
||||
throwError(error: Error): void;
|
||||
/** Enables growl support. */
|
||||
growl(): Mocha;
|
||||
globals(value: string): Mocha;
|
||||
globals(values: string[]): Mocha;
|
||||
useColors(value: boolean): Mocha;
|
||||
useInlineDiffs(value: boolean): Mocha;
|
||||
timeout(value: number): Mocha;
|
||||
slow(value: number): Mocha;
|
||||
enableTimeouts(value: boolean): Mocha;
|
||||
asyncOnly(value: boolean): Mocha;
|
||||
noHighlighting(value: boolean): Mocha;
|
||||
/** Runs tests and invokes `onComplete()` when finished. */
|
||||
run(onComplete?: (failures: number) => void): Mocha.IRunner;
|
||||
}
|
||||
|
||||
// merge the Mocha class declaration with a module
|
||||
declare namespace Mocha {
|
||||
interface ISuiteCallbackContext {
|
||||
timeout(ms: number): this;
|
||||
retries(n: number): this;
|
||||
slow(ms: number): this;
|
||||
}
|
||||
interface ISuiteCallbackContext {
|
||||
timeout(ms: number): this;
|
||||
retries(n: number): this;
|
||||
slow(ms: number): this;
|
||||
}
|
||||
|
||||
interface IHookCallbackContext {
|
||||
skip(): this;
|
||||
timeout(ms: number): this;
|
||||
[index: string]: any;
|
||||
}
|
||||
interface IHookCallbackContext {
|
||||
skip(): this;
|
||||
timeout(ms: number): this;
|
||||
[index: string]: any;
|
||||
}
|
||||
|
||||
|
||||
interface ITestCallbackContext {
|
||||
skip(): this;
|
||||
timeout(ms: number): this;
|
||||
retries(n: number): this;
|
||||
slow(ms: number): this;
|
||||
[index: string]: any;
|
||||
}
|
||||
interface ITestCallbackContext {
|
||||
skip(): this;
|
||||
timeout(ms: number): this;
|
||||
retries(n: number): this;
|
||||
slow(ms: number): this;
|
||||
[index: string]: any;
|
||||
}
|
||||
|
||||
/** Partial interface for Mocha's `Runnable` class. */
|
||||
interface IRunnable {
|
||||
title: string;
|
||||
fn: Function;
|
||||
async: boolean;
|
||||
sync: boolean;
|
||||
timedOut: boolean;
|
||||
timeout(n: number): this;
|
||||
}
|
||||
/** Partial interface for Mocha's `Runnable` class. */
|
||||
interface IRunnable {
|
||||
title: string;
|
||||
fn: Function;
|
||||
async: boolean;
|
||||
sync: boolean;
|
||||
timedOut: boolean;
|
||||
timeout(n: number): this;
|
||||
}
|
||||
|
||||
/** Partial interface for Mocha's `Suite` class. */
|
||||
interface ISuite {
|
||||
parent: ISuite;
|
||||
title: string;
|
||||
/** Partial interface for Mocha's `Suite` class. */
|
||||
interface ISuite {
|
||||
parent: ISuite;
|
||||
title: string;
|
||||
|
||||
fullTitle(): string;
|
||||
}
|
||||
fullTitle(): string;
|
||||
}
|
||||
|
||||
/** Partial interface for Mocha's `Test` class. */
|
||||
interface ITest extends IRunnable {
|
||||
parent: ISuite;
|
||||
pending: boolean;
|
||||
state: 'failed'|'passed'|undefined;
|
||||
/** Partial interface for Mocha's `Test` class. */
|
||||
interface ITest extends IRunnable {
|
||||
parent: ISuite;
|
||||
pending: boolean;
|
||||
state: 'failed' | 'passed' | undefined;
|
||||
|
||||
fullTitle(): string;
|
||||
}
|
||||
fullTitle(): string;
|
||||
}
|
||||
|
||||
interface IBeforeAndAfterContext extends IHookCallbackContext {
|
||||
currentTest: ITest;
|
||||
}
|
||||
interface IBeforeAndAfterContext extends IHookCallbackContext {
|
||||
currentTest: ITest;
|
||||
}
|
||||
|
||||
|
||||
/** Partial interface for Mocha's `Runner` class. */
|
||||
interface IRunner { }
|
||||
/** Partial interface for Mocha's `Runner` class. */
|
||||
interface IRunner { }
|
||||
|
||||
interface IContextDefinition {
|
||||
(description: string, callback: (this: ISuiteCallbackContext) => void): ISuite;
|
||||
only(description: string, callback: (this: ISuiteCallbackContext) => void): ISuite;
|
||||
skip(description: string, callback: (this: ISuiteCallbackContext) => void): void;
|
||||
timeout(ms: number): void;
|
||||
}
|
||||
interface IContextDefinition {
|
||||
(description: string, callback: (this: ISuiteCallbackContext) => void): ISuite;
|
||||
only(description: string, callback: (this: ISuiteCallbackContext) => void): ISuite;
|
||||
skip(description: string, callback: (this: ISuiteCallbackContext) => void): void;
|
||||
timeout(ms: number): void;
|
||||
}
|
||||
|
||||
interface ITestDefinition {
|
||||
(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => any): ITest;
|
||||
only(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => any): ITest;
|
||||
skip(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => any): void;
|
||||
timeout(ms: number): void;
|
||||
state: "failed" | "passed";
|
||||
}
|
||||
interface ITestDefinition {
|
||||
(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => any): ITest;
|
||||
only(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => any): ITest;
|
||||
skip(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => any): void;
|
||||
timeout(ms: number): void;
|
||||
state: "failed" | "passed";
|
||||
}
|
||||
|
||||
export module reporters {
|
||||
export class Base {
|
||||
stats: {
|
||||
suites: number;
|
||||
tests: number;
|
||||
passes: number;
|
||||
pending: number;
|
||||
failures: number;
|
||||
};
|
||||
export module reporters {
|
||||
export class Base {
|
||||
stats: {
|
||||
suites: number;
|
||||
tests: number;
|
||||
passes: number;
|
||||
pending: number;
|
||||
failures: number;
|
||||
};
|
||||
|
||||
constructor(runner: IRunner);
|
||||
}
|
||||
constructor(runner: IRunner);
|
||||
}
|
||||
|
||||
export class Doc extends Base { }
|
||||
export class Dot extends Base { }
|
||||
export class HTML extends Base { }
|
||||
export class HTMLCov extends Base { }
|
||||
export class JSON extends Base { }
|
||||
export class JSONCov extends Base { }
|
||||
export class JSONStream extends Base { }
|
||||
export class Landing extends Base { }
|
||||
export class List extends Base { }
|
||||
export class Markdown extends Base { }
|
||||
export class Min extends Base { }
|
||||
export class Nyan extends Base { }
|
||||
export class Progress extends Base {
|
||||
export class Doc extends Base { }
|
||||
export class Dot extends Base { }
|
||||
export class HTML extends Base { }
|
||||
export class HTMLCov extends Base { }
|
||||
export class JSON extends Base { }
|
||||
export class JSONCov extends Base { }
|
||||
export class JSONStream extends Base { }
|
||||
export class Landing extends Base { }
|
||||
export class List extends Base { }
|
||||
export class Markdown extends Base { }
|
||||
export class Min extends Base { }
|
||||
export class Nyan extends Base { }
|
||||
export class Progress extends Base {
|
||||
/**
|
||||
* @param options.open String used to indicate the start of the progress bar.
|
||||
* @param options.complete String used to indicate a complete test on the progress bar.
|
||||
* @param options.incomplete String used to indicate an incomplete test on the progress bar.
|
||||
* @param options.close String used to indicate the end of the progress bar.
|
||||
*/
|
||||
constructor(runner: IRunner, options?: {
|
||||
open?: string;
|
||||
complete?: string;
|
||||
incomplete?: string;
|
||||
close?: string;
|
||||
});
|
||||
}
|
||||
export class Spec extends Base { }
|
||||
export class TAP extends Base { }
|
||||
export class XUnit extends Base {
|
||||
constructor(runner: IRunner, options?: any);
|
||||
}
|
||||
}
|
||||
constructor(runner: IRunner, options?: {
|
||||
open?: string;
|
||||
complete?: string;
|
||||
incomplete?: string;
|
||||
close?: string;
|
||||
});
|
||||
}
|
||||
export class Spec extends Base { }
|
||||
export class TAP extends Base { }
|
||||
export class XUnit extends Base {
|
||||
constructor(runner: IRunner, options?: any);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare module "mocha" {
|
||||
export = Mocha;
|
||||
export = Mocha;
|
||||
}
|
6380
src/typings/node.d.ts
vendored
6380
src/typings/node.d.ts
vendored
File diff suppressed because it is too large
Load diff
20
src/typings/vscode-xterm.d.ts
vendored
20
src/typings/vscode-xterm.d.ts
vendored
|
@ -214,23 +214,23 @@ declare module 'vscode-xterm' {
|
|||
}
|
||||
|
||||
export interface IEventEmitter {
|
||||
on(type: string, listener: (...args: any[]) => void): void;
|
||||
off(type: string, listener: (...args: any[]) => void): void;
|
||||
emit(type: string, data?: any): void;
|
||||
addDisposableListener(type: string, handler: (...args: any[]) => void): IDisposable;
|
||||
on(type: string, listener: (...args: any[]) => void): void;
|
||||
off(type: string, listener: (...args: any[]) => void): void;
|
||||
emit(type: string, data?: any): void;
|
||||
addDisposableListener(type: string, handler: (...args: any[]) => void): IDisposable;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object that can be disposed via a dispose function.
|
||||
*/
|
||||
export interface IDisposable {
|
||||
dispose(): void;
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
export interface ILocalizableStrings {
|
||||
blankLine: string;
|
||||
promptLabel: string;
|
||||
tooMuchOutput: string;
|
||||
blankLine: string;
|
||||
promptLabel: string;
|
||||
tooMuchOutput: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -308,13 +308,13 @@ declare module 'vscode-xterm' {
|
|||
* @param type The type of the event.
|
||||
* @param listener The listener.
|
||||
*/
|
||||
on(type: 'refresh', listener: (data?: {start: number, end: number}) => void): void;
|
||||
on(type: 'refresh', listener: (data?: { start: number, end: number }) => void): void;
|
||||
/**
|
||||
* Registers an event listener.
|
||||
* @param type The type of the event.
|
||||
* @param listener The listener.
|
||||
*/
|
||||
on(type: 'resize', listener: (data?: {cols: number, rows: number}) => void): void;
|
||||
on(type: 'resize', listener: (data?: { cols: number, rows: number }) => void): void;
|
||||
/**
|
||||
* Registers an event listener.
|
||||
* @param type The type of the event.
|
||||
|
|
2
src/vs/base/common/marked/marked.d.ts
vendored
2
src/vs/base/common/marked/marked.d.ts
vendored
|
@ -73,7 +73,7 @@ export interface MarkedStatic {
|
|||
|
||||
export interface Renderer {
|
||||
prototype: MarkedRenderer;
|
||||
new (): MarkedRenderer;
|
||||
new(): MarkedRenderer;
|
||||
}
|
||||
|
||||
export interface MarkedRenderer {
|
||||
|
|
|
@ -106,9 +106,9 @@ suite('IPC performance', () => {
|
|||
assert.strictEqual(hits, batches);
|
||||
assert.strictEqual(count, batches * size);
|
||||
}, err => assert.fail(err),
|
||||
batch => {
|
||||
hits++;
|
||||
count += batch.length;
|
||||
});
|
||||
batch => {
|
||||
hits++;
|
||||
count += batch.length;
|
||||
});
|
||||
}
|
||||
});
|
|
@ -62,7 +62,7 @@ class ActiveWindowManager implements IDisposable {
|
|||
private disposables: IDisposable[] = [];
|
||||
private _activeWindowId: number;
|
||||
|
||||
constructor( @IWindowsService windowsService: IWindowsService) {
|
||||
constructor(@IWindowsService windowsService: IWindowsService) {
|
||||
windowsService.onWindowOpen(this.setActiveWindow, this, this.disposables);
|
||||
windowsService.onWindowFocus(this.setActiveWindow, this, this.disposables);
|
||||
}
|
||||
|
|
|
@ -144,15 +144,15 @@ class Main {
|
|||
|
||||
return this.extensionManagementService.installFromGallery(extension)
|
||||
.then(
|
||||
() => console.log(localize('successInstall', "Extension '{0}' v{1} was successfully installed!", id, extension.version)),
|
||||
error => {
|
||||
if (isPromiseCanceledError(error)) {
|
||||
console.log(localize('cancelVsixInstall', "Cancelled installing Extension '{0}'.", id));
|
||||
return null;
|
||||
} else {
|
||||
return TPromise.wrapError(error);
|
||||
}
|
||||
});
|
||||
() => console.log(localize('successInstall', "Extension '{0}' v{1} was successfully installed!", id, extension.version)),
|
||||
error => {
|
||||
if (isPromiseCanceledError(error)) {
|
||||
console.log(localize('cancelVsixInstall', "Cancelled installing Extension '{0}'.", id));
|
||||
return null;
|
||||
} else {
|
||||
return TPromise.wrapError(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -19,7 +19,7 @@ export class CodeEditorServiceImpl extends AbstractCodeEditorService {
|
|||
private _decorationOptionProviders: { [key: string]: IModelDecorationOptionsProvider };
|
||||
private _themeService: IThemeService;
|
||||
|
||||
constructor( @IThemeService themeService: IThemeService, styleSheet = dom.createStyleSheet()) {
|
||||
constructor(@IThemeService themeService: IThemeService, styleSheet = dom.createStyleSheet()) {
|
||||
super();
|
||||
this._styleSheet = styleSheet;
|
||||
this._decorationOptionProviders = Object.create(null);
|
||||
|
|
|
@ -24,7 +24,7 @@ export class TokenSelectionSupport {
|
|||
|
||||
private _modelService: IModelService;
|
||||
|
||||
constructor( @IModelService modelService: IModelService) {
|
||||
constructor(@IModelService modelService: IModelService) {
|
||||
this._modelService = modelService;
|
||||
}
|
||||
|
||||
|
|
|
@ -271,7 +271,7 @@ export class ContextKeyService extends AbstractContextKeyService implements ICon
|
|||
|
||||
private _toDispose: IDisposable[] = [];
|
||||
|
||||
constructor( @IConfigurationService configurationService: IConfigurationService) {
|
||||
constructor(@IConfigurationService configurationService: IConfigurationService) {
|
||||
super(0);
|
||||
this._lastContextId = 0;
|
||||
this._contexts = Object.create(null);
|
||||
|
|
|
@ -18,7 +18,7 @@ export interface IDialogChannel extends IChannel {
|
|||
|
||||
export class DialogChannel implements IDialogChannel {
|
||||
|
||||
constructor( @IDialogService private dialogService: IDialogService) {
|
||||
constructor(@IDialogService private dialogService: IDialogService) {
|
||||
}
|
||||
|
||||
call(command: string, args?: any[]): TPromise<any> {
|
||||
|
|
|
@ -149,25 +149,25 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
|||
const identifier = { id: getLocalExtensionIdFromManifest(manifest) };
|
||||
return this.unsetUninstalledAndRemove(identifier.id)
|
||||
.then(
|
||||
() => this.checkOutdated(manifest)
|
||||
.then(validated => {
|
||||
if (validated) {
|
||||
this.logService.info('Installing the extension:', identifier.id);
|
||||
this._onInstallExtension.fire({ identifier, zipPath });
|
||||
return this.getMetadata(getGalleryExtensionId(manifest.publisher, manifest.name))
|
||||
.then(
|
||||
metadata => this.installFromZipPath(identifier, zipPath, metadata, manifest),
|
||||
error => this.installFromZipPath(identifier, zipPath, null, manifest))
|
||||
.then(
|
||||
local => { this.logService.info('Successfully installed the extension:', identifier.id); return local; },
|
||||
e => {
|
||||
this.logService.error('Failed to install the extension:', identifier.id, e.message);
|
||||
return TPromise.wrapError(e);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
e => TPromise.wrapError(new Error(nls.localize('restartCode', "Please restart Code before reinstalling {0}.", manifest.displayName || manifest.name))));
|
||||
() => this.checkOutdated(manifest)
|
||||
.then(validated => {
|
||||
if (validated) {
|
||||
this.logService.info('Installing the extension:', identifier.id);
|
||||
this._onInstallExtension.fire({ identifier, zipPath });
|
||||
return this.getMetadata(getGalleryExtensionId(manifest.publisher, manifest.name))
|
||||
.then(
|
||||
metadata => this.installFromZipPath(identifier, zipPath, metadata, manifest),
|
||||
error => this.installFromZipPath(identifier, zipPath, null, manifest))
|
||||
.then(
|
||||
local => { this.logService.info('Successfully installed the extension:', identifier.id); return local; },
|
||||
e => {
|
||||
this.logService.error('Failed to install the extension:', identifier.id, e.message);
|
||||
return TPromise.wrapError(e);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
e => TPromise.wrapError(new Error(nls.localize('restartCode', "Please restart Code before reinstalling {0}.", manifest.displayName || manifest.name))));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -222,8 +222,8 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
|||
return local;
|
||||
})
|
||||
.then(
|
||||
local => { this._onDidInstallExtension.fire({ identifier, zipPath, local }); return local; },
|
||||
error => { this._onDidInstallExtension.fire({ identifier, zipPath, error }); return TPromise.wrapError(error); }
|
||||
local => { this._onDidInstallExtension.fire({ identifier, zipPath, local }); return local; },
|
||||
error => { this._onDidInstallExtension.fire({ identifier, zipPath, error }); return TPromise.wrapError(error); }
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -231,17 +231,17 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
|||
this.onInstallExtensions([extension]);
|
||||
return this.collectExtensionsToInstall(extension)
|
||||
.then(
|
||||
extensionsToInstall => {
|
||||
if (extensionsToInstall.length > 1) {
|
||||
this.onInstallExtensions(extensionsToInstall.slice(1));
|
||||
}
|
||||
return this.downloadAndInstallExtensions(extensionsToInstall)
|
||||
.then(
|
||||
locals => this.onDidInstallExtensions(extensionsToInstall, locals, [])
|
||||
.then(() => locals.filter(l => areSameExtensions({ id: getGalleryExtensionIdFromLocal(l), uuid: l.identifier.uuid }, extension.identifier)[0])),
|
||||
errors => this.onDidInstallExtensions(extensionsToInstall, [], errors));
|
||||
},
|
||||
error => this.onDidInstallExtensions([extension], [], [error]));
|
||||
extensionsToInstall => {
|
||||
if (extensionsToInstall.length > 1) {
|
||||
this.onInstallExtensions(extensionsToInstall.slice(1));
|
||||
}
|
||||
return this.downloadAndInstallExtensions(extensionsToInstall)
|
||||
.then(
|
||||
locals => this.onDidInstallExtensions(extensionsToInstall, locals, [])
|
||||
.then(() => locals.filter(l => areSameExtensions({ id: getGalleryExtensionIdFromLocal(l), uuid: l.identifier.uuid }, extension.identifier)[0])),
|
||||
errors => this.onDidInstallExtensions(extensionsToInstall, [], errors));
|
||||
},
|
||||
error => this.onDidInstallExtensions([extension], [], [error]));
|
||||
}
|
||||
|
||||
reinstall(extension: ILocalExtension): TPromise<ILocalExtension> {
|
||||
|
@ -254,8 +254,8 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
|||
return this.uninstallExtension(extension)
|
||||
.then(() => this.removeUninstalledExtension(extension)
|
||||
.then(
|
||||
() => this.installFromGallery(galleryExtension),
|
||||
e => TPromise.wrapError(new Error(nls.localize('removeError', "Error while removing the extension: {0}. Please Quit and Start VS Code before trying again.", toErrorMessage(e))))));
|
||||
() => this.installFromGallery(galleryExtension),
|
||||
e => TPromise.wrapError(new Error(nls.localize('removeError', "Error while removing the extension: {0}. Please Quit and Start VS Code before trying again.", toErrorMessage(e))))));
|
||||
}
|
||||
return TPromise.wrapError(new Error(nls.localize('Not a Marketplace extension', "Only Marketplace Extensions can be reinstalled")));
|
||||
});
|
||||
|
@ -269,10 +269,10 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
|||
}
|
||||
return this.getDependenciesToInstall(compatible.properties.dependencies)
|
||||
.then(
|
||||
dependenciesToInstall => ([compatible, ...dependenciesToInstall.filter(d => d.identifier.uuid !== compatible.identifier.uuid)]),
|
||||
error => TPromise.wrapError<IGalleryExtension[]>(new ExtensionManagementError(this.joinErrors(error).message, INSTALL_ERROR_GALLERY)));
|
||||
dependenciesToInstall => ([compatible, ...dependenciesToInstall.filter(d => d.identifier.uuid !== compatible.identifier.uuid)]),
|
||||
error => TPromise.wrapError<IGalleryExtension[]>(new ExtensionManagementError(this.joinErrors(error).message, INSTALL_ERROR_GALLERY)));
|
||||
},
|
||||
error => TPromise.wrapError<IGalleryExtension[]>(new ExtensionManagementError(this.joinErrors(error).message, INSTALL_ERROR_GALLERY)));
|
||||
error => TPromise.wrapError<IGalleryExtension[]>(new ExtensionManagementError(this.joinErrors(error).message, INSTALL_ERROR_GALLERY)));
|
||||
}
|
||||
|
||||
private downloadAndInstallExtensions(extensions: IGalleryExtension[]): TPromise<ILocalExtension[]> {
|
||||
|
@ -294,8 +294,8 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
|||
.then(extension => this.downloadInstallableExtension(extension))
|
||||
.then(installableExtension => this.installExtension(installableExtension))
|
||||
.then(
|
||||
local => { this.installingExtensions.delete(extension.identifier.id); return local; },
|
||||
e => { this.installingExtensions.delete(extension.identifier.id); return TPromise.wrapError(e); }
|
||||
local => { this.installingExtensions.delete(extension.identifier.id); return local; },
|
||||
e => { this.installingExtensions.delete(extension.identifier.id); return TPromise.wrapError(e); }
|
||||
);
|
||||
|
||||
this.installingExtensions.set(extension.identifier.id, installingExtension);
|
||||
|
@ -312,25 +312,25 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
|||
|
||||
return this.galleryService.loadCompatibleVersion(extension)
|
||||
.then(
|
||||
compatible => {
|
||||
if (compatible) {
|
||||
this.logService.trace('Started downloading extension:', extension.name);
|
||||
return this.galleryService.download(extension)
|
||||
.then(
|
||||
zipPath => {
|
||||
this.logService.info('Downloaded extension:', extension.name);
|
||||
return validateLocalExtension(zipPath)
|
||||
.then(
|
||||
manifest => (<InstallableExtension>{ zipPath, id: getLocalExtensionIdFromManifest(manifest), metadata }),
|
||||
error => TPromise.wrapError(new ExtensionManagementError(this.joinErrors(error).message, INSTALL_ERROR_VALIDATING))
|
||||
);
|
||||
},
|
||||
error => TPromise.wrapError(new ExtensionManagementError(this.joinErrors(error).message, INSTALL_ERROR_DOWNLOADING)));
|
||||
} else {
|
||||
return TPromise.wrapError<InstallableExtension>(new ExtensionManagementError(nls.localize('notFoundCompatibleDependency', "Unable to install because, the depending extension '{0}' compatible with current version '{1}' of VS Code is not found.", extension.identifier.id, pkg.version), INSTALL_ERROR_INCOMPATIBLE));
|
||||
}
|
||||
},
|
||||
error => TPromise.wrapError<InstallableExtension>(new ExtensionManagementError(this.joinErrors(error).message, INSTALL_ERROR_GALLERY)));
|
||||
compatible => {
|
||||
if (compatible) {
|
||||
this.logService.trace('Started downloading extension:', extension.name);
|
||||
return this.galleryService.download(extension)
|
||||
.then(
|
||||
zipPath => {
|
||||
this.logService.info('Downloaded extension:', extension.name);
|
||||
return validateLocalExtension(zipPath)
|
||||
.then(
|
||||
manifest => (<InstallableExtension>{ zipPath, id: getLocalExtensionIdFromManifest(manifest), metadata }),
|
||||
error => TPromise.wrapError(new ExtensionManagementError(this.joinErrors(error).message, INSTALL_ERROR_VALIDATING))
|
||||
);
|
||||
},
|
||||
error => TPromise.wrapError(new ExtensionManagementError(this.joinErrors(error).message, INSTALL_ERROR_DOWNLOADING)));
|
||||
} else {
|
||||
return TPromise.wrapError<InstallableExtension>(new ExtensionManagementError(nls.localize('notFoundCompatibleDependency', "Unable to install because, the depending extension '{0}' compatible with current version '{1}' of VS Code is not found.", extension.identifier.id, pkg.version), INSTALL_ERROR_INCOMPATIBLE));
|
||||
}
|
||||
},
|
||||
error => TPromise.wrapError<InstallableExtension>(new ExtensionManagementError(this.joinErrors(error).message, INSTALL_ERROR_GALLERY)));
|
||||
}
|
||||
|
||||
private onInstallExtensions(extensions: IGalleryExtension[]): void {
|
||||
|
@ -379,18 +379,18 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
|||
private installExtension(installableExtension: InstallableExtension): TPromise<ILocalExtension> {
|
||||
return this.unsetUninstalledAndGetLocal(installableExtension.id)
|
||||
.then(
|
||||
local => {
|
||||
if (local) {
|
||||
return local;
|
||||
}
|
||||
return this.extractAndInstall(installableExtension);
|
||||
},
|
||||
e => {
|
||||
if (isMacintosh) {
|
||||
return TPromise.wrapError<ILocalExtension>(new ExtensionManagementError(nls.localize('quitCode', "Unable to install the extension. Please Quit and Start VS Code before reinstalling."), INSTALL_ERROR_UNSET_UNINSTALLED));
|
||||
}
|
||||
return TPromise.wrapError<ILocalExtension>(new ExtensionManagementError(nls.localize('exitCode', "Unable to install the extension. Please Exit and Start VS Code before reinstalling."), INSTALL_ERROR_UNSET_UNINSTALLED));
|
||||
});
|
||||
local => {
|
||||
if (local) {
|
||||
return local;
|
||||
}
|
||||
return this.extractAndInstall(installableExtension);
|
||||
},
|
||||
e => {
|
||||
if (isMacintosh) {
|
||||
return TPromise.wrapError<ILocalExtension>(new ExtensionManagementError(nls.localize('quitCode', "Unable to install the extension. Please Quit and Start VS Code before reinstalling."), INSTALL_ERROR_UNSET_UNINSTALLED));
|
||||
}
|
||||
return TPromise.wrapError<ILocalExtension>(new ExtensionManagementError(nls.localize('exitCode', "Unable to install the extension. Please Exit and Start VS Code before reinstalling."), INSTALL_ERROR_UNSET_UNINSTALLED));
|
||||
});
|
||||
}
|
||||
|
||||
private unsetUninstalledAndGetLocal(id: string): TPromise<ILocalExtension> {
|
||||
|
@ -428,23 +428,23 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
|||
this.logService.trace(`Started extracting the extension from ${zipPath} to ${extractPath}`);
|
||||
return pfs.rimraf(extractPath)
|
||||
.then(
|
||||
() => extract(zipPath, extractPath, options)
|
||||
.then(
|
||||
() => this.logService.info(`Extracted extension to ${extractPath}:`, id),
|
||||
e => always(pfs.rimraf(extractPath), () => null)
|
||||
.then(() => TPromise.wrapError(new ExtensionManagementError(e.message, INSTALL_ERROR_EXTRACTING)))),
|
||||
e => TPromise.wrapError(new ExtensionManagementError(this.joinErrors(e).message, INSTALL_ERROR_DELETING)));
|
||||
() => extract(zipPath, extractPath, options)
|
||||
.then(
|
||||
() => this.logService.info(`Extracted extension to ${extractPath}:`, id),
|
||||
e => always(pfs.rimraf(extractPath), () => null)
|
||||
.then(() => TPromise.wrapError(new ExtensionManagementError(e.message, INSTALL_ERROR_EXTRACTING)))),
|
||||
e => TPromise.wrapError(new ExtensionManagementError(this.joinErrors(e).message, INSTALL_ERROR_DELETING)));
|
||||
}
|
||||
|
||||
private completeInstall(id: string, extractPath: string): TPromise<void> {
|
||||
return this.renameWithRetry(id, extractPath)
|
||||
.then(
|
||||
() => this.logService.info('Installation compelted.', id),
|
||||
e => {
|
||||
this.logService.info('Deleting the extracted extension', id);
|
||||
return always(pfs.rimraf(extractPath), () => null)
|
||||
.then(() => TPromise.wrapError(e));
|
||||
});
|
||||
() => this.logService.info('Installation compelted.', id),
|
||||
e => {
|
||||
this.logService.info('Deleting the extracted extension', id);
|
||||
return always(pfs.rimraf(extractPath), () => null)
|
||||
.then(() => TPromise.wrapError(e));
|
||||
});
|
||||
}
|
||||
|
||||
private renameWithRetry(id: string, extractPath: string): TPromise<void> {
|
||||
|
@ -540,10 +540,10 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
|||
return this.preUninstallExtension(extension)
|
||||
.then(() => this.hasDependencies(extension, installed) ? this.promptForDependenciesAndUninstall(extension, installed, force) : this.promptAndUninstall(extension, installed, force))
|
||||
.then(() => this.postUninstallExtension(extension),
|
||||
error => {
|
||||
this.postUninstallExtension(extension, INSTALL_ERROR_LOCAL);
|
||||
return TPromise.wrapError(error);
|
||||
});
|
||||
error => {
|
||||
this.postUninstallExtension(extension, INSTALL_ERROR_LOCAL);
|
||||
return TPromise.wrapError(error);
|
||||
});
|
||||
}
|
||||
|
||||
private hasDependencies(extension: ILocalExtension, installed: ILocalExtension[]): boolean {
|
||||
|
@ -660,10 +660,10 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
|||
return this.preUninstallExtension(extension)
|
||||
.then(() => this.uninstallExtension(extension))
|
||||
.then(() => this.postUninstallExtension(extension),
|
||||
error => {
|
||||
this.postUninstallExtension(extension, INSTALL_ERROR_LOCAL);
|
||||
return TPromise.wrapError(error);
|
||||
});
|
||||
error => {
|
||||
this.postUninstallExtension(extension, INSTALL_ERROR_LOCAL);
|
||||
return TPromise.wrapError(error);
|
||||
});
|
||||
}
|
||||
|
||||
private preUninstallExtension(extension: ILocalExtension): TPromise<void> {
|
||||
|
|
|
@ -56,7 +56,7 @@ interface IDependentService {
|
|||
|
||||
class DependentService implements IDependentService {
|
||||
_serviceBrand: any;
|
||||
constructor( @IService1 service: IService1) {
|
||||
constructor(@IService1 service: IService1) {
|
||||
assert.equal(service.c, 1);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ class DependentService implements IDependentService {
|
|||
|
||||
class Service1Consumer {
|
||||
|
||||
constructor( @IService1 service1: IService1) {
|
||||
constructor(@IService1 service1: IService1) {
|
||||
assert.ok(service1);
|
||||
assert.equal(service1.c, 1);
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ class Service1Consumer {
|
|||
|
||||
class Target2Dep {
|
||||
|
||||
constructor( @IService1 service1: IService1, @IService2 service2) {
|
||||
constructor(@IService1 service1: IService1, @IService2 service2) {
|
||||
assert.ok(service1 instanceof Service1);
|
||||
assert.ok(service2 instanceof Service2);
|
||||
}
|
||||
|
@ -88,12 +88,12 @@ class TargetWithStaticParam {
|
|||
}
|
||||
|
||||
class TargetNotOptional {
|
||||
constructor( @IService1 service1: IService1, @IService2 service2: IService2) {
|
||||
constructor(@IService1 service1: IService1, @IService2 service2: IService2) {
|
||||
|
||||
}
|
||||
}
|
||||
class TargetOptional {
|
||||
constructor( @IService1 service1: IService1, @optional(IService2) service2: IService2) {
|
||||
constructor(@IService1 service1: IService1, @optional(IService2) service2: IService2) {
|
||||
assert.ok(service1);
|
||||
assert.equal(service1.c, 1);
|
||||
assert.ok(service2 === void 0);
|
||||
|
@ -101,14 +101,14 @@ class TargetOptional {
|
|||
}
|
||||
|
||||
class DependentServiceTarget {
|
||||
constructor( @IDependentService d) {
|
||||
constructor(@IDependentService d) {
|
||||
assert.ok(d);
|
||||
assert.equal(d.name, 'farboo');
|
||||
}
|
||||
}
|
||||
|
||||
class DependentServiceTarget2 {
|
||||
constructor( @IDependentService d: IDependentService, @IService1 s: IService1) {
|
||||
constructor(@IDependentService d: IDependentService, @IService1 s: IService1) {
|
||||
assert.ok(d);
|
||||
assert.equal(d.name, 'farboo');
|
||||
assert.ok(s);
|
||||
|
@ -121,7 +121,7 @@ class ServiceLoop1 implements IService1 {
|
|||
_serviceBrand: any;
|
||||
c = 1;
|
||||
|
||||
constructor( @IService2 s: IService2) {
|
||||
constructor(@IService2 s: IService2) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ class ServiceLoop2 implements IService2 {
|
|||
_serviceBrand: any;
|
||||
d = true;
|
||||
|
||||
constructor( @IService1 s: IService1) {
|
||||
constructor(@IService1 s: IService1) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ export class ListService implements IListService {
|
|||
return this._lastFocusedWidget;
|
||||
}
|
||||
|
||||
constructor( @IContextKeyService contextKeyService: IContextKeyService) { }
|
||||
constructor(@IContextKeyService contextKeyService: IContextKeyService) { }
|
||||
|
||||
register(widget: ListWidget, extraContextKeys?: (IContextKey<boolean>)[]): IDisposable {
|
||||
if (this.lists.some(l => l.widget === widget)) {
|
||||
|
|
|
@ -92,7 +92,7 @@ export class StateService implements IStateService {
|
|||
|
||||
private fileStorage: FileStorage;
|
||||
|
||||
constructor( @IEnvironmentService environmentService: IEnvironmentService, @ILogService logService: ILogService) {
|
||||
constructor(@IEnvironmentService environmentService: IEnvironmentService, @ILogService logService: ILogService) {
|
||||
this.fileStorage = new FileStorage(path.join(environmentService.userDataPath, 'storage.json'), error => logService.error(error));
|
||||
}
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(ChangeEncodingAction,
|
|||
export class QuickOpenActionContributor extends ActionBarContributor {
|
||||
private openToSideActionInstance: OpenToSideAction;
|
||||
|
||||
constructor( @IInstantiationService private instantiationService: IInstantiationService) {
|
||||
constructor(@IInstantiationService private instantiationService: IInstantiationService) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ export class RangeHighlightDecorations implements IDisposable {
|
|||
private _onHighlightRemoved: Emitter<void> = new Emitter<void>();
|
||||
public readonly onHighlghtRemoved: Event<void> = this._onHighlightRemoved.event;
|
||||
|
||||
constructor( @IWorkbenchEditorService private editorService: IWorkbenchEditorService) {
|
||||
constructor(@IWorkbenchEditorService private editorService: IWorkbenchEditorService) {
|
||||
}
|
||||
|
||||
public removeHighlightRange() {
|
||||
|
|
|
@ -74,7 +74,7 @@ export class NotificationsList extends Themable {
|
|||
const renderer = this.instantiationService.createInstance(NotificationRenderer, actionRunner);
|
||||
|
||||
// List
|
||||
this.list = this.instantiationService.createInstance(
|
||||
this.list = <WorkbenchList<INotificationViewItem>>this.instantiationService.createInstance(
|
||||
WorkbenchList,
|
||||
this.listContainer,
|
||||
new NotificationsListDelegate(this.listContainer),
|
||||
|
|
|
@ -523,7 +523,7 @@ class CallStackRenderer implements IRenderer {
|
|||
|
||||
class CallstackAccessibilityProvider implements IAccessibilityProvider {
|
||||
|
||||
constructor( @IWorkspaceContextService private contextService: IWorkspaceContextService) {
|
||||
constructor(@IWorkspaceContextService private contextService: IWorkspaceContextService) {
|
||||
// noop
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ export class Renderer implements IRenderer {
|
|||
private static readonly EXTENSION_TEMPLATE_ID = 'extension-template';
|
||||
private static readonly UNKNOWN_EXTENSION_TEMPLATE_ID = 'unknown-extension-template';
|
||||
|
||||
constructor( @IInstantiationService private instantiationService: IInstantiationService) {
|
||||
constructor(@IInstantiationService private instantiationService: IInstantiationService) {
|
||||
}
|
||||
|
||||
public getHeight(tree: ITree, element: IExtensionDependencies): number {
|
||||
|
@ -198,7 +198,7 @@ class OpenExtensionAction extends Action {
|
|||
|
||||
private _extensionDependencies: IExtensionDependencies;
|
||||
|
||||
constructor( @IExtensionsWorkbenchService private extensionsWorkdbenchService: IExtensionsWorkbenchService) {
|
||||
constructor(@IExtensionsWorkbenchService private extensionsWorkdbenchService: IExtensionsWorkbenchService) {
|
||||
super('extensions.action.openDependency', '');
|
||||
}
|
||||
|
||||
|
|
|
@ -1541,7 +1541,7 @@ export abstract class AbstractConfigureRecommendedExtensionsAction extends Actio
|
|||
selection
|
||||
}
|
||||
})),
|
||||
error => TPromise.wrapError(new Error(localize('OpenExtensionsFile.failed', "Unable to create 'extensions.json' file inside the '.vscode' folder ({0}).", error))));
|
||||
error => TPromise.wrapError(new Error(localize('OpenExtensionsFile.failed', "Unable to create 'extensions.json' file inside the '.vscode' folder ({0}).", error))));
|
||||
}
|
||||
|
||||
protected openWorkspaceConfigurationFile(workspaceConfigurationFile: URI): TPromise<any> {
|
||||
|
|
|
@ -42,7 +42,7 @@ export class ExtensionsHandler extends QuickOpenHandler {
|
|||
|
||||
public static readonly ID = 'workbench.picker.extensions';
|
||||
|
||||
constructor( @IViewletService private viewletService: IViewletService) {
|
||||
constructor(@IViewletService private viewletService: IViewletService) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ export class Model {
|
|||
private _roots: FileStat[];
|
||||
private _listener: IDisposable;
|
||||
|
||||
constructor( @IWorkspaceContextService private contextService: IWorkspaceContextService) {
|
||||
constructor(@IWorkspaceContextService private contextService: IWorkspaceContextService) {
|
||||
const setRoots = () => this._roots = this.contextService.getWorkspace().folders.map(folder => {
|
||||
const root = new FileStat(folder.uri, undefined);
|
||||
root.name = folder.name;
|
||||
|
|
|
@ -94,7 +94,7 @@ export class SwitchOutputAction extends Action {
|
|||
|
||||
public static readonly ID = 'workbench.output.action.switchBetweenOutputs';
|
||||
|
||||
constructor( @IOutputService private outputService: IOutputService) {
|
||||
constructor(@IOutputService private outputService: IOutputService) {
|
||||
super(SwitchOutputAction.ID, nls.localize('switchToOutput.label', "Switch to Output"));
|
||||
|
||||
this.class = 'output-action switch-to-output';
|
||||
|
|
|
@ -50,7 +50,7 @@ export class KeybindingsEditorInput extends EditorInput {
|
|||
public static readonly ID: string = 'workbench.input.keybindings';
|
||||
public readonly keybindingsModel: KeybindingsEditorModel;
|
||||
|
||||
constructor( @IInstantiationService instantiationService: IInstantiationService) {
|
||||
constructor(@IInstantiationService instantiationService: IInstantiationService) {
|
||||
super();
|
||||
this.keybindingsModel = instantiationService.createInstance(KeybindingsEditorModel, OS);
|
||||
}
|
||||
|
@ -210,10 +210,10 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
|
|||
this.reportKeybindingAction(KEYBINDINGS_EDITOR_COMMAND_REMOVE, keybindingEntry.keybindingItem.command, keybindingEntry.keybindingItem.keybinding);
|
||||
return this.keybindingEditingService.removeKeybinding(keybindingEntry.keybindingItem.keybindingItem)
|
||||
.then(() => this.focus(),
|
||||
error => {
|
||||
this.onKeybindingEditingError(error);
|
||||
this.selectEntry(keybindingEntry);
|
||||
});
|
||||
error => {
|
||||
this.onKeybindingEditingError(error);
|
||||
this.selectEntry(keybindingEntry);
|
||||
});
|
||||
}
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
@ -228,10 +228,10 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
|
|||
}
|
||||
this.selectEntry(keybindingEntry);
|
||||
},
|
||||
error => {
|
||||
this.onKeybindingEditingError(error);
|
||||
this.selectEntry(keybindingEntry);
|
||||
});
|
||||
error => {
|
||||
this.onKeybindingEditingError(error);
|
||||
this.selectEntry(keybindingEntry);
|
||||
});
|
||||
}
|
||||
|
||||
copyKeybinding(keybinding: IKeybindingItemEntry): TPromise<any> {
|
||||
|
|
|
@ -211,7 +211,7 @@ export class GotoLineHandler extends QuickOpenHandler {
|
|||
private rangeHighlightDecorationId: IEditorLineDecoration;
|
||||
private lastKnownEditorViewState: IEditorViewState;
|
||||
|
||||
constructor( @IWorkbenchEditorService private editorService: IWorkbenchEditorService) {
|
||||
constructor(@IWorkbenchEditorService private editorService: IWorkbenchEditorService) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ export class HelpHandler extends QuickOpenHandler {
|
|||
|
||||
public static readonly ID = 'workbench.picker.help';
|
||||
|
||||
constructor( @IQuickOpenService private quickOpenService: IQuickOpenService) {
|
||||
constructor(@IQuickOpenService private quickOpenService: IQuickOpenService) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
|
|
@ -1010,7 +1010,7 @@ export class RepositoryPanel extends ViewletPanel {
|
|||
|
||||
class InstallAdditionalSCMProvidersAction extends Action {
|
||||
|
||||
constructor( @IViewletService private viewletService: IViewletService) {
|
||||
constructor(@IViewletService private viewletService: IViewletService) {
|
||||
super('scm.installAdditionalSCMProviders', localize('installAdditionalSCMProviders', "Install Additional SCM Providers..."), '', true);
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ export class OpenSymbolHandler extends QuickOpenHandler {
|
|||
private delayer: ThrottledDelayer<QuickOpenEntry[]>;
|
||||
private options: IOpenSymbolOptions;
|
||||
|
||||
constructor( @IInstantiationService private instantiationService: IInstantiationService) {
|
||||
constructor(@IInstantiationService private instantiationService: IInstantiationService) {
|
||||
super();
|
||||
|
||||
this.delayer = new ThrottledDelayer<QuickOpenEntry[]>(OpenSymbolHandler.SEARCH_DELAY);
|
||||
|
|
|
@ -31,7 +31,7 @@ export class SearchDataSource implements IDataSource {
|
|||
private includeFolderMatch: boolean;
|
||||
private listener: IDisposable;
|
||||
|
||||
constructor( @IWorkspaceContextService private contextService: IWorkspaceContextService) {
|
||||
constructor(@IWorkspaceContextService private contextService: IWorkspaceContextService) {
|
||||
this.updateIncludeFolderMatch();
|
||||
this.listener = this.contextService.onDidChangeWorkbenchState(() => this.updateIncludeFolderMatch());
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ export class SearchRenderer extends Disposable implements IRenderer {
|
|||
|
||||
export class SearchAccessibilityProvider implements IAccessibilityProvider {
|
||||
|
||||
constructor( @IWorkspaceContextService private contextService: IWorkspaceContextService) {
|
||||
constructor(@IWorkspaceContextService private contextService: IWorkspaceContextService) {
|
||||
}
|
||||
|
||||
public getAriaLabel(tree: ITree, element: FileMatchOrMatch): string {
|
||||
|
|
|
@ -687,7 +687,7 @@ export class SearchModel extends Disposable {
|
|||
|
||||
private currentRequest: PPromise<ISearchComplete, ISearchProgressItem>;
|
||||
|
||||
constructor( @ISearchService private searchService: ISearchService, @ITelemetryService private telemetryService: ITelemetryService, @IInstantiationService private instantiationService: IInstantiationService) {
|
||||
constructor(@ISearchService private searchService: ISearchService, @ITelemetryService private telemetryService: ITelemetryService, @IInstantiationService private instantiationService: IInstantiationService) {
|
||||
super();
|
||||
this._searchResult = this.instantiationService.createInstance(SearchResult, this);
|
||||
}
|
||||
|
@ -829,7 +829,7 @@ export class SearchWorkbenchService implements ISearchWorkbenchService {
|
|||
_serviceBrand: any;
|
||||
private _searchModel: SearchModel;
|
||||
|
||||
constructor( @IInstantiationService private instantiationService: IInstantiationService) {
|
||||
constructor(@IInstantiationService private instantiationService: IInstantiationService) {
|
||||
}
|
||||
|
||||
get searchModel(): SearchModel {
|
||||
|
|
|
@ -200,7 +200,7 @@ export class QuickOpenActionContributor extends ActionBarContributor {
|
|||
|
||||
private action: CustomizeTaskAction;
|
||||
|
||||
constructor( @ITaskService taskService: ITaskService, @IQuickOpenService quickOpenService: IQuickOpenService) {
|
||||
constructor(@ITaskService taskService: ITaskService, @IQuickOpenService quickOpenService: IQuickOpenService) {
|
||||
super();
|
||||
this.action = new CustomizeTaskAction(taskService, quickOpenService);
|
||||
}
|
||||
|
|
|
@ -77,9 +77,9 @@ export class SelectColorThemeAction extends Action {
|
|||
|
||||
return this.quickOpenService.pick(picks, { placeHolder, autoFocus: { autoFocusIndex } })
|
||||
.then(
|
||||
theme => delayer.trigger(() => selectTheme(theme || currentTheme, true), 0),
|
||||
null,
|
||||
theme => delayer.trigger(() => selectTheme(theme, false))
|
||||
theme => delayer.trigger(() => selectTheme(theme || currentTheme, true), 0),
|
||||
null,
|
||||
theme => delayer.trigger(() => selectTheme(theme, false))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -135,9 +135,9 @@ class SelectIconThemeAction extends Action {
|
|||
|
||||
return this.quickOpenService.pick(picks, { placeHolder, autoFocus: { autoFocusIndex } })
|
||||
.then(
|
||||
theme => delayer.trigger(() => selectTheme(theme || currentTheme, true), 0),
|
||||
null,
|
||||
theme => delayer.trigger(() => selectTheme(theme, false))
|
||||
theme => delayer.trigger(() => selectTheme(theme || currentTheme, true), 0),
|
||||
null,
|
||||
theme => delayer.trigger(() => selectTheme(theme, false))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -28,12 +28,12 @@ Registry.as<IEditorRegistry>(EditorExtensions.Editors)
|
|||
WalkThroughPart.ID,
|
||||
localize('walkThrough.editor.label', "Interactive Playground"),
|
||||
),
|
||||
[new SyncDescriptor(WalkThroughInput)]);
|
||||
[new SyncDescriptor(WalkThroughInput)]);
|
||||
|
||||
Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions)
|
||||
.registerWorkbenchAction(
|
||||
new SyncActionDescriptor(EditorWalkThroughAction, EditorWalkThroughAction.ID, EditorWalkThroughAction.LABEL),
|
||||
'Help: Interactive Playground', localize('help', "Help"));
|
||||
new SyncActionDescriptor(EditorWalkThroughAction, EditorWalkThroughAction.ID, EditorWalkThroughAction.LABEL),
|
||||
'Help: Interactive Playground', localize('help', "Help"));
|
||||
|
||||
Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactories).registerEditorInputFactory(EditorWalkThroughInputFactory.ID, EditorWalkThroughInputFactory);
|
||||
|
||||
|
|
|
@ -137,12 +137,12 @@ export class ConfigurationEditingService {
|
|||
const operation = this.getConfigurationEditOperation(target, value, options.scopes || {});
|
||||
return this.queue.queue(() => this.doWriteConfiguration(operation, options) // queue up writes to prevent race conditions
|
||||
.then(() => null,
|
||||
error => {
|
||||
if (!options.donotNotifyError) {
|
||||
this.onError(error, operation, options.scopes);
|
||||
}
|
||||
return TPromise.wrapError(error);
|
||||
}));
|
||||
error => {
|
||||
if (!options.donotNotifyError) {
|
||||
this.onError(error, operation, options.scopes);
|
||||
}
|
||||
return TPromise.wrapError(error);
|
||||
}));
|
||||
}
|
||||
|
||||
private doWriteConfiguration(operation: IConfigurationEditOperation, options: ConfigurationEditingOptions): TPromise<void> {
|
||||
|
|
|
@ -141,34 +141,34 @@ suite('ConfigurationEditingService', function () {
|
|||
test('errors cases - invalid key', () => {
|
||||
return testObject.writeConfiguration(ConfigurationTarget.WORKSPACE, { key: 'unknown.key', value: 'value' })
|
||||
.then(() => assert.fail('Should fail with ERROR_UNKNOWN_KEY'),
|
||||
(error: ConfigurationEditingError) => assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_UNKNOWN_KEY));
|
||||
(error: ConfigurationEditingError) => assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_UNKNOWN_KEY));
|
||||
});
|
||||
|
||||
test('errors cases - invalid target', () => {
|
||||
return testObject.writeConfiguration(ConfigurationTarget.USER, { key: 'tasks.something', value: 'value' })
|
||||
.then(() => assert.fail('Should fail with ERROR_INVALID_TARGET'),
|
||||
(error: ConfigurationEditingError) => assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_INVALID_USER_TARGET));
|
||||
(error: ConfigurationEditingError) => assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_INVALID_USER_TARGET));
|
||||
});
|
||||
|
||||
test('errors cases - no workspace', () => {
|
||||
return setUpServices(true)
|
||||
.then(() => testObject.writeConfiguration(ConfigurationTarget.WORKSPACE, { key: 'configurationEditing.service.testSetting', value: 'value' }))
|
||||
.then(() => assert.fail('Should fail with ERROR_NO_WORKSPACE_OPENED'),
|
||||
(error: ConfigurationEditingError) => assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_NO_WORKSPACE_OPENED));
|
||||
(error: ConfigurationEditingError) => assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_NO_WORKSPACE_OPENED));
|
||||
});
|
||||
|
||||
test('errors cases - invalid configuration', () => {
|
||||
fs.writeFileSync(globalSettingsFile, ',,,,,,,,,,,,,,');
|
||||
return testObject.writeConfiguration(ConfigurationTarget.USER, { key: 'configurationEditing.service.testSetting', value: 'value' })
|
||||
.then(() => assert.fail('Should fail with ERROR_INVALID_CONFIGURATION'),
|
||||
(error: ConfigurationEditingError) => assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION));
|
||||
(error: ConfigurationEditingError) => assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION));
|
||||
});
|
||||
|
||||
test('errors cases - dirty', () => {
|
||||
instantiationService.stub(ITextFileService, 'isDirty', true);
|
||||
return testObject.writeConfiguration(ConfigurationTarget.USER, { key: 'configurationEditing.service.testSetting', value: 'value' })
|
||||
.then(() => assert.fail('Should fail with ERROR_CONFIGURATION_FILE_DIRTY error.'),
|
||||
(error: ConfigurationEditingError) => assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY));
|
||||
(error: ConfigurationEditingError) => assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY));
|
||||
});
|
||||
|
||||
test('dirty error is not thrown if not asked to save', () => {
|
||||
|
@ -183,10 +183,10 @@ suite('ConfigurationEditingService', function () {
|
|||
instantiationService.stub(INotificationService, <INotificationService>{ prompt: target, _serviceBrand: null, notify: null, error: null, info: null, warn: null });
|
||||
return testObject.writeConfiguration(ConfigurationTarget.USER, { key: 'configurationEditing.service.testSetting', value: 'value' }, { donotNotifyError: true })
|
||||
.then(() => assert.fail('Should fail with ERROR_CONFIGURATION_FILE_DIRTY error.'),
|
||||
(error: ConfigurationEditingError) => {
|
||||
assert.equal(false, target.calledOnce);
|
||||
assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY);
|
||||
});
|
||||
(error: ConfigurationEditingError) => {
|
||||
assert.equal(false, target.calledOnce);
|
||||
assert.equal(error.code, ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY);
|
||||
});
|
||||
});
|
||||
|
||||
test('write one setting - empty file', () => {
|
||||
|
|
|
@ -109,28 +109,28 @@ suite('Keybindings Editing', () => {
|
|||
fs.writeFileSync(keybindingsFile, ',,,,,,,,,,,,,,');
|
||||
return testObject.editKeybinding('alt+c', aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape } }))
|
||||
.then(() => assert.fail('Should fail with parse errors'),
|
||||
error => assert.equal(error.message, 'Unable to write to the keybindings configuration file. Please open it to correct errors/warnings in the file and try again.'));
|
||||
error => assert.equal(error.message, 'Unable to write to the keybindings configuration file. Please open it to correct errors/warnings in the file and try again.'));
|
||||
});
|
||||
|
||||
test('errors cases - parse errors 2', () => {
|
||||
fs.writeFileSync(keybindingsFile, '[{"key": }]');
|
||||
return testObject.editKeybinding('alt+c', aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape } }))
|
||||
.then(() => assert.fail('Should fail with parse errors'),
|
||||
error => assert.equal(error.message, 'Unable to write to the keybindings configuration file. Please open it to correct errors/warnings in the file and try again.'));
|
||||
error => assert.equal(error.message, 'Unable to write to the keybindings configuration file. Please open it to correct errors/warnings in the file and try again.'));
|
||||
});
|
||||
|
||||
test('errors cases - dirty', () => {
|
||||
instantiationService.stub(ITextFileService, 'isDirty', true);
|
||||
return testObject.editKeybinding('alt+c', aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape } }))
|
||||
.then(() => assert.fail('Should fail with dirty error'),
|
||||
error => assert.equal(error.message, 'Unable to write because the keybindings configuration file is dirty. Please save it first and then try again.'));
|
||||
error => assert.equal(error.message, 'Unable to write because the keybindings configuration file is dirty. Please save it first and then try again.'));
|
||||
});
|
||||
|
||||
test('errors cases - did not find an array', () => {
|
||||
fs.writeFileSync(keybindingsFile, '{"key": "alt+c", "command": "hello"}');
|
||||
return testObject.editKeybinding('alt+c', aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape } }))
|
||||
.then(() => assert.fail('Should fail with dirty error'),
|
||||
error => assert.equal(error.message, 'Unable to write to the keybindings configuration file. It has an object which is not of type Array. Please open the file to clean up and try again.'));
|
||||
error => assert.equal(error.message, 'Unable to write to the keybindings configuration file. It has an object which is not of type Array. Please open the file to clean up and try again.'));
|
||||
});
|
||||
|
||||
test('edit a default keybinding to an empty file', () => {
|
||||
|
|
|
@ -92,7 +92,7 @@ export class SCMService implements ISCMService {
|
|||
private _onDidRemoveProvider = new Emitter<ISCMRepository>();
|
||||
get onDidRemoveRepository(): Event<ISCMRepository> { return this._onDidRemoveProvider.event; }
|
||||
|
||||
constructor( @ILogService private logService: ILogService) { }
|
||||
constructor(@ILogService private logService: ILogService) { }
|
||||
|
||||
registerSCMProvider(provider: ISCMProvider): ISCMRepository {
|
||||
this.logService.trace('SCMService#registerSCMProvider');
|
||||
|
|
|
@ -1082,7 +1082,7 @@ export class SaveSequentializer {
|
|||
|
||||
class DefaultSaveErrorHandler implements ISaveErrorHandler {
|
||||
|
||||
constructor( @INotificationService private notificationService: INotificationService) { }
|
||||
constructor(@INotificationService private notificationService: INotificationService) { }
|
||||
|
||||
public onSaveError(error: any, model: TextFileEditorModel): void {
|
||||
this.notificationService.error(nls.localize('genericSaveError', "Failed to save '{0}': {1}", paths.basename(model.getResource().fsPath), toErrorMessage(error, false)));
|
||||
|
|
|
@ -19,7 +19,7 @@ import { IModelService } from 'vs/editor/common/services/modelService';
|
|||
import { timeout } from 'vs/base/common/async';
|
||||
|
||||
class ServiceAccessor {
|
||||
constructor( @ITextFileService public textFileService: TestTextFileService, @IModelService public modelService: IModelService, @IFileService public fileService: TestFileService) {
|
||||
constructor(@ITextFileService public textFileService: TestTextFileService, @IModelService public modelService: IModelService, @IFileService public fileService: TestFileService) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ export class ColorThemeStore {
|
|||
|
||||
public get onDidChange(): Event<ColorThemeData[]> { return this.onDidChangeEmitter.event; }
|
||||
|
||||
constructor( @IExtensionService private extensionService: IExtensionService, defaultTheme: ColorThemeData) {
|
||||
constructor(@IExtensionService private extensionService: IExtensionService, defaultTheme: ColorThemeData) {
|
||||
this.extensionsColorThemes = [defaultTheme];
|
||||
this.onDidChangeEmitter = new Emitter<ColorThemeData[]>();
|
||||
this.initialize();
|
||||
|
|
|
@ -45,7 +45,7 @@ export class FileIconThemeStore {
|
|||
|
||||
public get onDidChange(): Event<FileIconThemeData[]> { return this.onDidChangeEmitter.event; }
|
||||
|
||||
constructor( @IExtensionService private extensionService: IExtensionService) {
|
||||
constructor(@IExtensionService private extensionService: IExtensionService) {
|
||||
this.knownIconThemes = [];
|
||||
this.onDidChangeEmitter = new Emitter<FileIconThemeData[]>();
|
||||
this.initialize();
|
||||
|
|
|
@ -465,7 +465,7 @@ colorThemeSchema.register();
|
|||
fileIconThemeSchema.register();
|
||||
|
||||
class ConfigurationWriter {
|
||||
constructor( @IConfigurationService private configurationService: IConfigurationService) {
|
||||
constructor(@IConfigurationService private configurationService: IConfigurationService) {
|
||||
}
|
||||
|
||||
public writeConfiguration(key: string, value: any, settingsTarget: ConfigurationTarget): TPromise<void> {
|
||||
|
|
|
@ -27,7 +27,7 @@ let EditorInputRegistry: IEditorInputFactoryRegistry = Platform.Registry.as(Edit
|
|||
|
||||
export class MyEditor extends BaseEditor {
|
||||
|
||||
constructor( @ITelemetryService telemetryService: ITelemetryService) {
|
||||
constructor(@ITelemetryService telemetryService: ITelemetryService) {
|
||||
super('MyEditor', NullTelemetryService, NullThemeService);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ export class MyEditor extends BaseEditor {
|
|||
|
||||
export class MyOtherEditor extends BaseEditor {
|
||||
|
||||
constructor( @ITelemetryService telemetryService: ITelemetryService) {
|
||||
constructor(@ITelemetryService telemetryService: ITelemetryService) {
|
||||
super('myOtherEditor', NullTelemetryService, NullThemeService);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestSe
|
|||
import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
class ServiceAccessor {
|
||||
constructor( @IUntitledEditorService public untitledEditorService: UntitledEditorService) {
|
||||
constructor(@IUntitledEditorService public untitledEditorService: UntitledEditorService) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/commo
|
|||
import { snapshotToString } from 'vs/platform/files/common/files';
|
||||
|
||||
class ServiceAccessor {
|
||||
constructor( @ITextFileService public textFileService: TestTextFileService, @IModelService public modelService: IModelService) {
|
||||
constructor(@ITextFileService public textFileService: TestTextFileService, @IModelService public modelService: IModelService) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
80
yarn.lock
80
yarn.lock
|
@ -13,6 +13,12 @@
|
|||
normalize-path "^2.0.1"
|
||||
through2 "^2.0.3"
|
||||
|
||||
"@types/commander@^2.11.0":
|
||||
version "2.12.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/commander/-/commander-2.12.2.tgz#183041a23842d4281478fa5d23c5ca78e6fd08ae"
|
||||
dependencies:
|
||||
commander "*"
|
||||
|
||||
"@types/keytar@4.0.1":
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/keytar/-/keytar-4.0.1.tgz#e2cf6405dc33861424e59b67516c66d2cf7bc21b"
|
||||
|
@ -29,6 +35,10 @@
|
|||
version "4.2.22"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-4.2.22.tgz#cf488a0f6b4a9c245d09927f4f757ca278b9c8ce"
|
||||
|
||||
"@types/semver@^5.4.0":
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45"
|
||||
|
||||
"@types/sinon@1.16.34":
|
||||
version "1.16.34"
|
||||
resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-1.16.34.tgz#a9761fff33d0f7b3fe61875b577778a2576a9a03"
|
||||
|
@ -417,10 +427,6 @@ bl@~1.1.2:
|
|||
dependencies:
|
||||
readable-stream "~2.0.5"
|
||||
|
||||
bluebird@^3.0.5:
|
||||
version "3.5.1"
|
||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
|
||||
|
||||
body-parser@1.18.2:
|
||||
version "1.18.2"
|
||||
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454"
|
||||
|
@ -790,6 +796,10 @@ combined-stream@~0.0.4:
|
|||
dependencies:
|
||||
delayed-stream "0.0.5"
|
||||
|
||||
commander@*, commander@^2.11.0:
|
||||
version "2.15.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.0.tgz#ad2a23a1c3b036e392469b8012cec6b33b4c1322"
|
||||
|
||||
commander@0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-0.6.1.tgz#fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06"
|
||||
|
@ -1255,14 +1265,15 @@ ecc-jsbn@~0.1.1:
|
|||
dependencies:
|
||||
jsbn "~0.1.0"
|
||||
|
||||
editorconfig@^0.13.2:
|
||||
version "0.13.3"
|
||||
resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.13.3.tgz#e5219e587951d60958fd94ea9a9a008cdeff1b34"
|
||||
editorconfig@^0.15.0:
|
||||
version "0.15.0"
|
||||
resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.15.0.tgz#b6dd4a0b6b9e76ce48e066bdc15381aebb8804fd"
|
||||
dependencies:
|
||||
bluebird "^3.0.5"
|
||||
commander "^2.9.0"
|
||||
lru-cache "^3.2.0"
|
||||
semver "^5.1.0"
|
||||
"@types/commander" "^2.11.0"
|
||||
"@types/semver" "^5.4.0"
|
||||
commander "^2.11.0"
|
||||
lru-cache "^4.1.1"
|
||||
semver "^5.4.1"
|
||||
sigmund "^1.0.1"
|
||||
|
||||
ee-first@1.1.1:
|
||||
|
@ -1984,13 +1995,6 @@ glob-base@^0.3.0:
|
|||
glob-parent "^2.0.0"
|
||||
is-glob "^2.0.0"
|
||||
|
||||
glob-expand@^0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/glob-expand/-/glob-expand-0.2.1.tgz#1b088ac272b57158870b76816111da4618a66a0f"
|
||||
dependencies:
|
||||
glob "~4.5.x"
|
||||
lodash "~4.13.x"
|
||||
|
||||
glob-parent@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28"
|
||||
|
@ -2057,7 +2061,7 @@ glob@5.x, glob@^5.0.13, glob@^5.0.3:
|
|||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
glob@^4.3.1, glob@~4.5.x:
|
||||
glob@^4.3.1:
|
||||
version "4.5.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-4.5.3.tgz#c6cb73d3226c1efef04de3c56d012f03377ee15f"
|
||||
dependencies:
|
||||
|
@ -3545,10 +3549,6 @@ lodash@~2.4.1:
|
|||
version "2.4.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.4.2.tgz#fadd834b9683073da179b3eae6d9c0d15053f73e"
|
||||
|
||||
lodash@~4.13.x:
|
||||
version "4.13.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.13.1.tgz#83e4b10913f48496d4d16fec4a560af2ee744b68"
|
||||
|
||||
log-driver@1.2.5:
|
||||
version "1.2.5"
|
||||
resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056"
|
||||
|
@ -3572,12 +3572,6 @@ lru-cache@2:
|
|||
version "2.7.3"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952"
|
||||
|
||||
lru-cache@^3.2.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-3.2.0.tgz#71789b3b7f5399bec8565dda38aa30d2a097efee"
|
||||
dependencies:
|
||||
pseudomap "^1.0.1"
|
||||
|
||||
lru-cache@^4.0.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55"
|
||||
|
@ -3585,6 +3579,13 @@ lru-cache@^4.0.1:
|
|||
pseudomap "^1.0.2"
|
||||
yallist "^2.1.2"
|
||||
|
||||
lru-cache@^4.1.1:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.2.tgz#45234b2e6e2f2b33da125624c4664929a0224c3f"
|
||||
dependencies:
|
||||
pseudomap "^1.0.2"
|
||||
yallist "^2.1.2"
|
||||
|
||||
macaddress@^0.2.8:
|
||||
version "0.2.8"
|
||||
resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12"
|
||||
|
@ -4623,7 +4624,7 @@ proxy-addr@~2.0.2:
|
|||
forwarded "~0.1.2"
|
||||
ipaddr.js "1.5.2"
|
||||
|
||||
pseudomap@^1.0.1, pseudomap@^1.0.2:
|
||||
pseudomap@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
|
||||
|
||||
|
@ -5079,6 +5080,10 @@ semver@4.3.6, semver@^4.1.0, semver@^4.3.4:
|
|||
version "4.3.6"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da"
|
||||
|
||||
semver@^5.4.1:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||
|
||||
send@0.16.1:
|
||||
version "0.16.1"
|
||||
resolved "https://registry.yarnpkg.com/send/-/send-0.16.1.tgz#a70e1ca21d1382c11d0d9f6231deb281080d7ab3"
|
||||
|
@ -5675,17 +5680,16 @@ typedarray@^0.0.6:
|
|||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
|
||||
typescript-formatter@4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/typescript-formatter/-/typescript-formatter-4.0.1.tgz#ed82daf856cc9a379bb16b7f1aac9affee2974cd"
|
||||
typescript-formatter@7.1.0:
|
||||
version "7.1.0"
|
||||
resolved "https://registry.yarnpkg.com/typescript-formatter/-/typescript-formatter-7.1.0.tgz#dd1b5547de211065221f765263e15f18c84c66b8"
|
||||
dependencies:
|
||||
commandpost "^1.0.0"
|
||||
editorconfig "^0.13.2"
|
||||
glob-expand "^0.2.1"
|
||||
editorconfig "^0.15.0"
|
||||
|
||||
typescript@2.6.1:
|
||||
version "2.6.1"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.1.tgz#ef39cdea27abac0b500242d6726ab90e0c846631"
|
||||
typescript@2.7.2:
|
||||
version "2.7.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836"
|
||||
|
||||
typescript@^2.6.2:
|
||||
version "2.6.2"
|
||||
|
|
Loading…
Reference in a new issue