ErrorCopy: AI Error Explainer
Originally published at gidadomukhta.me . Install it from the VS Code Marketplace or read the source on GitHub . Most error messages are only half the story. A TypeScript message such as "Type 'string' is not assignable to type 'number'" tells you that two types disagree, but not which value caused it, which call produced it, or what the code around it is doing. To get a useful answer from an AI…
ErrorCopy: AI Error Explainer is a VS Code extension designed to simplify the process of obtaining useful information from AI assistants when debugging TypeScript-related errors. Instead of manually copying error messages and pasting them into a chat window, the extension automates this step by reading diagnostic information directly from VS Code's language diagnostics API.
This ensures that the full context of the error is captured, including the diagnostic message, severity, source, code range, related information, selected text, surrounding code, language identifier, and line number.
The extension provides two commands, Copy Error with Context and Explain This Error, both of which generate a Markdown prompt containing the collected information. The prompt is then sent to an AI tool of the user's choice, such as GitHub Copilot, Claude, or ChatGPT. The output can be viewed within the editor using VS Code's Language Model API for Copilot or opened in a browser for other AI providers. In case Copilot is not available, the prompt is kept on the clipboard for the user to paste manually.
Privacy is a key concern for ErrorCopy, and the extension takes steps to protect user data. It masks common secret patterns like API keys, tokens, passwords, and Bearer credentials before sending the prompt. The extension also excludes file paths by default to prevent the unintentional disclosure of sensitive information such as usernames, company names, or private repository layouts. Users can choose to include file paths in the prompt by enabling a specific setting.
The extension supports three types of AI providers: Copilot, browser-based providers, and Stack Overflow. Copilot offers the most integrated experience but is limited to users with a subscription and signed-in VS Code account. Browser-based providers require a manual step, while Stack Overflow provides a non-AI alternative by searching for common errors using the diagnostic text. This multi-approach design allows ErrorCopy to cater to a wide range of users and scenarios without depending on a single AI vendor.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.