diff --git a/extensions/typescript-language-features/src/test/previewer.test.ts b/extensions/typescript-language-features/src/test/previewer.test.ts index abcdace9f60..133238dfc0c 100644 --- a/extensions/typescript-language-features/src/test/previewer.test.ts +++ b/extensions/typescript-language-features/src/test/previewer.test.ts @@ -54,5 +54,15 @@ suite('typescript.previewer', () => { 'x {@link http://www.example.com/foo y [bar](http://www.example.com/bar) z'); }); + test('Should support non-ascii characters in paramter name (#90108)', async () => { + assert.strictEqual( + tagsMarkdownPreview([ + { + name: 'param', + text: 'parámetroConDiacríticos this will not' + } + ]), + '*@param* `parámetroConDiacríticos` — this will not'); + }); }); diff --git a/extensions/typescript-language-features/src/utils/previewer.ts b/extensions/typescript-language-features/src/utils/previewer.ts index f29d03189ff..3d059dca331 100644 --- a/extensions/typescript-language-features/src/utils/previewer.ts +++ b/extensions/typescript-language-features/src/utils/previewer.ts @@ -68,8 +68,8 @@ function getTagDocumentation(tag: Proto.JSDocTagInfo): string | undefined { case 'extends': case 'param': case 'template': - const body = (tag.text || '').split(/^([\w\.]+)\s*-?\s*/); - if (body && body.length === 3) { + const body = (tag.text || '').split(/^(\S+)\s*-?\s*/); + if (body?.length === 3) { const param = body[1]; const doc = body[2]; const label = `*@${tag.name}* \`${param}\``;