Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026

Description

When filters are applied in the Output panel (hiding lines by log level, category, or text), search still finds matches in hidden lines, showing inflated counts and navigating to invisible results.

Changes

Wraps the text model's findMatches method in FilterController to filter out matches that intersect with hidden areas:

  • Intercepts search requests when model is attached to Output editor
  • Filters matches using Range.areIntersecting() against hiddenAreas
  • Handles both overloaded findMatches signatures via runtime type check
  • Restores original method on model disposal via modelDisposables
// In FilterController.onDidChangeModel()
const originalFindMatches = model.findMatches.bind(model);
model.findMatches = ((searchString, rawSearchScope, ...) => {
    const allMatches = typeof rawSearchScope === 'boolean'
        ? originalFindMatches(searchString, rawSearchScope, ...)
        : originalFindMatches(searchString, rawSearchScope, ...);
    
    return allMatches.filter(match => {
        return !this.hiddenAreas.some(hiddenArea => 
            Range.areIntersecting(match.range, hiddenArea)
        );
    });
}) as typeof model.findMatches;

Search now returns only visible matches, with accurate counts and navigation isolated to the Output panel.

Original prompt

This section details on the original issue you should resolve

<issue_title>Search in Output pane shouldn't find invisible items that are hidden due to filter</issue_title>
<issue_description>Using a filter, one can filter down Output pane contents to only specific log statements. However, searching still "finds" invisible results.

https://github.com/user-attachments/assets/756f8030-a44b-4288-bfd2-12b3ce44d4fc</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 12, 2026 19:48
…t panel

Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com>
Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com>
Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix search in Output pane for filtered items Fix search in Output panel to exclude filtered/hidden lines Jan 12, 2026
Copilot AI requested a review from joaomoreno January 12, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search in Output pane shouldn't find invisible items that are hidden due to filter

2 participants