TECHNOLOGY

VS Code problem matchers: turn terminal text into navigable diagnostics

In this article
THE QUICK TAKE

A problem matcher structures recognized task output; validate path resolution and parser coverage separately from the command's exit status and actual result.

A terminal error is often plain text, while an editor diagnostic has a file, location, severity, and navigable identity. VS Code problem matchers bridge those representations by parsing supported task output. An agent workflow can benefit from the structured result when its tools expose it, but the parser does not fix the underlying error or prove that an unmatched task succeeded.

A diagnostic needs more than an error word

A useful problem record identifies a resource, a position, and a message with an appropriate severity. A problem matcher extracts these fields from a known output format. Different compilers and linters print different layouts, so a generic search for the word error cannot replace a real parser. Use an existing supported matcher where available and inspect a representative diagnostic before assuming the Problems view accurately reflects a tool’s output.

Primary reference: VS Code: Integrate with External Tools via Tasks.

Relative paths need the right base

A compiler can print a relative filename from its working directory. The matcher must resolve it against the intended project location. In a multi-package workspace, the same relative path can identify several files. Check the task’s working directory and file-location configuration together. A perfectly parsed line number attached to the wrong file is misleading structured evidence, and an agent can make a precise-looking but irrelevant edit if it trusts that location without checking.

Primary reference: VS Code: How Copilot Understands Your Workspace.

No parsed problems does not imply success

The command can fail before emitting a recognized diagnostic, use a changed output format, or print errors outside the matcher’s pattern. Check exit status and raw relevant output as well as the Problems view. Conversely, an old diagnostic can remain until the next appropriate update. Treat parser state and process state separately. This prevents an empty panel from becoming an unsupported assertion that a build or test suite passed.

Primary reference: VS Code: Add Context to Chat.

Background tasks have a lifecycle too

A watch task can keep running while emitting several waves of diagnostics. The editor needs supported begin and end signals to know when a cycle is active or ready. A process that has not exited can still have completed one useful compilation cycle, while another may still be processing. Read the background matcher contract before using task readiness as a dependency for later work. Otherwise a dependent action can start before the relevant output is actually prepared.

Validate the bridge with a controlled failure

Use a harmless known diagnostic in a test fixture to check message text, severity, file, and position. Then repair it and confirm the record updates appropriately. In an agent workflow, inspect whether the available tool reads structured diagnostics or only terminal output. State the evidence actually used. The useful result is a reliable navigation bridge that speeds diagnosis while preserving the distinction between parsing an error and validating the code change that resolves its cause.

Related reading: Continue vs Cline vs Aider for local coding; Reproducible inference stacks: preserving a GPU pilot’s result.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles