Hello! My plugin became pretty complex to the point I need to debug it.
What I have tried is writing debugger in the code and running
node --inspect-brk path/to/tsc, but the script never pauses at the breakpoint provided.
Any directions, please?
P.S. Logging works, but is a bit tedious, especially for figuring out the exact flow path of the program.
One of the few things covered in the wiki : https://github.com/microsoft/TypeScript/wiki/Debugging-Language-Service-in-VS-Code
Hi @dragomirtitian my old TS pal :smile: Whenever I ask something about TS I feel like you will answer it with 50% chance :smile: I can see that article, I'll try it when I'll get back to work! Thank you!
@dragomirtitian @RyanCavanaugh Well that wiki tutorial turned out to be unexpectedly hard. I just wanted to debug my LS Plugin, but the wiki suggests to debug a VSCode inside a VSCode.

I started to go through the tutorial anyway (in hope that it will give me some related knowledge) but abandoned it soon after, because it's too much for me to build VSCode, build TS, and try to figure out what does launch and attach (I may guess but I am totally not sure) mean in steps 3,4,5, when all I want is to catch a bug in my plugin. I feel like I'll spend many hours doing something that I am not sure will work at all.
I think that some other guys who want to debug their plugins may feel the same way as I do, so maybe there is some more straightforward way? Or am I missing something or am I probably too stupid for this I don't know :-)
Does that page actually require a development version of VSC? I believe it's only because the processes are identical. Can you get away with using an insiders release?
@DanielRosenwasser Thanks for quick response. Yes, it does require a development version of VSC. I am not even sure what is the purpose of the whole tutorial after reading it, so maybe I am just missing something, and yes the processes may be identical/similar with what I want to achieve, but if this is the case, then I don't have any ideas about which steps should I replace for my case.
@anurbol been using that exact tutorial. Works with regular vs code. Just:
$env:TSS_DEBUG = 5859vscode (write the command in the terminalYou can run the Restart ts server command in the debugged instance to reload the server (as you make changes) but you will need to reattach when you do so.
Write to me on gitter if you have any issues 馃槉
Titian is our (TS strugglers) savior as always! Helped me in gitter.
I just want to make some corrections that appeared from the gitter conversation:
$env:TSS_DEBUG = 5859code (write the command in the terminal "configurations": [
...,
{
"type": "node",
"request": "attach",
"name": "Attach to TS Server",
"protocol": "inspector",
"port": 5859
}
]
5.3. Click the arrow down (mentioned in 5.2) again choose Attach to TS Server configuration.
5.4. Click "Start Debugging" button (it is located to the left of configuration select dropdown).
.ts file to start the language service and do something that triggeres the code with the breakpoint, e.g. modify a .ts file, request a hover aka quick info etc. (the debugger breakpoint should be there in your LS Plugin).
Most helpful comment
One of the few things covered in the wiki : https://github.com/microsoft/TypeScript/wiki/Debugging-Language-Service-in-VS-Code