-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
How to setup a development environment to debug an extension that uses local changes to vscode.d.ts? #20623
Comments
Appologies for not reading the whole description. Now you should be able to simply change the However just changing the definition file does not actually change VSCode. I believe you also want to change vscode and your extension. For that you need to build a development version of vscode. In the development version of vscode you need to add a node debug extension, do that by copying ms-vscode.node-debug (path on my mac Will reopen if this does not solve your issue |
@isidorn Thanks! This unblocked me but I do have a few clarifying questions. (1) Should I copy both ms-vscode.node-debug and ms-vscode.node-debug2? I have copied both and it seems to work. (2) The extension always downloads vscode.d.ts from network via I assume I need to delete the dev dependency on vscode (including the reference to (3) I also needed to modify launch.json as you mentioned here. Would you be open to me submitting a PR to document this process somewhere? Where would this doc belong? |
@isidorn another question: (4) I have the extension debuggable running against my dev version of vscode, but how do I attach a debugger to the main thread of the vscode instance that is running my extension and set breakpoints?
I don't seem to be able to even see console.log messages. |
|
Awesome! To summarize (for the record), my setup consists of three instances of VS Code:
✅ Breakpoints set on extension code in (2) catch when I perform actions in (3), hooray! 🎉
Is there any way for me to us VS Code instead of setting breakpoints inside of the "Debugger for Chrome" extension? What you linked is a launch task but what I would need is an attach task.
Thanks again for the help! I will try to submit a PR to document this process at some point. |
Attach should also be possible in both cases but you just need to start vscode development with a special flag debug flag. More details https://github.com/Microsoft/vscode-chrome-debug/issues/35 |
This tells me to use
Starting (2) with @roblourens Any ideas? |
@nicksnyder I know the issue is long time ago, but did you manage to find a solution to set a breakpoint in (1) and debug it in (3)? |
@guw Sorry, I don't remember. I haven't had to do this in a while and some of the debugging stuff has changed since then. |
I would like to experiment with some changes to vscode.d.ts (the API exposed to extensions).
In order to test these changes locally, I would like to be able to have an extension FOO such that
In my case FOO=vscode-go (an extension that already exists).
tl;dr what is the recommended setup to accomplish what I want?
Long version...here is what I have attempted...
Method 1: Inline vscode-go into
vscode/extensions/vscode-go
.This requires making quite a few changes in vscode
node ./node_modules/vscode/bin/install
gulp compile-extension:vscode-go
andgulp watch-extension:vscode-go
I had this method working for a bit (both debugging and consuming new APIs), but within the last 24 hours debugging has broken twice (I can't seem to step in to function calls once I hit a breakpoint). I was able to "fix" this the first time by trying to re-do my setup (ultimately I am not sure what fixed it), but now that it has broken again (and I am not sure what causes this setup to break), I have so far been unable to fix it my repeating my setup process.
Method 2: use --extensionDevelopmentPath
This is something that I have just started trying because it seems less than ideal to need to "inline" extensions into vscode via method 1.
The goal of this method is to use
./scripts/code.sh --extensionDevelopmentPath=/Users/nick/code/vscode-go
.Steps:
node ./node_modules/vscode/bin/install
Right now I am stuck on trying to get breakpoints to work with this method. Setting a breakpoint in vscode-go requires vscode-go to be a subdirectory of my project.
I tried creating a sandbox directory that contains just vscode and vscode-go. In this directory I have a .vscode/launch.json that looks like this
The vscode-go extension appears to load, but my breakpoints in vscode-go files don't catch.
The text was updated successfully, but these errors were encountered: