Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug vscode ts extension #35

Open
Th3CracKed opened this issue Aug 26, 2022 · 8 comments
Open

Debug vscode ts extension #35

Th3CracKed opened this issue Aug 26, 2022 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@Th3CracKed
Copy link

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

@Th3CracKed
Copy link
Author

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

@christian-bromann
Copy link
Contributor

@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?

@Th3CracKed
Copy link
Author

Th3CracKed commented Aug 30, 2022

@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.

@christian-bromann
Copy link
Contributor

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?

@Th3CracKed
Copy link
Author

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

@christian-bromann
Copy link
Contributor

Setting breakpoints in your extension code and have the test stop at these points is surely possible in some way.

@jeffb-sfdc
Copy link
Contributor

@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.

@christian-bromann
Copy link
Contributor

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.

@christian-bromann christian-bromann added the help wanted Extra attention is needed label Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants