Skip to content

Commit

Permalink
fix hover provider switch
Browse files Browse the repository at this point in the history
minor text adjustments
  • Loading branch information
tintinweb committed Jun 24, 2020
1 parent 5f318c1 commit b538556
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 1 addition & 7 deletions src/features/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)})

Expand Down
2 changes: 1 addition & 1 deletion src/features/whatsnew/whatsNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const MESSAGE = `[<img width="130" alt="get in touch with Consensys Diligence" s
**Solidity Visual Auditor** is now **Solidity Visual Developer** 🎉
Thanks for using **Solidity Visual Developer** 🤜🤛
### What's New?
Expand Down

0 comments on commit b538556

Please sign in to comment.