Skip to content

feat(tools): add scope, source, and column filters to errors_list - #117

Merged
CalvinAllen merged 1 commit into
mainfrom
feat/tools/errors-list-filters
Oct 1, 2026
Merged

CalvinAllen merged 1 commit into
mainfrom
feat/tools/errors-list-filters

Conversation

@CalvinAllen

@CalvinAllen CalvinAllen commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the filters requested in #111 to errors_list, matching the Error List window's drop-downs, search box and column filters.

  • 🔭 Scope: scope is solution (default), openDocuments, currentProject or currentDocument. The window's scope drop-down is internal API (Microsoft.Internal.VisualStudio.Shell.ErrorList), so each scope is resolved from the active document, the open documents, or the active document's project. Projects are matched by GUID, as VS does, falling back to the project name for build entries that carry no GUID.
  • 🛠️ Build + IntelliSense: source is all (default), build or intellisense, read from each entry's ErrorSource.
  • 🔍 Search: search looks across description, code, project, file path, tool and category.
  • 🧮 Column filters:
    • code, tool and category take comma-separated lists.
    • suppressionState is all, active, suppressed or notApplicable.
    • project also matches multi-target names such as MyApp (net8.0).
    • path takes a file name, folder or partial path, matched on whole path segments, so src/App does not match src/Application.
  • 📄 New item fields: Source, Tool, Category and SuppressionState.
  • 📝 Notes: the tool only sees what the Error List window displays (IWpfTableControl.Entries). Notes says when the window itself is hiding errors, warnings, messages, Build entries or IntelliSense entries, so asking for source: intellisense while the window is on "Build Only" no longer returns nothing without explanation. It also explains when a scope cannot match anything, for example when no document is active.
  • 🔗 Shared files: an error in a shared file sets ProjectNames / ProjectGuids instead of ProjectName / ProjectGuid. Project matching reads both, and Project lists every project, separated by commas.
  • 🔢 MatchedCount: builds on fix(tools): count every error entry and set truncated in errors_list #114. The severity counts still cover the whole Error List. The new MatchedCount reports how many entries passed the filters, including any cut off by maxResults. When severity is the only filter, entries past the cap are still not read in full. Any other filter needs an entry's details to decide whether it matches, so in that case every entry is read.
  • ✅ Validation: unknown severity, scope, source or suppressionState values return an error message listing the valid values, like the breakpoint tools do. Previously an unknown severity silently matched nothing.

The matching rules live in Services/ErrorListFilter.cs, which has no Visual Studio dependencies so they can be unit tested. The RPC call now takes an ErrorListQuery instead of separate arguments.

Notes

  • 🚫 Changed Documents scope is not supported. It depends on source-control status, which would need either the git CLI or the VS source control API, and the extension uses neither. The scope parameter description says so.
  • 🙈 Suppressed entries: the window hides them by default through its Suppression State column filter, which is not readable through IErrorList. suppressionState: suppressed only returns them when the user has changed that column filter. The parameter description says so.
  • 📚 The errors_list rows in README.md and CLAUDE.md are updated. CLAUDE.md also gains a short note on how the tool's filters relate to the window's.

Testing

  • dotnet build src/CodingWithCalvin.MCPServer.slnx: 0 warnings, 0 errors
  • dotnet test: 185 passed
    • ErrorListFilterTests.cs (new) covers every filter and scope, multi-project entries, segment-based path matching, project names with a target-framework suffix, the hidden-category notes, and the ErrorSource and SuppressionState name mapping.
    • ErrorListTests.cs (from fix(tools): count every error entry and set truncated in errors_list #114) is adapted to the new signature, and its tests still pass, including the one that checks entries past the cap are not read. New tests cover MatchedCount, reading every entry when a detail filter is set, and unreadable entries never matching a detail filter.
  • ⚠️ Not yet run in Visual Studio. The unit tests cover the matching rules. These parts still need a manual check in the experimental instance:
    • reading ErrorSource, SuppressionState, BuildTool, ErrorCategory and ProjectNames / ProjectGuids off live entries
    • the IErrorList.Are*Shown notes
    • resolving each scope from the active document

errors_list can now filter by the Error List's scope (solution, open documents, current project, current document), by Build or IntelliSense source, by suppression state, and by code, tool, category, project, path, or free text. Each item now reports its source, tool, category, and suppression state.

The tool reads only what the Error List window displays, so Notes reports any severity or source the window itself is hiding. The window's scope drop-down is internal API, so scopes are resolved from the active document, the open documents, and the active document's project. Project matching also reads ProjectNames and ProjectGuids, which replace ProjectName and ProjectGuid for errors in shared files.

The counts still cover the whole Error List. MatchedCount reports how many entries passed the filters, including any cut off by maxResults. Entries past the cap are still left unread when severity is the only filter; any other filter needs the entry's details, so every entry is read.

The filter rules live in ErrorListFilter, which has no Visual Studio dependencies so they can be unit tested. The RPC call now takes an ErrorListQuery instead of separate arguments.
@CalvinAllen
CalvinAllen merged commit 79567a9 into main Oct 1, 2026
2 checks passed
@CalvinAllen
CalvinAllen deleted the feat/tools/errors-list-filters branch October 1, 2026 20:27
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