From 13184019d86087e7baa3cd1b847d26a08f37ff4f Mon Sep 17 00:00:00 2001 From: filip mertens Date: Sun, 24 Sep 2023 09:11:07 +0200 Subject: [PATCH 1/2] add decode --- .../src/lib/providers/completion/completionGlobals.ts | 8 ++++++++ 1 file changed, 8 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 c3b1db62a3..9054840516 100644 --- a/libs/remix-ui/editor/src/lib/providers/completion/completionGlobals.ts +++ b/libs/remix-ui/editor/src/lib/providers/completion/completionGlobals.ts @@ -293,6 +293,14 @@ export function getAbiCompletionItems(range: monacoTypes.IRange, monaco): monaco label: 'encodeWithSignature', range }, + { + label: 'decode', + kind: monaco.languages.CompletionItemKind.Method, + insertText: 'decode(${1:arg});', + insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, + detail: 'decode(bytes encodedData, (...)) returns (...): ABI-decodes the given arguments from the given encodedData', + range + } ]; } From 7080a18f4f0973bf20eabb6ac8080c578faed470 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Sun, 24 Sep 2023 09:21:28 +0200 Subject: [PATCH 2/2] 2 args --- .../editor/src/lib/providers/completion/completionGlobals.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9054840516..27066b9237 100644 --- a/libs/remix-ui/editor/src/lib/providers/completion/completionGlobals.ts +++ b/libs/remix-ui/editor/src/lib/providers/completion/completionGlobals.ts @@ -296,7 +296,7 @@ export function getAbiCompletionItems(range: monacoTypes.IRange, monaco): monaco { label: 'decode', kind: monaco.languages.CompletionItemKind.Method, - insertText: 'decode(${1:arg});', + insertText: 'decode(${1:arg}, ${2:arg});', insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: 'decode(bytes encodedData, (...)) returns (...): ABI-decodes the given arguments from the given encodedData', range