瀏覽代碼

Merge pull request #75 from microsoft/4_3_dev

Adds support for TypeScript 4.3 builds
Alexandru Dima 4 年之前
父節點
當前提交
a59162dbd4

+ 3 - 3
package-lock.json

@@ -461,9 +461,9 @@
 			}
 		},
 		"typescript": {
-			"version": "4.2.4",
-			"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz",
-			"integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==",
+			"version": "4.3.2",
+			"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz",
+			"integrity": "sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==",
 			"dev": true
 		},
 		"which": {

+ 1 - 1
package.json

@@ -32,7 +32,7 @@
 		"pretty-quick": "^3.1.0",
 		"requirejs": "^2.3.6",
 		"terser": "^5.6.0",
-		"typescript": "^4.2.4"
+		"typescript": "^4.3.2"
 	},
 	"husky": {
 		"hooks": {

+ 5 - 5
src/languageFeatures.ts

@@ -370,9 +370,9 @@ export class DiagnosticsAdapter extends Adapter {
 	private _convertRelatedInformation(
 		model: editor.ITextModel,
 		relatedInformation?: DiagnosticRelatedInformation[]
-	): editor.IRelatedInformation[] | undefined {
+	): editor.IRelatedInformation[] {
 		if (!relatedInformation) {
-			return;
+			return [];
 		}
 
 		const result: editor.IRelatedInformation[] = [];
@@ -572,9 +572,9 @@ export class SuggestAdapter extends Adapter implements languages.CompletionItemP
 function tagToString(tag: ts.JSDocTagInfo): string {
 	let tagLabel = `*@${tag.name}*`;
 	if (tag.name === 'param' && tag.text) {
-		const [paramName, ...rest] = tag.text.split(' ');
-		tagLabel += `\`${paramName}\``;
-		if (rest.length > 0) tagLabel += ` — ${rest.join(' ')}`;
+		const [paramName, ...rest] = tag.text;
+		tagLabel += `\`${paramName.text}\``;
+		if (rest.length > 0) tagLabel += ` — ${rest.map(r => r.text).join(' ')}`;
 	} else if (tag.text) {
 		tagLabel += ` — ${tag.text}`;
 	}

+ 5 - 0
src/lib/lib.index.ts

@@ -53,6 +53,11 @@ libFileSet['lib.es2020.promise.d.ts'] = true;
 libFileSet['lib.es2020.sharedmemory.d.ts'] = true;
 libFileSet['lib.es2020.string.d.ts'] = true;
 libFileSet['lib.es2020.symbol.wellknown.d.ts'] = true;
+libFileSet['lib.es2021.d.ts'] = true;
+libFileSet['lib.es2021.full.d.ts'] = true;
+libFileSet['lib.es2021.promise.d.ts'] = true;
+libFileSet['lib.es2021.string.d.ts'] = true;
+libFileSet['lib.es2021.weakref.d.ts'] = true;
 libFileSet['lib.es5.d.ts'] = true;
 libFileSet['lib.es6.d.ts'] = true;
 libFileSet['lib.esnext.d.ts'] = true;

文件差異過大導致無法顯示
+ 0 - 0
src/lib/lib.ts


文件差異過大導致無法顯示
+ 385 - 334
src/lib/typescriptServices-amd.js


文件差異過大導致無法顯示
+ 202 - 198
src/lib/typescriptServices.d.ts


文件差異過大導致無法顯示
+ 385 - 334
src/lib/typescriptServices.js


+ 1 - 1
src/lib/typescriptServicesMetadata.ts

@@ -2,4 +2,4 @@
 // **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`
 //
 
-export const typescriptVersion = "4.2.4";
+export const typescriptVersion = "4.3.2";

+ 1 - 0
src/tsWorker.ts

@@ -253,6 +253,7 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, ITypeScriptWork
 			entry,
 			undefined,
 			undefined,
+			undefined, 
 			undefined
 		);
 	}

部分文件因文件數量過多而無法顯示