From b5385568c55ed7e3329f6792831801ad05fb2a3d Mon Sep 17 00:00:00 2001 From: tintinweb Date: Wed, 24 Jun 2020 22:05:18 +0200 Subject: [PATCH] fix hover provider switch minor text adjustments --- src/extension.js | 2 +- src/features/hover.js | 8 +------- src/features/whatsnew/whatsNew.js | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/extension.js b/src/extension.js index c24e376..22aa506 100644 --- a/src/extension.js +++ b/src/extension.js @@ -952,7 +952,7 @@ ${sourceFiles[current].content} EtherScanIO.byteCodeForAddress(args.address).then(content => { vscode.commands.executeCommand("vscode-decompiler.decompileShowContent", `${args.address}.evm`, content) .catch(err => { - vscode.window.showErrorMessage(`Please install and configure 'tintinweb.vscode-decompiler' to use this feature.`); + vscode.window.showWarningMessage(`Please install and configure 'tintinweb.vscode-decompiler' to use this feature.`); }); }); break; diff --git a/src/features/hover.js b/src/features/hover.js index aef309d..b829e9f 100644 --- a/src/features/hover.js +++ b/src/features/hover.js @@ -82,23 +82,17 @@ function provideHoverHandler(document, position, token, type, g_parser) { return; } - let ret = builtInsHoverHandler(document, position, token, type, g_parser); - if(!ret){ - return addressHoverProvider(document, position, token, type, g_parser); - } + return builtInsHoverHandler(document, position, token, type, g_parser) || addressHoverProvider(document, position, token, type, g_parser); } function addressHoverProvider(document, position, token, type, g_parser) { let range = document.getWordRangeAtPosition(position, /(0x[a-fA-F0-9]{40})(?:[^a-zA-Z0-9]|$)/); - console.log(range); if (!range) { return; } - console.log(range.end) - //fix range to 40+2 bytes (first capture group) range = range.with({end: new vscode.Position(range.end.line, range.start.character + 42)}) diff --git a/src/features/whatsnew/whatsNew.js b/src/features/whatsnew/whatsNew.js index ea0afad..624b798 100644 --- a/src/features/whatsnew/whatsNew.js +++ b/src/features/whatsnew/whatsNew.js @@ -23,7 +23,7 @@ const MESSAGE = `[