diff --git a/CHANGELOG.md b/CHANGELOG.md index e01d85c..bf9fa98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to the "Simbolik VSCode" extension will be documented in this file. +## [4.0.1] - 2024-11-11 + +- Show progress updates while starting a debugging session +- Hide build task output when the project compiles successfully + ## [4.0.0] - 2024-11-09 - Fixed the web extension. diff --git a/package-lock.json b/package-lock.json index 66dd385..715271c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simbolik", - "version": "4.0.0", + "version": "4.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "simbolik", - "version": "4.0.0", + "version": "4.0.1", "dependencies": { "@solidity-parser/parser": "^0.18.0", "@types/ws": "^8.5.10", @@ -1473,9 +1473,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001679", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001679.tgz", - "integrity": "sha512-j2YqID/YwpLnKzCmBOS4tlZdWprXm3ZmQLBH9ZBXFOhoxLA46fwyBvx6toCBWBmnuwUY/qB3kEU6gFx8qgCroA==", + "version": "1.0.30001680", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz", + "integrity": "sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index 8e4f1b3..fa1b6ea 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "publisher": "runtimeverification", "description": "Advanced Solidity and EVM Debugger", - "version": "4.0.0", + "version": "4.0.1", "engines": { "vscode": "^1.79.0" }, diff --git a/src/foundry.ts b/src/foundry.ts index edf2bcd..fe73ed9 100644 --- a/src/foundry.ts +++ b/src/foundry.ts @@ -28,7 +28,8 @@ function forgeBuildTask(file: vscode.Uri) { }) ); task.isBackground = true; - task.presentationOptions.reveal = vscode.TaskRevealKind.Always; + task.presentationOptions.reveal = vscode.TaskRevealKind.Silent; + task.presentationOptions.clear = true; return task; } diff --git a/src/startDebugging.ts b/src/startDebugging.ts index f9f48ba..1ffd093 100644 --- a/src/startDebugging.ts +++ b/src/startDebugging.ts @@ -12,78 +12,86 @@ export async function startDebugging( contract: ContractDefinition, method: FunctionDefinition ) { - const activeTextEditor = vscode.window.activeTextEditor; - if (!activeTextEditor) { - throw new Error('No active text editor.'); - } - - const workspaceFolder = vscode.workspace.getWorkspaceFolder( - activeTextEditor.document.uri - ); - if (!workspaceFolder) { - throw new Error('No workspace folder.'); - } - - const parameters = method.parameters.flatMap((param: VariableDeclaration) => { - if (param.typeName === null) { - console.error( - `Missing TypeName for parameter ${param} in method ${method} in contract ${contract}` - ); - return []; - } - const typeName: TypeName = param.typeName; - if (!('name' in typeName)) { - console.error( - `Missing name for TypeName for parameter ${param} in method ${method} in contract ${contract}` - ); - return []; + return await vscode.window.withProgress({ + location: vscode.ProgressLocation.Notification, + title: "Simbolik" + }, async (progress) => { + const activeTextEditor = vscode.window.activeTextEditor; + if (!activeTextEditor) { + throw new Error('No active text editor.'); } - if (typeof typeName.name !== 'string') { - console.error( - `Unexpected type for name of TypeName for parameter ${param} in method ${method} in contract ${contract}` - ); - return []; + + const workspaceFolder = vscode.workspace.getWorkspaceFolder( + activeTextEditor.document.uri + ); + if (!workspaceFolder) { + throw new Error('No workspace folder.'); } - return [typeName.name]; - }); - const file = activeTextEditor.document.uri.toString(); - const contractName = contract['name']; - const methodSignature = `${method['name']}(${parameters.join(',')})`; - const stopAtFirstOpcode = getConfigValue('stop-at-first-opcode', true); - const showSourcemaps = getConfigValue('show-sourcemaps', false); - const debugConfigName = `${contractName}.${methodSignature}`; - const jsonRpcUrl = getConfigValue('json-rpc-url', 'http://localhost:8545'); - const sourcifyUrl = getConfigValue('sourcify-url', 'http://localhost:5555'); - const autobuild = getConfigValue('autobuild', true); - if (autobuild) { - const build = forgeBuildTask(activeTextEditor.document.uri); - const buildExecution = await vscode.tasks.executeTask(build); - try { - await completed(buildExecution); - } catch (e) { - vscode.window.showErrorMessage('Failed to build project.'); + const parameters = method.parameters.flatMap((param: VariableDeclaration) => { + if (param.typeName === null) { + console.error( + `Missing TypeName for parameter ${param} in method ${method} in contract ${contract}` + ); + return []; + } + const typeName: TypeName = param.typeName; + if (!('name' in typeName)) { + console.error( + `Missing name for TypeName for parameter ${param} in method ${method} in contract ${contract}` + ); + return []; + } + if (typeof typeName.name !== 'string') { + console.error( + `Unexpected type for name of TypeName for parameter ${param} in method ${method} in contract ${contract}` + ); + return []; + } + return [typeName.name]; + }); + + const file = activeTextEditor.document.uri.toString(); + const contractName = contract['name']; + const methodSignature = `${method['name']}(${parameters.join(',')})`; + const stopAtFirstOpcode = getConfigValue('stop-at-first-opcode', true); + const showSourcemaps = getConfigValue('show-sourcemaps', false); + const debugConfigName = `${contractName}.${methodSignature}`; + const jsonRpcUrl = getConfigValue('json-rpc-url', 'http://localhost:8545'); + const sourcifyUrl = getConfigValue('sourcify-url', 'http://localhost:5555'); + const autobuild = getConfigValue('autobuild', true); + if (autobuild) { + progress.report({ message: "Compiling" }); + const build = forgeBuildTask(activeTextEditor.document.uri); + const buildExecution = await vscode.tasks.executeTask(build); + try { + await completed(buildExecution); + } catch (e) { + vscode.window.showErrorMessage('Failed to build project.'); + return; + } } - } - const myFoundryRoot = await foundryRoot(activeTextEditor.document.uri); - const buildInfo = await loadBuildInfo(activeTextEditor.document.uri); - const myDebugConfig = debugConfig( - debugConfigName, - file, - contractName, - methodSignature, - stopAtFirstOpcode, - showSourcemaps, - jsonRpcUrl, - sourcifyUrl, - buildInfo, - myFoundryRoot - ); - console.log(myDebugConfig); - const session = await vscode.debug.startDebugging( - workspaceFolder, - myDebugConfig - ); + const myFoundryRoot = await foundryRoot(activeTextEditor.document.uri); + const buildInfo = await loadBuildInfo(activeTextEditor.document.uri); + const myDebugConfig = debugConfig( + debugConfigName, + file, + contractName, + methodSignature, + stopAtFirstOpcode, + showSourcemaps, + jsonRpcUrl, + sourcifyUrl, + buildInfo, + myFoundryRoot + ); + console.log(myDebugConfig); + progress.report({message: "Launching testnet"}); + const session = await vscode.debug.startDebugging( + workspaceFolder, + myDebugConfig + ); + }); } function completed(tastkExecution: vscode.TaskExecution): Promise {