mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-30 05:21:08 +01:00
@@ -206,6 +206,7 @@ class TryCompleteJsDocCommand implements Command {
|
||||
export function templateToSnippet(template: string): SnippetString {
|
||||
// TODO: use append placeholder
|
||||
let snippetIndex = 1;
|
||||
template = template.replace(/\$/g, '\\$');
|
||||
template = template.replace(/^\s*(?=(\/|[ ]\*))/gm, '');
|
||||
template = template.replace(/^(\/\*\*\s*\*[ ]*)$/m, (x) => x + `\$0`);
|
||||
template = template.replace(/\* @param([ ]\{\S+\})?\s+(\S+)\s*$/gm, (_param, type, post) => {
|
||||
|
||||
@@ -70,7 +70,7 @@ suite('typescript.jsDocSnippet', () => {
|
||||
[
|
||||
'/**',
|
||||
' * $0',
|
||||
' * @param $arg ${1}',
|
||||
' * @param \\$arg ${1}',
|
||||
' */'
|
||||
].join('\n'));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user