mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 13:55:41 +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',
|
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…
Add table
Add a link
Reference in a new issue