Skip to content

Commit

Permalink
Build VSCode using TS 2.4 (#30473)
Browse files Browse the repository at this point in the history
* Build VSCode using TS 2.4.1

Fixes #28643

a

* Reformat a few files for 2.4

* Fix compile errors in jsoneditingservice
  • Loading branch information
mjbvz authored Jul 12, 2017
1 parent a5f3583 commit 5da27ba
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 30 deletions.
2 changes: 1 addition & 1 deletion build/monaco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"sinon": "^1.17.2",
"source-map": "^0.4.4",
"tslint": "^4.3.1",
"typescript": "2.3.2",
"typescript": "2.4.1",
"typescript-formatter": "4.0.1",
"underscore": "^1.8.2",
"vinyl": "^0.4.5",
Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"documentdb": "^1.11.0",
"mime": "^1.3.4",
"minimist": "^1.2.0",
"typescript": "2.3.4",
"typescript": "2.4.1",
"xml2js": "^0.4.17"
},
"scripts": {
Expand Down
8 changes: 5 additions & 3 deletions build/tfs/common/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ async function doesAssetExist(blobService: azure.BlobService, quality: string, b
}

async function uploadBlob(blobService: azure.BlobService, quality: string, blobName: string, file: string): Promise<void> {
const blobOptions = {
contentType: mime.lookup(file),
cacheControl: 'max-age=31536000, public'
const blobOptions: azure.BlobService.CreateBlockBlobRequestOptions = {
contentSettings: {
contentType: mime.lookup(file),
cacheControl: 'max-age=31536000, public'
}
};

await new Promise((c, e) => blobService.createBlockBlobFromLocalFile(quality, blobName, file, blobOptions, err => err ? e(err) : c()));
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"gulp-replace": "^0.5.4",
"gulp-shell": "^0.5.2",
"gulp-sourcemaps": "^1.11.0",
"gulp-tsb": "^2.0.3",
"gulp-tsb": "^2.0.4",
"gulp-tslint": "^7.0.1",
"gulp-uglify": "^3.0.0",
"gulp-util": "^3.0.6",
Expand All @@ -107,7 +107,7 @@
"sinon": "^1.17.2",
"source-map": "^0.4.4",
"tslint": "^4.3.1",
"typescript": "2.3.3",
"typescript": "2.4.1",
"typescript-formatter": "4.0.1",
"uglify-es": "^3.0.18",
"underscore": "^1.8.2",
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/browser/controller/mouseTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ interface IETextRange {

declare var IETextRange: {
prototype: IETextRange;
new (): IETextRange;
new(): IETextRange;
};

interface IHitTestResult {
Expand Down
6 changes: 3 additions & 3 deletions src/vs/editor/common/editorCommonExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface IContributionCommandOptions<T> extends ICommandOptions {
handler: (controller: T) => void;
}
export interface EditorControllerCommand<T extends editorCommon.IEditorContribution> {
new (opts: IContributionCommandOptions<T>): EditorCommand;
new(opts: IContributionCommandOptions<T>): EditorCommand;
}
export abstract class EditorCommand extends Command {

Expand Down Expand Up @@ -202,11 +202,11 @@ export abstract class EditorAction extends EditorCommand {

// --- Registration of commands and actions

export function editorAction(ctor: { new (): EditorAction; }): void {
export function editorAction(ctor: { new(): EditorAction; }): void {
CommonEditorRegistry.registerEditorAction(new ctor());
}

export function editorCommand(ctor: { new (): EditorCommand }): void {
export function editorCommand(ctor: { new(): EditorCommand }): void {
registerEditorCommand(new ctor());
}

Expand Down
18 changes: 9 additions & 9 deletions src/vs/platform/instantiation/common/instantiation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,39 @@ export namespace _util {
// --- interfaces ------

export interface IConstructorSignature0<T> {
new (...services: { _serviceBrand: any; }[]): T;
new(...services: { _serviceBrand: any; }[]): T;
}

export interface IConstructorSignature1<A1, T> {
new (first: A1, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, ...services: { _serviceBrand: any; }[]): T;
}

export interface IConstructorSignature2<A1, A2, T> {
new (first: A1, second: A2, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, ...services: { _serviceBrand: any; }[]): T;
}

export interface IConstructorSignature3<A1, A2, A3, T> {
new (first: A1, second: A2, third: A3, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, third: A3, ...services: { _serviceBrand: any; }[]): T;
}

export interface IConstructorSignature4<A1, A2, A3, A4, T> {
new (first: A1, second: A2, third: A3, fourth: A4, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, ...services: { _serviceBrand: any; }[]): T;
}

export interface IConstructorSignature5<A1, A2, A3, A4, A5, T> {
new (first: A1, second: A2, third: A3, fourth: A4, fifth: A5, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, ...services: { _serviceBrand: any; }[]): T;
}

export interface IConstructorSignature6<A1, A2, A3, A4, A5, A6, T> {
new (first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, ...services: { _serviceBrand: any; }[]): T;
}

export interface IConstructorSignature7<A1, A2, A3, A4, A5, A6, A7, T> {
new (first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, ...services: { _serviceBrand: any; }[]): T;
}

export interface IConstructorSignature8<A1, A2, A3, A4, A5, A6, A7, A8, T> {
new (first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, eigth: A8, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, eigth: A8, ...services: { _serviceBrand: any; }[]): T;
}

export interface ServicesAccessor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,8 @@ suite('TelemetryService', () => {
_serviceBrand: undefined,
getConfiguration() {
return {
enableTelemetry
};
enableTelemetry: enableTelemetry
} as any;
},
getConfigurationData(): any {
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/api/node/extHostLanguageFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ export class ExtHostLanguageFeatures extends ExtHostLanguageFeaturesShape {
return ExtHostLanguageFeatures._handlePool++;
}

private _withAdapter<A, R>(handle: number, ctor: { new (...args: any[]): A }, callback: (adapter: A) => TPromise<R>): TPromise<R> {
private _withAdapter<A, R>(handle: number, ctor: { new(...args: any[]): A }, callback: (adapter: A) => TPromise<R>): TPromise<R> {
let adapter = this._adapter.get(handle);
if (!(adapter instanceof ctor)) {
return TPromise.wrapError<R>(new Error('no adapter found'));
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/parts/views/browser/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface IViewOptions {

export interface IViewConstructorSignature {

new (options: IViewOptions, ...services: { _serviceBrand: any; }[]): IView;
new(options: IViewOptions, ...services: { _serviceBrand: any; }[]): IView;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export class ConfigurationEditingService implements IConfigurationEditingService
if (checkDirty && this.textFileService.isDirty(operation.resource)) {
return this.wrapError(ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY, target);
}
return reference;
return TPromise.wrap(reference);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,20 @@ export class JSONEditingService implements IJSONEditingService {
const model = reference.object.textEditorModel;

if (this.hasParseErrors(model)) {
return this.wrapError(JSONEditingErrorCode.ERROR_INVALID_FILE);
return this.wrapError<IReference<ITextEditorModel>>(JSONEditingErrorCode.ERROR_INVALID_FILE);
}

// Target cannot be dirty if not writing into buffer
if (checkDirty && this.textFileService.isDirty(resource)) {
return this.wrapError(JSONEditingErrorCode.ERROR_FILE_DIRTY);
return this.wrapError<IReference<ITextEditorModel>>(JSONEditingErrorCode.ERROR_FILE_DIRTY);
}
return reference;
});
}

private wrapError(code: JSONEditingErrorCode): TPromise<never> {
private wrapError<T>(code: JSONEditingErrorCode): TPromise<T> {
const message = this.toErrorMessage(code);
return TPromise.wrapError<never>(new JSONEditingError(message, code));
return TPromise.wrapError<T>(new JSONEditingError(message, code));
}

private toErrorMessage(error: JSONEditingErrorCode): string {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/services/search/node/rawSearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class SearchService implements IRawSearchService {
return this.doTextSearch(engine, SearchService.BATCH_SIZE);
}

public doFileSearch(EngineClass: { new (config: IRawSearch): ISearchEngine<IRawFileMatch>; }, config: IRawSearch, batchSize?: number): PPromise<ISerializedSearchComplete, ISerializedSearchProgressItem> {
public doFileSearch(EngineClass: { new(config: IRawSearch): ISearchEngine<IRawFileMatch>; }, config: IRawSearch, batchSize?: number): PPromise<ISerializedSearchComplete, ISerializedSearchProgressItem> {

if (config.sortByScore) {
let sortedSearch = this.trySortedSearchFromCache(config);
Expand Down

0 comments on commit 5da27ba

Please sign in to comment.