From 16ba6ba4a2825637199cb6dd333d7d550f5627b5 Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Wed, 21 Sep 2016 15:16:58 +0200 Subject: [PATCH] More work to move to TS 2.0.x --- package.json | 6 +++--- src/vs/base/browser/htmlContentRenderer.ts | 4 ++-- src/vs/base/common/objects.ts | 2 +- src/vs/editor/contrib/find/common/findModel.ts | 2 +- .../workbench/services/editor/browser/editorService.ts | 9 ++++++--- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index b8b972fa967..ef66f943c6e 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "gulp-replace": "^0.5.4", "gulp-shell": "^0.5.2", "gulp-sourcemaps": "^1.6.0", - "gulp-tsb": "^1.10.1", + "gulp-tsb": "^2.0.0-beta.1", "gulp-tslint": "^4.3.0", "gulp-uglify": "^2.0.0", "gulp-util": "^3.0.6", @@ -88,12 +88,12 @@ "sinon": "^1.17.2", "source-map": "^0.4.4", "tslint": "^3.3.0", - "typescript": "^1.8.10", + "typescript": "^2.0.2", "uglify-js": "2.4.8", "underscore": "^1.8.2", "vinyl": "^0.4.5", "vinyl-fs": "^2.4.3", - "vscode-nls-dev": "^1.0.0" + "vscode-nls-dev": "^2.0.0-beta.1" }, "repository": { "type": "git", diff --git a/src/vs/base/browser/htmlContentRenderer.ts b/src/vs/base/browser/htmlContentRenderer.ts index 02415176763..3429e7c1343 100644 --- a/src/vs/base/browser/htmlContentRenderer.ts +++ b/src/vs/base/browser/htmlContentRenderer.ts @@ -109,10 +109,10 @@ function _renderHtml(content: IHTMLContentElement, options: RenderOptions = {}): // but update the node with the real result later. const id = defaultGenerator.nextId(); TPromise.join([value, withInnerHTML]).done(values => { - let [value] = values; + let strValue = values[0] as string; let span = element.querySelector(`span[data-code="${id}"]`); if (span) { - span.innerHTML = value; + span.innerHTML = strValue; } }, err => { // ignore diff --git a/src/vs/base/common/objects.ts b/src/vs/base/common/objects.ts index 9386ad7461c..30c45bd7fc2 100644 --- a/src/vs/base/common/objects.ts +++ b/src/vs/base/common/objects.ts @@ -11,7 +11,7 @@ export function clone(obj: T): T { return obj; } if (obj instanceof RegExp) { - // @dirk TS(2.0.2) - check after answer from TS team. + // See https://github.com/Microsoft/TypeScript/issues/10990 return obj as any; } var result = (Array.isArray(obj)) ? [] : {}; diff --git a/src/vs/editor/contrib/find/common/findModel.ts b/src/vs/editor/contrib/find/common/findModel.ts index 75272ec2707..184262502a8 100644 --- a/src/vs/editor/contrib/find/common/findModel.ts +++ b/src/vs/editor/contrib/find/common/findModel.ts @@ -269,7 +269,7 @@ export class FindModelBoundToEditorModel { private _moveToNextMatch(nextMatch: Range): void private _moveToNextMatch(after: Position): void private _moveToNextMatch(arg: any): void { - // @alex TS(2.0.2) - Adding cast to keep semantic. Necessary since the test are for interface but the code expects + // @sandeep TS(2.0.2) - Adding cast to keep semantic. Necessary since the test are for interface but the code expects // implemations. let nextMatch = Range.isIRange(arg) ? arg : Position.isIPosition(arg) ? this._getNextMatch(arg as Position) : null; if (nextMatch) { diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 3a2725709a5..fffb2f2b1b6 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -142,7 +142,8 @@ export class WorkbenchEditorService implements IWorkbenchEditorService { protected doOpenEditor(input: EditorInput, options?: EditorOptions, sideBySide?: boolean): TPromise; protected doOpenEditor(input: EditorInput, options?: EditorOptions, position?: Position): TPromise; protected doOpenEditor(input: EditorInput, options?: EditorOptions, arg3?: any): TPromise { - // @dirk TS(2.0.2) - This is very likely a bug in TS. + // @ben TS(2.0.2) - See https://github.com/Microsoft/TypeScript/issues/7294 + // For now I opt we make the signatures the same if possible return (this.editorPart as any).openEditor(input, options, arg3); } @@ -159,7 +160,8 @@ export class WorkbenchEditorService implements IWorkbenchEditorService { position: editors[index].position }; }); - // @dirk TS(2.0.2) - This is very likely a bug in TS. + // @ben TS(2.0.2) - See https://github.com/Microsoft/TypeScript/issues/7294 + // For now I opt we make the signatures the same if possible return (this.editorPart as any).openEditors(typedInputs); }); } @@ -178,7 +180,8 @@ export class WorkbenchEditorService implements IWorkbenchEditorService { options }; }); - // @dirk TS(2.0.2) - This is very likely a bug in TS. + // @ben TS(2.0.2) - See https://github.com/Microsoft/TypeScript/issues/7294 + // For now I opt we make the signatures the same if possible return (this.editorPart as any).replaceEditors(typedReplacements); }); });