How to use the surya.ftrace function in surya

To help you get started, we’ve selected a few surya examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ConsenSys / vscode-solidity-auditor / src / features / commands.js View on Github external
outTxt = ['No Dependencies Found'];
                    }
                    else {
                        ret.shift();
                        const reducer = (accumulator, currentValue) => `${accumulator}\n  ↖ ${currentValue}`;
                        outTxt.push(`  ↖ ${ret.reduce(reducer)}`);
                    }
                    

                    vscode.workspace.openTextDocument({content: outTxt.join("\n"), language: "markdown"})
                        .then(doc => vscode.window.showTextDocument(doc, vscode.ViewColumn.Beside));
                }
                break;
            case "ftrace":
                //  contract::func, all, files 
                ret = surya.ftrace(args[0], args[1] || 'all', files, {}, true);
                vscode.workspace.openTextDocument({content: ret, language: "markdown"})
                    .then(doc => vscode.window.showTextDocument(doc, vscode.ViewColumn.Beside));
                break;
            case "mdreport":
                ret = surya.mdreport(files);
                vscode.workspace.openTextDocument({content: ret, language: "markdown"})
                    .then(doc => {
                        if(solidityVAConfig.preview.markdown){
                            vscode.commands.executeCommand("markdown-preview-enhanced.openPreview", doc.uri)
                                .catch(error => {
                                    //command does not exist
                                    vscode.window.showTextDocument(doc, vscode.ViewColumn.Beside)
                                        .then(editor => {
                                            vscode.commands.executeCommand("markdown.extension.togglePreview")
                                            .catch(error => {
                                                //command does not exist

surya

Sūrya, The Sun God: A set of utilities for inspecting the structure of Solidity contracts.

Apache-2.0
Latest version published 25 days ago

Package Health Score

76 / 100
Full package analysis