Files
vscode/extensions/copilot/src/extension/tools/node
Copilot e3f60219aa Fix diagnostics on empty lines being invisible to get_errors tool (#4025)
* Initial plan

* fix: show diagnostics on empty lines in get_errors tool and DiagnosticDescription

When a diagnostic is reported on an empty/blank line (e.g., a trailing
empty line at EOF), the DiagnosticDescription component was returning
an empty JSX fragment because the code content was empty after trimEnd().
This caused the entire diagnostic (including its error message) to be
invisible to the AI model.

Fixed by removing the empty-line guard and always emitting the diagnostic
message, just without a code block when the line has no content.

Also adds a test case for diagnostics reported on empty lines.

Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>

* formatting

* Update src/extension/tools/node/test/getErrorsTool.spec.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>
Co-authored-by: Rob Lourens <roblourens@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-02 06:21:01 +00:00
..