From 9d125dd69040826a0a65e8fcee3ced8480dc92aa Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 17 Oct 2019 14:14:20 -0700 Subject: [PATCH] Re-enable building VS Code with TS 3.7 (#82289) * Re-enable building VS Code with TS 3.7 Reverts 5b0cdadc871b6a20696a8a632361ac5ae9eecbb7 Blocked from check in due to https://github.com/microsoft/TypeScript/issues/33936 * update d.ts for ts 3.7 --- build/monaco/api.js | 2 +- build/monaco/api.ts | 2 +- build/package.json | 2 +- build/yarn.lock | 8 ++-- package.json | 2 +- src/vs/monaco.d.ts | 4 +- .../electron-browser/webviewElement.ts | 40 +++++-------------- yarn.lock | 8 ++-- 8 files changed, 24 insertions(+), 44 deletions(-) diff --git a/build/monaco/api.js b/build/monaco/api.js index 93fea1558b9..a429cd66cde 100644 --- a/build/monaco/api.js +++ b/build/monaco/api.js @@ -516,7 +516,7 @@ class DeclarationResolver { 'file.ts': fileContents }; const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {})); - const text = service.getEmitOutput('file.ts', true).outputFiles[0].text; + const text = service.getEmitOutput('file.ts', true, true).outputFiles[0].text; return new CacheEntry(ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5), mtime); } } diff --git a/build/monaco/api.ts b/build/monaco/api.ts index 1cd4e49b733..ae058292344 100644 --- a/build/monaco/api.ts +++ b/build/monaco/api.ts @@ -617,7 +617,7 @@ export class DeclarationResolver { 'file.ts': fileContents }; const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {})); - const text = service.getEmitOutput('file.ts', true).outputFiles[0].text; + const text = service.getEmitOutput('file.ts', true, true).outputFiles[0].text; return new CacheEntry( ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5), mtime diff --git a/build/package.json b/build/package.json index 84556e6e17d..2151916b3fa 100644 --- a/build/package.json +++ b/build/package.json @@ -42,7 +42,7 @@ "request": "^2.85.0", "terser": "4.3.8", "tslint": "^5.9.1", - "typescript": "3.6.2", + "typescript": "3.7.0-dev.20191017", "vsce": "1.48.0", "vscode-telemetry-extractor": "^1.5.4", "xml2js": "^0.4.17" diff --git a/build/yarn.lock b/build/yarn.lock index 2451df9b537..904aed2ed59 100644 --- a/build/yarn.lock +++ b/build/yarn.lock @@ -2297,10 +2297,10 @@ typed-rest-client@^0.9.0: tunnel "0.0.4" underscore "1.8.3" -typescript@3.6.2: - version "3.6.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.2.tgz#105b0f1934119dde543ac8eb71af3a91009efe54" - integrity sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw== +typescript@3.7.0-dev.20191017: + version "3.7.0-dev.20191017" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.0-dev.20191017.tgz#e61440dd445edea6d7b9a699e7c5d5fbcd1906f2" + integrity sha512-Yi0lCPEN0cn9Gp8TEEkPpgKNR5SWAmx9Hmzzz+oEuivw6amURqRGynaLyFZkMA9iMsvYG5LLqhdlFO3uu5ZT/w== typescript@^3.0.1: version "3.5.3" diff --git a/package.json b/package.json index 7c190b12f9c..cca94accc79 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "source-map": "^0.4.4", "ts-loader": "^4.4.2", "tslint": "^5.16.0", - "typescript": "3.6", + "typescript": "3.7.0-dev.20191017", "typescript-formatter": "7.1.0", "underscore": "^1.8.2", "vinyl": "^2.0.0", diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 428c78c0129..9abd28bc461 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -42,7 +42,7 @@ declare namespace monaco { export class CancellationTokenSource { constructor(parent?: CancellationToken); - readonly token: CancellationToken; + get token(): CancellationToken; cancel(): void; dispose(cancel?: boolean): void; } @@ -118,7 +118,7 @@ declare namespace monaco { * namely the server name, would be missing. Therefore `Uri#fsPath` exists - it's sugar to ease working * with URIs that represent files on disk (`file` scheme). */ - readonly fsPath: string; + get fsPath(): string; with(change: { scheme?: string; authority?: string | null; diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts index 69282ac7514..f722c074b5f 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts @@ -321,9 +321,7 @@ export class ElectronWebviewBasedWebview extends BaseWebview impleme } protected postMessage(channel: string, data?: any): void { - if (this.element) { - this.element.send(channel, data); - } + this.element?.send(channel, data); } public focus(): void { @@ -408,57 +406,39 @@ export class ElectronWebviewBasedWebview extends BaseWebview impleme } public showFind() { - if (this._webviewFindWidget) { - this._webviewFindWidget.reveal(); - } + this._webviewFindWidget?.reveal(); } public hideFind() { - if (this._webviewFindWidget) { - this._webviewFindWidget.hide(); - } + this._webviewFindWidget?.hide(); } public runFindAction(previous: boolean) { - if (this._webviewFindWidget) { - this._webviewFindWidget.find(previous); - } + this._webviewFindWidget?.find(previous); } public selectAll() { - if (this.element) { - this.element.selectAll(); - } + this.element?.selectAll(); } public copy() { - if (this.element) { - this.element.copy(); - } + this.element?.copy(); } public paste() { - if (this.element) { - this.element.paste(); - } + this.element?.paste(); } public cut() { - if (this.element) { - this.element.cut(); - } + this.element?.cut(); } public undo() { - if (this.element) { - this.element.undo(); - } + this.element?.undo(); } public redo() { - if (this.element) { - this.element.redo(); - } + this.element?.redo(); } protected on(channel: WebviewMessageChannels | string, handler: (data: T) => void): IDisposable { diff --git a/yarn.lock b/yarn.lock index 34dbd9f011c..111159a9d36 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8510,10 +8510,10 @@ typescript-formatter@7.1.0: commandpost "^1.0.0" editorconfig "^0.15.0" -typescript@3.6: - version "3.6.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.2.tgz#105b0f1934119dde543ac8eb71af3a91009efe54" - integrity sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw== +typescript@3.7.0-dev.20191017: + version "3.7.0-dev.20191017" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.0-dev.20191017.tgz#e61440dd445edea6d7b9a699e7c5d5fbcd1906f2" + integrity sha512-Yi0lCPEN0cn9Gp8TEEkPpgKNR5SWAmx9Hmzzz+oEuivw6amURqRGynaLyFZkMA9iMsvYG5LLqhdlFO3uu5ZT/w== typescript@^2.6.2: version "2.6.2" -- GitLab