From 3d2169b4ebcd9d04f919f6c3ed9652bc4d6a3463 Mon Sep 17 00:00:00 2001 From: STetsing <41009393+STetsing@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:52:06 +0100 Subject: [PATCH] added vyper and circom to explain contract --- apps/remix-ide/src/app/plugins/remixAIPlugin.tsx | 2 ++ apps/remix-ide/src/app/tabs/locales/en/remixUiTabs.json | 2 +- libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide/src/app/plugins/remixAIPlugin.tsx b/apps/remix-ide/src/app/plugins/remixAIPlugin.tsx index c310317e6a..bf8193c49a 100644 --- a/apps/remix-ide/src/app/plugins/remixAIPlugin.tsx +++ b/apps/remix-ide/src/app/plugins/remixAIPlugin.tsx @@ -135,6 +135,8 @@ export class RemixAIPlugin extends ViewPlugin { result = await this.remoteInferencer.solidity_answer(newPrompt) } if (result && params.terminal_output) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result }) + + if (prompt.trimStart().startsWith('gpt') || prompt.trimStart().startsWith('sol-gpt')) params.terminal_output = false return result } diff --git a/apps/remix-ide/src/app/tabs/locales/en/remixUiTabs.json b/apps/remix-ide/src/app/tabs/locales/en/remixUiTabs.json index 5870ea16e0..4735c57898 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/remixUiTabs.json +++ b/apps/remix-ide/src/app/tabs/locales/en/remixUiTabs.json @@ -2,7 +2,7 @@ "remixUiTabs.tooltipText1": "Run script (CTRL + SHIFT + S)", "remixUiTabs.tooltipText2": "Compile CTRL + S", "remixUiTabs.tooltipText3": "Select .sol or .yul file to compile OR a .ts or .js file to run", - "remixUiTabs.tooltipText4": "To explain a contract, choose a .sol file", + "remixUiTabs.tooltipText4": "To explain a contract, choose a .sol, .vy or .circom file", "remixUiTabs.tooltipText5": "Explain the contract(s) in current file [BETA]", "remixUiTabs.tooltipText6": "Enable RemixAI Copilot [BETA]", "remixUiTabs.tooltipText7": "Disable RemixAI Copilot [BETA]", diff --git a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx index 98dd90a4ad..2471cf00f9 100644 --- a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx +++ b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx @@ -250,7 +250,7 @@ export const TabsUI = (props: TabsUIProps) => { tooltipId="overlay-tooltip-explaination" tooltipText={ - {tabsState.currentExt === 'sol' ? ( + {((tabsState.currentExt === 'sol') || (tabsState.currentExt === 'vy') || (tabsState.currentExt === 'circom')) ? ( ) : ( @@ -262,11 +262,11 @@ export const TabsUI = (props: TabsUIProps) => { data-id="explain-editor" id='explain_btn' className='btn text-ai pl-2 pr-0 py-0' - disabled={!(tabsState.currentExt === 'sol') || explaining} + disabled={!((tabsState.currentExt === 'sol') || (tabsState.currentExt === 'vy') || (tabsState.currentExt === 'circom')) || explaining} onClick={async () => { const path = active().substr(active().indexOf('/') + 1, active().length) const content = await props.plugin.call('fileManager', 'readFile', path) - if (tabsState.currentExt === 'sol') { + if ((tabsState.currentExt === 'sol') || (tabsState.currentExt === 'vy') || (tabsState.currentExt === 'circom')) { setExplaining(true) // if plugin is pinned, await props.plugin.call('popupPanel', 'showPopupPanel', true)