Tech Journal - VSCode, Extension, Debugging Error

Created on: 15 Nov 24 01:00 +0700 by Son Nguyen Hoang in English

A quick journey to fix a stupid, confusing bug

For the last few days I challenged myself to craft a small, lightweight extension on VScode. This is a tool I customized to ease some of the pain I had when working with Roblox. Getting used to VSCode Extension is fun - I have to admin. The API is clean and sharp, however, something had happened …

Problem
  • Some unwanted behavior occur
  • I have to add code breakpoint to debug the extension but it not work. The breakpoint is unbound
  • Printing on console is no work as well.
  • However, the extension did running. Albeit, all the modifications I made seem to have no effect to fix the unwanted behavior

What’s the heck is happening?

The Only Trace

The only trace I have is that I did rename the extension onced. What I did is just simply find all recurrences of the first name then modified it to the new one. Nothing special, you may say. However, this can potentially break some link to the system inside?

Attemps
  1. May the problem in launch.json file? No, I spent hours and hours to check for the configuration, everything is correct.
  2. May it because of the “Extension” itself? I actually download a version of my extension to the machine. So that meant there were two version of it running on the system? Onced is downloaded from marketplace, another one is run directly through Extension Development Host. Could it cause problem? Very likely.

However, after the uninstallation, this time the extension literally cannot be activated. My extension was set to be activated aumatically (by file extension: .luau) so something really wrong here.

  1. Then I made a small notification on some alert notification box! Boom! Nothing work as well. This is in fact, could be caching problems inside VSCode!
Solution

Actually I followed this guy Youtube Video: https://www.youtube.com/watch?v=pmI-rgGNZcs … and delete folder in the step below

  • Visit: C://User/[UserName]/AppData/Roaming/Code
  • Visit: Code/CachedData and clear everything inside
  • Run again. This time the issue had been fixed!
Ending

That’s it! The problem is annoying AF! Btw, here is the extension I made:

https://github.com/sonnguyen9800/Luau-Mode-Setter

Lesson of the day is that avoid rename thing randomly. Better to avoid it. We never know for sure what the heck is happening under the hood.

Back To Top