wdio-vscode-service
wdio-vscode-service copied to clipboard
Debug vscode ts extension
Is there any example how to setup a vscode debug configuration to debug extension running in wdio vscode environment. A typescript configuration example would be appreciated.
thanks
For those having the same issue, check this thread to debug an installed vscode app https://stackoverflow.com/questions/39003860/how-can-i-debug-installed-vscode-extensions
I didn't manage to make the source map work to debug ts files, but it's a good start to be able to debug js files
@Th3CracKed please check out the Marquee project where I use this package for e2e testing. When a test fails it shows me the correct ts lines.
Setting up a TypeScript project is not particular something this project is concerned about. Can you specify what improvements you like to see to have this issue closed?
@christian-bromann thanks for your answer, The stack trace are showed correctly for ts files. I don't understand how wdio vscode service load/run the extension. Ideally I want to put the debugger on my extension code and run the e2e test to check if the things I mock are correctly mocked and debug failing tests faster. Currently I have really low visibility on the state of my extension when running with a wdio vscode service, I added logs to help me understand what happening. but it's not ideal DX.
Currently I have really low visibility on the state of my extension when running with a wdio vscode service, I added logs to help me understand what happening. but it's not ideal DX.
Do you have any concrete suggestions how we can improve this?
being able to debug extension in vscode launched by wdio vscode. Maybe if there's a way to automate the steps https://stackoverflow.com/questions/39003860/how-can-i-debug-installed-vscode-extensions combined with vscode chrome debug
Now I use logging to understand what's happening on the extension
Setting breakpoints in your extension code and have the test stop at these points is surely possible in some way.
@christian-bromann my observation is that when debugging with wdio-vscode-service, neither placing debugger
statements in the extension's source code, or calling executeComand()
work.
Placing debugger
in the test suite code, or adding breakpoints to the test suit code works, but not in the extension itself (while being automated by wdio-vscode-service)
The issue is that on startup a socket to VS Code is opened, but once VS Code opens a folder/project, the socket is closed and executeComand()
no longer works.
Placing
debugger
in the test suite code, or adding breakpoints to the test suit code works, but not in the extension itself (while being automated by wdio-vscode-service)
Yeah, it would be very difficult to support breakpoints within the extension. Again, as mentioned before: probably possible, no idea how though.