Skip to content

fix(tools): count every error entry and set truncated in errors_list - #114

Merged
CalvinAllen merged 1 commit into
mainfrom
fix/tools/errors-list-counts
Oct 1, 2026
Merged

CalvinAllen merged 1 commit into
mainfrom
fix/tools/errors-list-counts

Conversation

@CalvinAllen

@CalvinAllen CalvinAllen commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

errors_list reported counts that were capped by maxResults, zeroed by the severity filter, and it never set Truncated. This fixes all three.

  • Counts cover the whole Error List. The loop no longer stops at maxResults. TotalCount, ErrorCount, WarningCount and MessageCount are counted for every entry, whatever the severity filter. With 250 errors and the default maxResults = 100, the result is now TotalCount: 250, ErrorCount: 250, Truncated: true.
  • Truncated is set. It is true when more entries matched than maxResults allowed.
  • No placeholder item. When nothing matches, Items is empty with correct counts. The "build to populate the Error List" hint moved into the tool description, which now also explains what the counts and Truncated mean.
  • Entries past the cap are counted only. Their full details (text, file, line and so on) are only read for entries that are returned.

The counting and capping logic is now in VisualStudioService.CollectErrorListEntries, a pure method, so it can be unit tested without Visual Studio.

Notes

  • The counts come from the Error List table control, so they follow the window's own scope and source filters (for example "Current Project" or "Build Only").
  • feature request: more filters for errors_list #111 adds more errors_list filters and will change the same method, so whichever PR merges second will need a rebase.
  • symbol_workspace and find_references set Truncated with slightly different logic (one compares the unfiltered symbol count, the other uses >=). They are not changed here.

Testing

  • dotnet build src/CodingWithCalvin.MCPServer.slnx: 0 warnings, 0 errors
  • dotnet test: 90 passed, including 11 new tests in ErrorListTests.cs covering capped counts, counts under a severity filter, the Truncated boundary, empty results, entries that cannot be read, and reading details only for returned entries
  • Not yet run against a live Error List in Visual Studio

…list

TotalCount and the per-severity counts now cover the whole Error List instead of only the returned items, so they are no longer capped by maxResults or zeroed by the severity filter. Truncated is set when more entries matched than maxResults allowed. When nothing matches, Items is empty instead of holding a placeholder message.
@CalvinAllen CalvinAllen changed the title fix(tools): count every Error List entry and set Truncated in errors_list fix(tools): count every error list entry and set truncated in errors_list Oct 1, 2026
@CalvinAllen CalvinAllen changed the title fix(tools): count every error list entry and set truncated in errors_list fix(tools): count every error entry and set truncated in errors_list Oct 1, 2026
@CalvinAllen
CalvinAllen merged commit ed8aa83 into main Oct 1, 2026
2 of 5 checks passed
@CalvinAllen
CalvinAllen deleted the fix/tools/errors-list-counts branch October 1, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant