瀏覽代碼

Handle new JSDoc tag format

Your Name 4 年之前
父節點
當前提交
64504b9ffb
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/languageFeatures.ts

+ 3 - 3
src/languageFeatures.ts

@@ -535,9 +535,9 @@ export class SuggestAdapter extends Adapter implements languages.CompletionItemP
 function tagToString(tag: ts.JSDocTagInfo): string {
 function tagToString(tag: ts.JSDocTagInfo): string {
 	let tagLabel = `*@${tag.name}*`;
 	let tagLabel = `*@${tag.name}*`;
 	if (tag.name === 'param' && tag.text) {
 	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) {
 	} else if (tag.text) {
 		tagLabel += ` — ${tag.text}`;
 		tagLabel += ` — ${tag.text}`;
 	}
 	}