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

Conversation

@acuarica
Copy link
Contributor

@acuarica acuarica commented Aug 26, 2022

PR description

This PR will use the Debug Adapter embedded within the extension[1], so we can use the vscode API in the debugger. Essentially it unifies execution modes, i.e., there is no more distinction between bundle and unbundled execution. The IS_BUNDLE_TIME configuration variable has been removed, and paths were fixed in order for the extension to always find the checkTruffleConfigTemplate script. As a result, the src/debugger.ts bundle was removed as well, since now the debugger is configured within the extension itself.

This difference in execution was causing different behaviors between the unbundled and bundled extension, causing errors when running the bundled extension. This PR should fix this issue.
Moreover, given that the debugger has access to the vscode API, we can get rid of duplicated code, see TruffleConfiguration.ts and debugConfigurationReader.ts in src/helpers.

Interestingly, the docs[1] suggests to use the embedded DA when it is written in JS/TS, as it is in our case.

Additionally, the web3ProviderResolver script was removed since it does not seem to be used anymore.


[1] https://code.visualstudio.com/api/extension-guides/debugger-extension#alternative-approach-to-develop-a-debugger-extension

Documentation

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

@acuarica acuarica changed the title Always use the embedded debug adapter Always use the embedded Debug Adapter Aug 26, 2022
Copy link
Contributor

@michaeljohnbennett michaeljohnbennett left a comment

Choose a reason for hiding this comment

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

Tested locally both in debug host extension mode and as a VSIX build and a deployment and debug of some contracts was working/attaching as expected.

@michaeljohnbennett michaeljohnbennett added the bug Something isn't working label Aug 26, 2022
@michaeljohnbennett
Copy link
Contributor

If we get one more set of eyes across this to test it, prior to merge we can then release a subsequent 2.4.x pre-release or we can just release the 2.5.0 again. By moving the tags forward.

Copy link
Contributor

@xhulz xhulz left a comment

Choose a reason for hiding this comment

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

Both scenarios worked fine for me (local and VSIX).

Thank you for that

@acuarica acuarica merged commit 12569d7 into develop Sep 5, 2022
@acuarica acuarica deleted the fix/debugger-inside-extension branch September 5, 2022 12:54
@acuarica acuarica mentioned this pull request Nov 23, 2022
2 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants