Merge pull request #497 from microsoftsam/master

Update custom-languages playground sample to use SnippetString
pull/582/head
Alexandru Dima 8 years ago committed by GitHub
commit ec6eefbd32

@ -73,18 +73,22 @@ monaco.languages.registerCompletionItemProvider('mySpecialLanguage', {
}, { }, {
label: 'testing', label: 'testing',
kind: monaco.languages.CompletionItemKind.Keyword, kind: monaco.languages.CompletionItemKind.Keyword,
insertText:'testing({{condition}})' insertText: {
value: 'testing(${1:condition})'
}
}, },
{ {
label: 'ifelse', label: 'ifelse',
kind: monaco.languages.CompletionItemKind.Snippet, kind: monaco.languages.CompletionItemKind.Snippet,
insertText: [ insertText: {
'if ({{condition}}) {', value: [
'\t{{}}', 'if (${1:condition}) {',
'} else {', '\t$0',
'\t', '} else {',
'}' '\t',
].join('\n'), '}'
].join('\n')
},
documentation: 'If-Else Statement' documentation: 'If-Else Statement'
} }
] ]

@ -35,18 +35,22 @@ monaco.languages.registerCompletionItemProvider('mySpecialLanguage', {
}, { }, {
label: 'testing', label: 'testing',
kind: monaco.languages.CompletionItemKind.Keyword, kind: monaco.languages.CompletionItemKind.Keyword,
insertText:'testing({{condition}})' insertText: {
value: 'testing(${1:condition})'
}
}, },
{ {
label: 'ifelse', label: 'ifelse',
kind: monaco.languages.CompletionItemKind.Snippet, kind: monaco.languages.CompletionItemKind.Snippet,
insertText: [ insertText: {
'if ({{condition}}) {', value: [
'\t{{}}', 'if (${1:condition}) {',
'} else {', '\t$0',
'\t', '} else {',
'}' '\t',
].join('\n'), '}'
].join('\n')
},
documentation: 'If-Else Statement' documentation: 'If-Else Statement'
} }
] ]

Loading…
Cancel
Save