mirror of
https://gitee.com/ssssssss-team/magic-api.git
synced 2026-06-09 18:32:16 +08:00
代码提示中增加参数说明
This commit is contained in:
@@ -153,11 +153,21 @@ async function completionScript(suggestions, input) {
|
||||
continue;
|
||||
}
|
||||
mmap[method.signature] = true;
|
||||
let document = [];
|
||||
for (let j = (method.extension ? 1 : 0); j < method.parameters.length; j++) {
|
||||
let param = method.parameters[j];
|
||||
document.push('- ' + param.name + ':' + (param.comment || param.type));
|
||||
document.push('---')
|
||||
}
|
||||
document.push(`- 返回值:\`${method.returnType}\``)
|
||||
suggestions.push({
|
||||
sortText: method.sortText || method.fullName,
|
||||
label: method.fullName,
|
||||
kind: monaco.languages.CompletionItemKind.Method,
|
||||
detail: method.comment,
|
||||
documentation: {
|
||||
value: document.join('\r\n')
|
||||
},
|
||||
insertText: method.insertText,
|
||||
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user