From db6752c455fc7abdf77c287f09b1b9f6f8e62571 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Sat, 9 Sep 2023 11:58:37 +0200 Subject: [PATCH] add globals --- .../lib/providers/completion/completionGlobals.ts | 14 ++++++++++++++ 1 file changed, 14 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 21436a1998..c3b1db62a3 100644 --- a/libs/remix-ui/editor/src/lib/providers/completion/completionGlobals.ts +++ b/libs/remix-ui/editor/src/lib/providers/completion/completionGlobals.ts @@ -521,6 +521,20 @@ export function GetGlobalVariable(range: monacoTypes.IRange, monaco): monacoType export function GetGlobalFunctions(range: monacoTypes.IRange, monaco): monacoTypes.languages.CompletionItem[] { return [ + { + label: 'fallback', + kind: monaco.languages.CompletionItemKind.Function, + insertText: 'fallback() ${1:external} ${2:payable} { }', + insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, + range + }, + { + label: 'receive', + kind: monaco.languages.CompletionItemKind.Function, + insertText: 'receive() ${1:external} ${2:payable} { }', + insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, + range + }, { detail: 'assert(bool condition): throws if the condition is not met - to be used for internal errors.', insertText: 'assert(${1:condition});',