Skip to content

fix(tools): errors_list counts are capped by maxResults and Truncated is never set #113

Closed

Description

@CalvinAllen

Problem

errors_list reports wrong counts when results are capped by maxResults, and it never says that results were cut off.

In VisualStudioService.GetErrorListAsync:

  • The loop stops as soon as maxResults items have been collected (if (count >= maxResults) break;). Entries after that are never looked at.
  • TotalCount, ErrorCount, WarningCount and MessageCount are only incremented for items added to Items, so they can never be higher than maxResults.
  • ErrorListResult.Truncated exists in DiagnosticsModels.cs but is never set, so it is always false.

So with 250 errors and the default maxResults = 100, the tool returns TotalCount: 100, ErrorCount: 100, Truncated: false. The caller has no way to know 150 errors are missing.

The severity filter has the same effect: entries skipped by the filter are never counted. With severity: "Error", WarningCount and MessageCount are always 0, even when the Error List has warnings and messages.

Repro

  1. Open a solution whose Error List has more than 100 entries (or call with a small maxResults, e.g. maxResults: 5).
  2. Call errors_list.
  3. TotalCount equals the number of items returned and Truncated is false.

Expected

  • The counts reflect every entry in the Error List, not just the returned page.
  • Truncated is true when more entries matched than maxResults allowed, matching how symbol_workspace and find_references already set it.

Also

When nothing matches, a placeholder item ("No errors or warnings in the Error List. Build the project to populate the Error List.") is added to Items with severity Message, while MessageCount and TotalCount stay 0. When a severity filter is active this text is misleading, because the Error List may have plenty of entries that the filter excluded. An empty Items list with correct counts would be clearer.

Related

#111 asks for more errors_list filters. More filters make accurate counts and Truncated more important, so this is worth fixing first or alongside it.

Activity

  1. self-assigned this
    on Oct 1, 2026
  2. CalvinAllen commented on Oct 1, 2026

    @CalvinAllen
    ContributorAuthor

    Fixed by #114. errors_list now counts every Error List entry whatever maxResults or the severity filter, sets Truncated when more entries match than maxResults allows, and returns an empty Items list instead of the placeholder item. #114 didn't link this issue, so it wasn't closed automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions