mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
Merge pull request #497 from microsoftsam/master
Update custom-languages playground sample to use SnippetString
This commit is contained in:
commit
ec6eefbd32
2 changed files with 24 additions and 16 deletions
|
|
@ -73,18 +73,22 @@ monaco.languages.registerCompletionItemProvider('mySpecialLanguage', {
|
|||
}, {
|
||||
label: 'testing',
|
||||
kind: monaco.languages.CompletionItemKind.Keyword,
|
||||
insertText:'testing({{condition}})'
|
||||
insertText: {
|
||||
value: 'testing(${1:condition})'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'ifelse',
|
||||
kind: monaco.languages.CompletionItemKind.Snippet,
|
||||
insertText: [
|
||||
'if ({{condition}}) {',
|
||||
'\t{{}}',
|
||||
insertText: {
|
||||
value: [
|
||||
'if (${1:condition}) {',
|
||||
'\t$0',
|
||||
'} else {',
|
||||
'\t',
|
||||
'}'
|
||||
].join('\n'),
|
||||
].join('\n')
|
||||
},
|
||||
documentation: 'If-Else Statement'
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -35,18 +35,22 @@ monaco.languages.registerCompletionItemProvider('mySpecialLanguage', {
|
|||
}, {
|
||||
label: 'testing',
|
||||
kind: monaco.languages.CompletionItemKind.Keyword,
|
||||
insertText:'testing({{condition}})'
|
||||
insertText: {
|
||||
value: 'testing(${1:condition})'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'ifelse',
|
||||
kind: monaco.languages.CompletionItemKind.Snippet,
|
||||
insertText: [
|
||||
'if ({{condition}}) {',
|
||||
'\t{{}}',
|
||||
insertText: {
|
||||
value: [
|
||||
'if (${1:condition}) {',
|
||||
'\t$0',
|
||||
'} else {',
|
||||
'\t',
|
||||
'}'
|
||||
].join('\n'),
|
||||
].join('\n')
|
||||
},
|
||||
documentation: 'If-Else Statement'
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue