diff --git a/test/playground.generated/extending-language-services-custom-languages.html b/test/playground.generated/extending-language-services-custom-languages.html index 6075334f..8c0d7ffa 100644 --- a/test/playground.generated/extending-language-services-custom-languages.html +++ b/test/playground.generated/extending-language-services-custom-languages.html @@ -66,32 +66,29 @@ monaco.editor.defineTheme('myCoolTheme', { // Register a completion item provider for the new language monaco.languages.registerCompletionItemProvider('mySpecialLanguage', { provideCompletionItems: () => { - return [ - { - label: 'simpleText', - kind: monaco.languages.CompletionItemKind.Text - }, { - label: 'testing', - kind: monaco.languages.CompletionItemKind.Keyword, - insertText: { - value: 'testing(${1:condition})' - } - }, - { - label: 'ifelse', - kind: monaco.languages.CompletionItemKind.Snippet, - insertText: { - value: [ - 'if (${1:condition}) {', - '\t$0', - '} else {', - '\t', - '}' - ].join('\n') - }, - documentation: 'If-Else Statement' - } - ] + var suggestions = [{ + label: 'simpleText', + kind: monaco.languages.CompletionItemKind.Text, + insertText: 'simpleText' + }, { + label: 'testing', + kind: monaco.languages.CompletionItemKind.Keyword, + insertText: 'testing(${1:condition})', + insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet + }, { + label: 'ifelse', + kind: monaco.languages.CompletionItemKind.Snippet, + insertText: [ + 'if (${1:condition}) {', + '\t$0', + '} else {', + '\t', + '}' + ].join('\n'), + insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, + documentation: 'If-Else Statement' + }]; + return { suggestions: suggestions }; } }); diff --git a/website/playground/new-samples/extending-language-services/custom-languages/sample.js b/website/playground/new-samples/extending-language-services/custom-languages/sample.js index 1b070992..011cf16f 100644 --- a/website/playground/new-samples/extending-language-services/custom-languages/sample.js +++ b/website/playground/new-samples/extending-language-services/custom-languages/sample.js @@ -28,32 +28,29 @@ monaco.editor.defineTheme('myCoolTheme', { // Register a completion item provider for the new language monaco.languages.registerCompletionItemProvider('mySpecialLanguage', { provideCompletionItems: () => { - return [ - { - label: 'simpleText', - kind: monaco.languages.CompletionItemKind.Text - }, { - label: 'testing', - kind: monaco.languages.CompletionItemKind.Keyword, - insertText: { - value: 'testing(${1:condition})' - } - }, - { - label: 'ifelse', - kind: monaco.languages.CompletionItemKind.Snippet, - insertText: { - value: [ - 'if (${1:condition}) {', - '\t$0', - '} else {', - '\t', - '}' - ].join('\n') - }, - documentation: 'If-Else Statement' - } - ] + var suggestions = [{ + label: 'simpleText', + kind: monaco.languages.CompletionItemKind.Text, + insertText: 'simpleText' + }, { + label: 'testing', + kind: monaco.languages.CompletionItemKind.Keyword, + insertText: 'testing(${1:condition})', + insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet + }, { + label: 'ifelse', + kind: monaco.languages.CompletionItemKind.Snippet, + insertText: [ + 'if (${1:condition}) {', + '\t$0', + '} else {', + '\t', + '}' + ].join('\n'), + insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, + documentation: 'If-Else Statement' + }]; + return { suggestions: suggestions }; } });