mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +01:00
Handle new JSDoc tag format
This commit is contained in:
parent
ffd28b299d
commit
64504b9ffb
1 changed files with 3 additions and 3 deletions
|
|
@ -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(' ');
|
const [paramName, ...rest] = tag.text;
|
||||||
tagLabel += `\`${paramName}\``;
|
tagLabel += `\`${paramName.text}\``;
|
||||||
if (rest.length > 0) tagLabel += ` — ${rest.join(' ')}`;
|
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}`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue