DEV Community

Khishamuddin Syed
Khishamuddin Syed

Posted on

Day 5: Building VS Code Extension in Public

Day 5: The bugs I didn't see coming

Building DevFlow Suite in public a 7-day series documenting the full journey from idea to VS Code Marketplace.


I thought I was done. The features were working, the UI looked right, and the extension was loading without errors.

Then I started actually using it.

Here's what broke and more importantly, why it broke.

The comment scanner race condition

DevFlow Suite automatically scans your workspace for inline // comments on every file save. The problem: when you deleted a comment and saved, the scanner would sometimes re-surface it.

The delete event and the scan were both triggered by the same save. The delete hadn't flushed to state before the scanner ran.

Fix: queue the scan behind the delete. Simple. Finding it: 3 hours.

The line-number shift bug

When you delete a comment, every comment below it shifts up by one line. The extension was storing line references as static numbers.

Delete line 42. The comment that was on line 43 is now on 42 but the stored reference still says 43. It renders as missing.

Fix: switch to text-based matching instead of line-number matching for identity. One line of logic. Two days of confusion.

Windows path handling

fs.copyFileSync and vscode.diff both behaved differently on Windows when mixing absolute and relative paths. The diff view would silently fail.

I don't use Windows as my primary machine. I caught this only because someone else tested it.

Lesson: always test path operations on Windows if your extension touches the filesystem.

The recycle bin ghost problem

Items restored from the recycle bin would sometimes re-appear in trash on the next render. The isInTrash check was using stale line numbers same root cause as the shift bug, different surface.

Fix: switch isInTrash to text-based matching. Same pattern, different location.


What I learned from all of this

VS Code extensions run in a strange environment. File events, webview persistence, command registration none of it behaves exactly like standard Node.js.

The gap between "it works when I test it" and "it works reliably" is where all these bugs lived.

The only real way to find them was to use the extension as if I hadn't built it.


PRD DOC and Past Updates: https://devflow-suite.notion.site/

Top comments (0)