From a667f74bf8291579e57704ef7313df4b6d631e6f Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 2 Sep 2022 10:41:38 +0200 Subject: [PATCH] add loops --- .../providers/completion/completionGlobals.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libs/remix-ui/editor/src/lib/providers/completion/completionGlobals.ts b/libs/remix-ui/editor/src/lib/providers/completion/completionGlobals.ts index 4c5285e9ef..a3dd0f05e8 100644 --- a/libs/remix-ui/editor/src/lib/providers/completion/completionGlobals.ts +++ b/libs/remix-ui/editor/src/lib/providers/completion/completionGlobals.ts @@ -148,6 +148,27 @@ export function getCompletionSnippets(range: IRange, monaco): monaco.languages.C insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, range }, + { + label: 'while loop', + kind: monaco.languages.CompletionItemKind.Snippet, + insertText: 'while (${1:condition}) \n{\n\t${2:code}\n};', + insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, + range + }, + { + label: 'do while loop', + kind: monaco.languages.CompletionItemKind.Snippet, + insertText: 'do {\n\t${2:code}\n} \nwhile (${1:condition});', + insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, + range + }, + { + label: 'for loop', + kind: monaco.languages.CompletionItemKind.Snippet, + insertText: 'for (${1:init}; ${2:condition}; ${3:increment}) \n{\n\t${4:code}\n};', + insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, + range + }, { label: 'pragma', kind: monaco.languages.CompletionItemKind.Snippet,