-
Notifications
You must be signed in to change notification settings - Fork 18
How do you actually use the VS Code snapshot debugger extension #135
Comments
That's entirely fair. The documentation that you're referring to was written with the assumption of familiarity with vscode debugger extensions, which isn't a fair assumption. We'll update the documentation with some screenshots or (hopefully) animations showing the critical actions that you've called out. Just to avoid leaving you hanging here though:
I hope that helps, and let me know if you have any questions or if you run into any issues. |
So, I tried to follow these instructions and when trying to "Run" the configuration I get this message: Cannot connect to Firebase.
As far as I can tell:
This is my launch.json:
I can connect and see the debuggee using the What else do I need to check/configure? |
This is the error that I am seeing in the VS Code console:
Looking at the debug console I can see this other message:
|
If you're able to use snapshot-dbg-cli on the same machine that's running vscode, then the best suggestion I have is to run |
I ran |
We can check the extension logs to see if there's something more helpful outputted when the connection fails. Modify your |
I already did that. That's the second output that I listed in my message before. failed to connect to database https://xxxxxxxx-cdbg.firebaseio.com/: Timed out after 2000 ms. So it seems that the connection to Firebase is timing out |
Ah, got it. That'll be a timeout from when the initial connection is made and the extension is attempting to read the schema version. The timeout is fixed at the moment; I can push out a quick change to the extension to make that configurable. It's possible that with your location & network that 2000 ms is just not long enough for that initial connection & read to get through. |
The connection timeout is currently hardcoded to 2 seconds. It is likely that this is not going to work in all situations, so I'm adding a configuration knob to allow the user to set whatever timeout they'd like. Depending on feedback, the default timeout may be increased as well. The balance is that if the extension is attempting to discover the database, increases in timeouts will result in slower extension startup. This PR is related to #135
Try https://github.com/GoogleCloudPlatform/snapshot-debugger/releases/tag/extension-v0.2.0 Adding something like |
That worked! 🎉 Just setting it to 3000 seems to work as well, so it seems that the default timeout just needs to be a bit longer. I am leaving it set to 5000 for now. I'll continue testing and will let you know if I find any more issues. Thanks! |
I was having the issue that I was not able to set breakpoints in my code. I found out the the problem is that the extension is only configured to handle JS, Python and Java code and I was trying to test it with PHP Code. I have been able to modify the extension configuration and built it so that it also works in PHP files. Would you like me to create a PR with these changes? |
On a different issue, right now when a snapshot is hit, it is unable to open the right file. This happens because the PHP extension is reporting the files for the call stack with the full path in the server, which is different from the path in the local machine where VS Code is running. It would be great to be able to have a config setting similar to the one that Xdebug uses, where you can add this to your configuration:
And this takes care of resolving the right file when a breakpoint is hit |
You're right; the extension explicitly states which languages it supports for debugging. Happy to hear that you have a dev version of the extension up and running. We'll want to get the PHP agent code merged in and available to the public before we push a change that adds PHP support to this extension, but I'll be happy if you send a PR and we'll get it in once it's unblocked. As for the workspace root, that's a good suggestion. I'll cut a new issue for that and we can track discussion/implementation there. |
I have downloaded and installed the VS Code Snapshot Debugger Extension. I am new to VS Code. How do you actually use the extension? How do you configure it? How do you set up snapshots and logpoints? How do you see the recorded values from snapshots? All this information is missing in these docs: https://github.com/GoogleCloudPlatform/snapshot-debugger/tree/main/snapshot_dbg_extension it says that you can do all these actions but does not explain how to do them. Some examples would be nice
The text was updated successfully, but these errors were encountered: