add globals

pull/4057/head
filip mertens 1 year ago
parent a0c055377d
commit 06ec22548b
  1. 14
      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});',

Loading…
Cancel
Save