cd /news/developer-tools/i-built-a-vs-code-copilot-extension-… · home › topics › developer-tools › article
[ARTICLE · art-179818] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

I Built a VS Code Copilot Extension with Bun That Refuses to Write Code For Me

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.

key 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.

by read2 min views9 publishedDec 1, 2026

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.

Nine 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.

I 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.

Lately, 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.

So I built Ghost Trace (#ghostTrace / @trace)—and v0.3.0 is now live on the Visual Studio Code Marketplace!

Search ghost-trace ( Zyrndotio) directly in your VS Code Extensions sidebar, or press Ctrl + P (Cmd + P on macOS) and run:

ext install Zyrndotio.ghost-trace

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.

#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. Since I dislike heavy npm/ yarn boilerplate for developer tools, I built the entire project with Bun:

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. Here is a look at how Ghost Trace captures numbered file contents alongside live diagnostics before handing context to the model:

const diagnostics = vscode.languages.getDiagnostics(doc.uri);
const errorList = diagnostics.length > 0
  ? diagnostics.map(d => `- Line ${d.range.start.line + 1}: [${d.source || 'Compiler'}] ${d.message}`).join('\n')
  : 'No active compiler errors detected in this file.';

const numberedCode = doc.getText()
  .split('\n')
  .map((lineText, idx) => `${idx + 1}: ${lineText}`)
  .join('\n');

Ghost 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.

If 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!

── more in #developer-tools 4 stories · sorted by recency
── more on @ghost trace 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-built-a-vs-code-co…] indexed:0 read:2min 2026-12-01 · —