Skip to content

Commit

Permalink
fix surya ftrace for constructor/fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
tintinweb committed Jan 15, 2020
1 parent 1279544 commit 3cd9a2c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,8 @@ function onActivate(context) {
context.subscriptions.push(
vscode.commands.registerCommand(
'solidity-va.surya.ftrace',
function (doc, functionName, mode) {
commands.surya(doc || vscode.window.activeTextEditor.document, "ftrace", [functionName, mode]);
function (doc, contractName, functionName, mode) {
commands.surya(doc || vscode.window.activeTextEditor.document, "ftrace", [contractName, functionName, mode]);
}
)
);
Expand Down
2 changes: 1 addition & 1 deletion src/features/codelens.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class SolidityCodeLensProvider {
lenses.push(new vscode.CodeLens(range, {
command: 'solidity-va.surya.ftrace',
title: 'ftrace',
arguments: [document, contractName+"::"+item._node.name, "all"]
arguments: [document, contractName, item._node.name, "all"]
})
);

Expand Down
8 changes: 7 additions & 1 deletion src/features/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,13 @@ class Commands{
break;
case "ftrace":
// contract::func, all, files
ret = surya.ftrace(args[0], args[1] || 'all', files, {}, true);
if (args[1] === null){
args[1] = "<Constructor>";
} else if (args[1] === ""){
args[1] = "<Fallback>";
}

ret = surya.ftrace(args[0] + "::" + args[1], args[2] || 'all', files, {}, true);
vscode.workspace.openTextDocument({content: ret, language: "markdown"})
.then(doc => vscode.window.showTextDocument(doc, vscode.ViewColumn.Beside));
break;
Expand Down

0 comments on commit 3cd9a2c

Please sign in to comment.