Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let files;
if(solidityVAConfig.tools.surya.input.contracts=="workspace"){
await vscode.workspace.findFiles("**/*.sol",'**/node_modules', 500)
.then(uris => {
files = uris.map(function (uri) {
return uri.fsPath;
});
});
} else {
files = [document.uri.fsPath, ...Object.keys(this.g_parser.sourceUnits)]; //better only add imported files. need to resolve that somehow
}
switch(command) {
case "describe":
ret = surya.describe(files, {}, true);
vscode.workspace.openTextDocument({content: ret, language: "markdown"})
.then(doc => vscode.window.showTextDocument(doc, vscode.ViewColumn.Beside));
break;
case "graph":
ret = surya.graph(args || files, {colorScheme: suryaDefaultColorSchemeDark});
//solidity-va.preview.render.markdown
vscode.workspace.openTextDocument({content: ret, language: "dot"})
.then(doc => {
if(solidityVAConfig.preview.dot){
vscode.commands.executeCommand("interactive-graphviz.preview.beside", {document: doc, content:ret, callback:null})
.catch(error =>{
vscode.commands.executeCommand("graphviz.previewToSide", doc.uri)
.catch(error => {
//command not available. fallback open as text and try graphviz.showPreview
vscode.window.showTextDocument(doc, vscode.ViewColumn.Beside)
.then(editor => {