added vyper and circom to explain contract

pull/5383/head
STetsing 2 weeks ago committed by Aniket
parent fcabd0f442
commit 3d2169b4eb
  1. 2
      apps/remix-ide/src/app/plugins/remixAIPlugin.tsx
  2. 2
      apps/remix-ide/src/app/tabs/locales/en/remixUiTabs.json
  3. 6
      libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx

@ -135,6 +135,8 @@ export class RemixAIPlugin extends ViewPlugin {
result = await this.remoteInferencer.solidity_answer(newPrompt) result = await this.remoteInferencer.solidity_answer(newPrompt)
} }
if (result && params.terminal_output) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result }) 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 return result
} }

@ -2,7 +2,7 @@
"remixUiTabs.tooltipText1": "Run script (CTRL + SHIFT + S)", "remixUiTabs.tooltipText1": "Run script (CTRL + SHIFT + S)",
"remixUiTabs.tooltipText2": "Compile CTRL + S", "remixUiTabs.tooltipText2": "Compile CTRL + S",
"remixUiTabs.tooltipText3": "Select .sol or .yul file to compile OR a .ts or .js file to run", "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.tooltipText5": "Explain the contract(s) in current file [BETA]",
"remixUiTabs.tooltipText6": "Enable RemixAI Copilot [BETA]", "remixUiTabs.tooltipText6": "Enable RemixAI Copilot [BETA]",
"remixUiTabs.tooltipText7": "Disable RemixAI Copilot [BETA]", "remixUiTabs.tooltipText7": "Disable RemixAI Copilot [BETA]",

@ -250,7 +250,7 @@ export const TabsUI = (props: TabsUIProps) => {
tooltipId="overlay-tooltip-explaination" tooltipId="overlay-tooltip-explaination"
tooltipText={ tooltipText={
<span> <span>
{tabsState.currentExt === 'sol' ? ( {((tabsState.currentExt === 'sol') || (tabsState.currentExt === 'vy') || (tabsState.currentExt === 'circom')) ? (
<FormattedMessage id="remixUiTabs.tooltipText5" /> <FormattedMessage id="remixUiTabs.tooltipText5" />
) : ( ) : (
<FormattedMessage id="remixUiTabs.tooltipText4" /> <FormattedMessage id="remixUiTabs.tooltipText4" />
@ -262,11 +262,11 @@ export const TabsUI = (props: TabsUIProps) => {
data-id="explain-editor" data-id="explain-editor"
id='explain_btn' id='explain_btn'
className='btn text-ai pl-2 pr-0 py-0' 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 () => { onClick={async () => {
const path = active().substr(active().indexOf('/') + 1, active().length) const path = active().substr(active().indexOf('/') + 1, active().length)
const content = await props.plugin.call('fileManager', 'readFile', path) 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) setExplaining(true)
// if plugin is pinned, // if plugin is pinned,
await props.plugin.call('popupPanel', 'showPopupPanel', true) await props.plugin.call('popupPanel', 'showPopupPanel', true)

Loading…
Cancel
Save