Repository navigation
feat(tools): add scope, source, and column filters to errors_list - #117
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the filters requested in #111 to
errors_list, matching the Error List window's drop-downs, search box and column filters.scopeissolution(default),openDocuments,currentProjectorcurrentDocument. 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.sourceisall(default),buildorintellisense, read from each entry'sErrorSource.searchlooks across description, code, project, file path, tool and category.code,toolandcategorytake comma-separated lists.suppressionStateisall,active,suppressedornotApplicable.projectalso matches multi-target names such asMyApp (net8.0).pathtakes a file name, folder or partial path, matched on whole path segments, sosrc/Appdoes not matchsrc/Application.Source,Tool,CategoryandSuppressionState.IWpfTableControl.Entries).Notessays when the window itself is hiding errors, warnings, messages, Build entries or IntelliSense entries, so asking forsource: intellisensewhile 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.ProjectNames/ProjectGuidsinstead ofProjectName/ProjectGuid. Project matching reads both, andProjectlists 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 newMatchedCountreports how many entries passed the filters, including any cut off bymaxResults. 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.severity,scope,sourceorsuppressionStatevalues 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 anErrorListQueryinstead of separate arguments.Notes
gitCLI or the VS source control API, and the extension uses neither. Thescopeparameter description says so.IErrorList.suppressionState: suppressedonly returns them when the user has changed that column filter. The parameter description says so.errors_listrows 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 errorsdotnet test: 185 passedErrorListFilterTests.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 theErrorSourceandSuppressionStatename 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 coverMatchedCount, reading every entry when a detail filter is set, and unreadable entries never matching a detail filter.ErrorSource,SuppressionState,BuildTool,ErrorCategoryandProjectNames/ProjectGuidsoff live entriesIErrorList.Are*Shownnotes