diff --git a/apps/remix-ide/src/app/tabs/locales/en/vyper.json b/apps/remix-ide/src/app/tabs/locales/en/vyper.json new file mode 100644 index 0000000000..093a185c79 --- /dev/null +++ b/apps/remix-ide/src/app/tabs/locales/en/vyper.json @@ -0,0 +1,3 @@ +{ + "vyper.openaigptMessage": "vyper code: {content}\n error message: {messageText}\n explain why the error occurred and how to fix it." +} diff --git a/apps/vyper/src/app/app.tsx b/apps/vyper/src/app/app.tsx index 8e8c69eca1..773af51f68 100644 --- a/apps/vyper/src/app/app.tsx +++ b/apps/vyper/src/app/app.tsx @@ -184,6 +184,7 @@ const App = () => { return { +export const Renderer = ({ message, opt, plugin, context }: RendererProps) => { const intl = useIntl() const [messageText, setMessageText] = useState(null) const [editorOptions, setEditorOptions] = useState({ @@ -88,7 +89,7 @@ export const Renderer = ({ message, opt, plugin }: RendererProps) => { const askGtp = async () => { try { const content = await plugin.call('fileManager', 'readFile', editorOptions.errFile) - const message = intl.formatMessage({ id: 'solidity.openaigptMessage' }, { content, messageText }) + const message = intl.formatMessage({ id: `${context || 'solidity' }.openaigptMessage` }, { content, messageText }) await plugin.call('remixAI', 'error_explaining', message) _paq.push(['trackEvent', 'ai', 'remixAI', 'error_explaining_SolidityError']) } catch (err) { diff --git a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx index 4d6f5773d6..de2f3285ec 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx @@ -299,6 +299,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => { { compileErrors[currentFile].errors.map((err, index) => { if (hideWarnings) { if (err.severity !== 'warning') { - return + return } } else { - return + return } })}