Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
ioedeveloper committed Feb 3, 2025
1 parent 84c4706 commit 74cf15f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 59 deletions.
60 changes: 2 additions & 58 deletions apps/noir-compiler/src/app/components/container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion apps/noir-compiler/src/app/services/noirPluginClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 74cf15f

Please sign in to comment.