From 74cf15f4958a7b805065b2fef2a40b3a9a676868 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Mon, 3 Feb 2025 15:55:26 +0000 Subject: [PATCH] Remove unused code --- .../src/app/components/container.tsx | 60 +------------------ .../src/app/services/noirPluginClient.ts | 2 +- 2 files changed, 3 insertions(+), 59 deletions(-) diff --git a/apps/noir-compiler/src/app/components/container.tsx b/apps/noir-compiler/src/app/components/container.tsx index cb26e617404..062149bb598 100644 --- a/apps/noir-compiler/src/app/components/container.tsx +++ b/apps/noir-compiler/src/app/components/container.tsx @@ -21,22 +21,7 @@ export function Container () { } } - const handleOpenErrorLocation = async (report: CompilerReport) => { - if (report.labels.length > 0) { - // const location = noirApp.appState.filePathToId[report.labels[0].file_id] - // const startRange = report.labels[0].range.start - - // if (location) { - // const fullPathLocation = await circuitApp.plugin.resolveReportPath(location) - - // await circuitApp.plugin.call('fileManager', 'open', fullPathLocation) - // // @ts-ignore - // const startPosition: { lineNumber: number; column: number } = await circuitApp.plugin.call('editor', 'getPositionAt', startRange) - // // @ts-ignore - // await circuitApp.plugin.call('editor', 'gotoLine', startPosition.lineNumber - 1, startPosition.column) - // } - } - } + const handleOpenErrorLocation = async (report: CompilerReport) => {} const handleCircuitAutoCompile = (value: boolean) => { noirApp.dispatch({ type: 'SET_AUTO_COMPILE', payload: value }) @@ -46,48 +31,7 @@ export function Container () { noirApp.dispatch({ type: 'SET_HIDE_WARNINGS', payload: value }) } - const askGPT = async (report: CompilerReport) => { - if (report.labels.length > 0) { - // const location = circuitApp.appState.filePathToId[report.labels[0].file_id] - // const error = report.labels[0].message - - // if (location) { - // const fullPathLocation = await circuitApp.plugin.resolveReportPath(location) - // const content = await circuitApp.plugin.call('fileManager', 'readFile', fullPathLocation) - // const message = ` - // circom code: ${content} - // error message: ${error} - // full circom error: ${JSON.stringify(report, null, 2)} - // explain why the error occurred and how to fix it. - // ` - // await circuitApp.plugin.call('popupPanel' as any, 'showPopupPanel', true) - // setTimeout(async () => { - // await circuitApp.plugin.call('remixAI' as any, 'chatPipe', 'error_explaining', message) - // }, 500) - // } else { - // const message = ` - // error message: ${error} - // full circom error: ${JSON.stringify(report, null, 2)} - // explain why the error occurred and how to fix it. - // ` - // await circuitApp.plugin.call('popupPanel' as any, 'showPopupPanel', true) - // setTimeout(async () => { - // await circuitApp.plugin.call('remixAI' as any, 'chatPipe', 'error_explaining', message) - // }, 500) - // } - } else { - // const error = report.message - // const message = ` - // error message: ${error} - // full circom error: ${JSON.stringify(report, null, 2)} - // explain why the error occurred and how to fix it. - // ` - // await circuitApp.plugin.call('popupPanel' as any, 'showPopupPanel', true) - // setTimeout(async () => { - // await circuitApp.plugin.call('remixAI' as any, 'chatPipe', 'error_explaining', message) - // }, 500) - } - } + const askGPT = async (report: CompilerReport) => {} const handleCompileClick = () => { compileNoirCircuit(noirApp.plugin, noirApp.appState) diff --git a/apps/noir-compiler/src/app/services/noirPluginClient.ts b/apps/noir-compiler/src/app/services/noirPluginClient.ts index 90d7fe94ee4..718727f5e2e 100644 --- a/apps/noir-compiler/src/app/services/noirPluginClient.ts +++ b/apps/noir-compiler/src/app/services/noirPluginClient.ts @@ -56,7 +56,7 @@ export class NoirPluginClient extends PluginClient { this.call('terminal', 'log', { type: 'log', value: 'Compiling ' + path }) const program = await compile_program(this.fm, null, this.logFn.bind(this), this.debugFn.bind(this)) - console.log('program: ', program) + this.call('fileManager', 'writeFile', path.replace('.nr', '.json'), JSON.stringify(program, null, 2)) this.internalEvents.emit('noir_compiling_done') this.emit('statusChanged', { key: 'succeed', title: 'Noir circuit compiled successfully', type: 'success' }) // @ts-ignore