{"slug": "i-built-a-vs-code-copilot-extension-with-bun-that-refuses-to-write-code-for-me", "title": "I Built a VS Code Copilot Extension with Bun That Refuses to Write Code For Me", "summary": "A developer released Ghost Trace v0.3.0, an open-source MIT-licensed VS Code extension that hooks into GitHub Copilot Chat to trace cascading syntax and structural errors back to their root-cause line without rewriting code. Built with Bun and bundled to CommonJS, the extension registers a language model tool so Copilot's agent harness can invoke it, feeding numbered file contents and live diagnostics to the model and returning clickable line links. The tool works across any language supported by VS Code diagnostics.", "body_md": "Every developer knows this exact headache: your compiler throws a red squiggle on **Line 38**, you jump down to Line 38, and... it’s completely blank. Or it’s a single closing `}` that looks totally fine.\n\nNine times out of ten, the real culprit is a missing brace, an unclosed parenthesis, or a forgotten `</div>` 25 lines higher up that cascaded all the way down the file.\n\nI wanted a fast way to hunt down these \"phantom\" errors inside VS Code without scrolling up and down counting brackets—**but I didn't want another AI tool that silently rewrites my code for me.**\n\nLately, I've been focusing on sharpening my web development fundamentals (`TypeScript`, `JavaScript`, `HTML`, `CSS`, `Java`). When you're actively building and retaining your coding skills, letting an AI auto-fix every syntax slip robs you of the debugging intuition you actually need.\n\nSo I built **Ghost Trace** (`#ghostTrace` / `@trace`)—and **v0.3.0** is now live on the Visual Studio Code Marketplace!\n\nSearch **`ghost-trace`** (` Zyrndotio`) directly in your VS Code Extensions sidebar, or press `Ctrl + P` (`Cmd + P` on macOS) and run:\n\n```\next install Zyrndotio.ghost-trace\n```\n\n**Ghost Trace** hooks into GitHub Copilot Chat to trace cascading syntax and structural bugs back to their true origin—across any language supported by VS Code diagnostics.\n\n`#file` or the paperclip icon), ask `@trace` or `#ghostTrace` to investigate, and it analyzes all of them together.`[Line X]` links. Clicking one opens that file (even if it was closed), jumps your cursor straight to the root-cause line, and briefly highlights it—followed by one-click learning prompts about error cascades and prevention.\nSince I dislike heavy `npm`/` yarn` boilerplate for developer tools, I built the entire project with **Bun**:\n\n`bun build` bundles the TypeScript extension straight to CommonJS (`--target=node --format=cjs --external=vscode`) in milliseconds.` ghost_trace_diagnose`)` vscode.lm.registerTool` so VS Code's Copilot Agent harness can invoke it directly—supporting optional `filePaths` (workspace-relative or absolute) and `targetLine` inputs.\nHere is a look at how Ghost Trace captures numbered file contents alongside live diagnostics before handing context to the model:\n\n``` js\nconst diagnostics = vscode.languages.getDiagnostics(doc.uri);\nconst errorList = diagnostics.length > 0\n  ? diagnostics.map(d => `- Line ${d.range.start.line + 1}: [${d.source || 'Compiler'}] ${d.message}`).join('\\n')\n  : 'No active compiler errors detected in this file.';\n\nconst numberedCode = doc.getText()\n  .split('\\n')\n  .map((lineText, idx) => `${idx + 1}: ${lineText}`)\n  .join('\\n');\n```\n\nGhost Trace is open source under the **MIT License**, and I'm planning to keep expanding it with editor gutter markers and targeted structural checks in future releases.\n\nIf you've ever wasted ten minutes hunting down a missing `}` or `</div>` on a blank line, install it, give it a spin, and let me know in the comments what features or languages I should tackle next!", "url": "https://wpnews.pro/news/i-built-a-vs-code-copilot-extension-with-bun-that-refuses-to-write-code-for-me", "canonical_source": "https://dev.to/zyrndotio/i-built-a-vs-code-copilot-extension-with-bun-that-refuses-to-write-code-for-me-16o5", "published_at": "2026-12-01 23:09:29+00:00", "updated_at": "2026-12-01 23:15:18.975323+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-agents", "large-language-models"], "entities": ["Ghost Trace", "Visual Studio Code", "GitHub Copilot", "Bun", "Zyrndotio"], "also_reported_by": [], "takeaway": "Ghost Trace registers a vscode.lm tool that passes numbered file lines plus live diagnostics to Copilot, letting the model map cascading errors to their root-cause line instead of auto-fixing code.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/i-built-a-vs-code-copilot-extension-with-bun-that-refuses-to-write-code-for-me", "markdown": "https://wpnews.pro/news/i-built-a-vs-code-copilot-extension-with-bun-that-refuses-to-write-code-for-me.md", "text": "https://wpnews.pro/news/i-built-a-vs-code-copilot-extension-with-bun-that-refuses-to-write-code-for-me.txt", "jsonld": "https://wpnews.pro/news/i-built-a-vs-code-copilot-extension-with-bun-that-refuses-to-write-code-for-me.jsonld"}}