Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

The Comments view filter only matched against filenames, preventing users from disambiguating files with identical names in different directories. Filtering for src/sentinel.c would fail even when comments existed in that specific file.

Changes

Filter logic enhancement (commentsTreeViewer.ts)

  • Try basename match first (preserves existing behavior)
  • Fall back to full path match if basename doesn't match
  • Enables filtering by patterns like src/sentinel.c, lib/package.json, etc.
// Before: only matched filename
const uriMatches = FilterOptions._filter(filterText, basename(resource));

// After: matches filename OR path
let uriMatches = FilterOptions._filter(filterText, basename(resource));
if (!uriMatches) {
    uriMatches = FilterOptions._filter(filterText, resource.path);
}

Test coverage (commentsView.test.ts)

  • Verify src/sentinel.c filters to single file in src/ directory
  • Verify sentinel.c still matches all files named sentinel.c (backward compatibility)
Original prompt

This section details on the original issue you should resolve

<issue_title>Filter comments only accepts filenames and not repo relative paths</issue_title>
<issue_description>
Type: Bug

  1. Clone https://github.com/valkey-io/valkey
  2. Open it in VS code
  3. Switch to the GitHub Pull Requests sidebar
  4. Expand the pull request Spelling valkey-io/valkey#2183 (for me it's in Created By Me, but you can use All Open or create a filter for this PR)
  5. Click on the pull request (?) to try to get the comments area to appear below showing ~122 comments
  6. type src/sentinel.c into the filter box expecting to see the file
    Image

Note that it's perfectly reasonable for multiple files by the same name to exist in a repository (Makefile, README.md, package.json) and it's quite likely that a user will only care about a specific one even if there are multiple files by that name with comments.

Extension version: 0.113.2025062009
VS Code version: Code 1.101.1 (Universal) (18e3a1e, 2025-06-18T13:35:12.605Z)
OS version: Darwin arm64 24.5.0
Modes:

System Info
Item Value
CPUs Apple M1 Max (10 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 41, 31, 24
Memory (System) 64.00GB (0.27GB free)
Process Argv --crash-reporter-id 1fc67ee2-0174-4598-9f98-4537df0dd32c
Screen Reader no
VM 0%
A/B Experiments
vspor879:30202332
vspor708:30202333
vspor363:30204092
binariesv615:30325510
c4g48928:30535728
962ge761:30959799
pythontbext0:30879054
cppperfnew:31000557
pythonrstrctxt:31112756
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
c7cif404:31314491
996jf627:31283433
usemplatestapi:31297334
7bj51361:31289155
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003

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 2 commits December 8, 2025 11:52
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix comment filter to accept repo relative paths Support path-based filtering in Comments view Dec 8, 2025
Copilot AI requested a review from alexr00 December 8, 2025 12:00
Copilot finished work on behalf of alexr00 December 8, 2025 12:00
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.

Filter comments only accepts filenames and not repo relative paths

2 participants