Add CompletionItem with snippet support to the example
Many users are asking about snippet support in Monaco. Enhancing the example on in the playground with a snippet CompletionItem will help users learn about the feature more easily without having to dig through Stack Overflow and GitHub issues. Signed-off-by: Remy Suen <remy.suen@gmail.com>pull/1703/head
parent
5b7c0c4bbb
commit
3a3d0106b6
|
@ -57,6 +57,13 @@ function createDependencyProposals() {
|
|||
kind: monaco.languages.CompletionItemKind.Function,
|
||||
documentation: "Recursively mkdir, like <code>mkdir -p</code>",
|
||||
insertText: '"mkdirp": "*"'
|
||||
},
|
||||
{
|
||||
label: '"my-third-party-library"',
|
||||
kind: monaco.languages.CompletionItemKind.Function,
|
||||
documentation: "Describe your library here",
|
||||
insertText: '"${1:my-third-party-library}": "${2:1.2.3}"',
|
||||
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
@ -19,6 +19,13 @@ function createDependencyProposals() {
|
|||
kind: monaco.languages.CompletionItemKind.Function,
|
||||
documentation: "Recursively mkdir, like <code>mkdir -p</code>",
|
||||
insertText: '"mkdirp": "*"'
|
||||
},
|
||||
{
|
||||
label: '"my-third-party-library"',
|
||||
kind: monaco.languages.CompletionItemKind.Function,
|
||||
documentation: "Describe your library here",
|
||||
insertText: '"${1:my-third-party-library}": "${2:1.2.3}"',
|
||||
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue