Well, I’ve been trying for a couple of weeks (yes, weeks) to get a debugger to work with Sketchup 2024, 2022, & 2017 using VS Code, and I am at my wit’s end. Long story short, I finally got everything working, but the last hurdle has me stumped. When I start Sketchup with switch -rdebug 'port=6123'
, everything seems fine but breakpoints get ignored and the Debug console seems dead. Since it is not clear that the debugger is actually attached to Sketchup, I tried using -rdebug 'port=6123 wait'
which halts Sketchup, just like it’s supposed to, and… nothing. When I try to attach to the port, VS Code looks like it’s doing something and Sketchup waits. If I cancel the VS Code debug session, Skecthup resumes loading. I’ve checked that the port is open and can connect to it via Windows Command and Powershell but VS Code isn’t making the connection, even using different debuggers. I have run out of patience and stamina, so I’m hoping someone has some idea of why this is not working. To make it easy to replicate, here is a link to my github fork of the simple example extension, including my VS Code workspace settings file. Give it a try and let me know if you have any ideas on why it isn’t working. Thanks in advance!
UPDATE - Ok, after sleeping on it, I managed to finally things working. The issue was my firewall but not in an obvious way. Ports were unblocked for both Sketchup and VS Code but, I then realized, they were only for incoming connections. I added rules to allow outbound connections from both and boom, connection made! The only mystery left is why only one of the three debuggers will connect. Ruby (Peng Lv) will connect and recognize breakpoints, but Ruby LSP (shopify) and VSCode rdbg (Koichi Sasada) are not connecting. If anyone knows why, please share. Thanks!