-
Notifications
You must be signed in to change notification settings - Fork 27
Feat: Running truffle debug with appropriate flag (--vscode) triggers debugger to launch / run in VS Code #231
Conversation
|
cc @gnidan for 👀 |
|
Whoa! How does this work? You can tell VS Code to intercept a command given to the in-IDE shell? So VS Code will observe that you typed |
michaeljohnbennett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
Hey @gnidan, The vscode has a URI controller class like the apps have on mobile. It's a listener that listen to this protocol: In the Truffle case, we will have to receive (on Truffle CLI) the command If i can help, just let me know :) Cheers! |
acuarica
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
Ok @acuarica, Your suggestions have been implemented Thank you |
|
Oh, just to clarify: ideally we can interface with the extension from any terminal. I was just asking the question in case that's not easy. |
PR description
ref: #203
Running truffle debug with appropriate flag (--vscode) triggers debugger to launch / run in VS Code
The command line to execute the vscode debugger:
open 'vscode://trufflesuite-csi.truffle-vscode/debug?{"txHash":"0x97a81dbca1ea95263bb75b0147c99f263fe21cf702abe8974c310c9fa834d9b9","workingDirectory":"/Users/xhulz/Documents/xpto","providerUrl":"http://127.0.0.1:8545"}'This command line is basically formed by:
open 'app://extension_id/command_name?args'.Important: If the Truffle vscode extension is not installed, vscode will ask if the user wants to install it. So, there is no reason to validate it earlier.
Breaking the command line:
vscodetrufflesuite-csi.truffle-vscodedebug{txHash: string, workingDirectory: string, providerUrl: string}Example: {"txHash":"0x97a81dbca1ea95263bb75b0147c99f263fe21cf702abe8974c310c9fa834d9b9","workingDirectory":"/Users/xhulz/Documents/xpto","providerUrl":"http://127.0.0.1:8545"}
Documentation
doc-change-requiredlabel to this PR if documentation updates are required.