Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Running truffle debug with appropriate flag (--vscode) - Enhancements & Fixes #254

Merged
merged 5 commits into from
Nov 9, 2022

Conversation

xhulz
Copy link
Contributor

@xhulz xhulz commented Nov 7, 2022

PR description

This PR contains some improvements to the routine responsible for handling the calls addressed to vscode protocol. It also fixes some bugs and implements a new parameter to the debuger configuration. Below is the list of changes:

- Bug fix

I've made a simple modification to support windows command prompt calls. Command prompt does not support sending Json Objects on URL so I had to change the arguments from object to querystring params. Unfortunately, the Windows command prompt does not support sending an URL with Json Objects.

Before: {"txHash":"0x97a81dbca1ea95263bb75b0147c99f263fe21cf702abe8974c310c9fa834d9b9","workingDirectory":"/Users/xhulz/Documents/xpto","providerUrl":"[http://127.0.0.1:8545"}](http://127.0.0.1:8545%22%7D/)

Now: "txHash=0x4d1f42a6096f82e01a680a7364e958f9214447473e025f8f00fe05314a4f6fb5&workingDirectory=%2FUsers%2Fxhulz%2FDocuments%2FCode%2Fboxes&providerUrl=http%3A%2F%2F127.0.0.1%3A8545"

Refactor

@acuarica I took the opportunity to fix those issues that you've pointed on the last PR #231

New parameter on debug configuration

@acuarica I've implemented a new parameter on querystring called fetchExternal. I built the changes and left a comment on DebuggerCommand.ts to handle this parameter, because it was hard coded to false

// TODO: Add a way to select if the user wants to fetch external contracts
const fetchExternal = false;

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if documentation updates are required.

@xhulz xhulz marked this pull request as ready for review November 7, 2022 17:18
@xhulz xhulz added the bug Something isn't working label Nov 8, 2022
@xhulz xhulz marked this pull request as draft November 8, 2022 15:33
@xhulz xhulz marked this pull request as ready for review November 8, 2022 15:35
@xhulz xhulz added the refactor Improve code or project quality label Nov 8, 2022
@xhulz xhulz marked this pull request as draft November 8, 2022 15:42
@xhulz xhulz added the enhancement New feature or request label Nov 9, 2022
@xhulz xhulz changed the title Running truffle debug with appropriate flag (--vscode) on WINDOWS Running truffle debug with appropriate flag (--vscode) - Enhancements & Fixes Nov 9, 2022
@xhulz xhulz marked this pull request as ready for review November 9, 2022 10:40
Copy link
Contributor

@acuarica acuarica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

src/commands/DebuggerCommands.ts Show resolved Hide resolved
src/helpers/uriHandlerController.ts Outdated Show resolved Hide resolved
@acuarica
Copy link
Contributor

acuarica commented Nov 9, 2022

Hi @xhulz, thanks for taking care of this. Regarding the fetchExternal flag, not sure if change the semantics in the future (#149 (comment)). But I believe it's fine for now, we can amend it in a future PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request refactor Improve code or project quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants