Skip to content

Accessible View: include file paths for inline references in chat responses#301565

Merged
meganrogge merged 9 commits intomainfrom
copilot/add-file-paths-to-accessible-view
Mar 23, 2026
Merged

Accessible View: include file paths for inline references in chat responses#301565
meganrogge merged 9 commits intomainfrom
copilot/add-file-paths-to-accessible-view

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

fixes #301564

Screenshot 2026-03-17 at 12 38 38 PM

The _getContent method in ChatResponseAccessibleProvider had no handler for 'inlineReference' parts, so file references were silently dropped from Accessible View output. Screen reader users lost all file/location context that sighted users get via clickable links.

Changes

  • Add case 'inlineReference' in _getContent to render references with full path context:
    • URI → index.ts (/path/to/index.ts)
    • Location → main.ts (/src/app/main.ts:42)
    • WorkspaceSymbol → MyClass (/src/myClass.ts:10)
  • Add 3 tests covering URI, Location, and unnamed reference variants

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --crashpad-handler-pid=10347 --enable-crash-reporter=d177401a-eb58-44ff-ac1d-d1fa516be283,no_channel --user-data-dir=/tmp/vscode-tests-1773428169076 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,11203816706289380835,398752563473043410,262144 --enable-features=PdfUseShowSaveFilePicker --disable-features=LocalNetworkAccessChecks,ScreenAIOCREnabled,SpareRendererForSitePerProcess,TraceSiteInstanceGetProcessCreation --variations-seed-version --trace-process-track-uuid=3190708989122997041 n/node inlineSources (dns block)
    • Triggering command: ./.build/electron/code-oss ./.build/electron/code-oss --no-sandbox test/unit/electron/index.js --crash-reporter-directory=/tmp/crash --grep ChatResponseAccessibleView k/vscode/vscode/extensions/types--sourceMap odules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node neSources extensions/refer-c st-import-aid/tsnode build/lib/electron.ts node n/ts�� /vscode/vscode/extensions/html-lfalse anguage-features/tsconfig.json node_modules/.bin/sh alse --sourceMapls --sourceMap --inlineSources sh (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --crashpad-handler-pid=12575 --enable-crash-reporter=d177401a-eb58-44ff-ac1d-d1fa516be283,no_channel --user-data-dir=/tmp/vscode-tests-1773428339009 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,2603294232392661056,4636766401633006337,262144 --enable-features=PdfUseShowSaveFilePicker --disable-features=LocalNetworkAccessChecks,ScreenAIOCREnabled,SpareRendererForSitePerProcess,TraceSiteInstanceGetProcessCreation --variations-seed-version --trace-process-track-uuid=3190708989122997041 ache/node/22.22.0/x64/lib/node_modules/npm/node_--inlineSources --inlineSourcessh /home/REDACTED/wor-c modules/@npmcli/tsgo --project /home/REDACTED/work/vscode/vscode/extensions/terminal-suggest/tscon--sourceMap sh (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI and others added 3 commits March 13, 2026 18:56
When the Accessible View renders chat responses, inline file references
(kind: 'inlineReference') were previously skipped entirely. This adds
handling to include the file name and full path (and line number for
locations) so screen reader users get the same context as the visual UI.

- Handle URI references: show "name (path)"
- Handle Location references: show "name (path:line)"
- Handle workspace symbol references: show "name (path:line)"
- Add 3 new tests verifying inline reference rendering

Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot AI changed the title [WIP] [ISSUE-123] Add file paths to Accessible View for context Accessible View: include file paths for inline references in chat responses Mar 13, 2026
Copilot AI requested a review from meganrogge March 13, 2026 19:05
@meganrogge meganrogge added this to the 1.113.0 milestone Mar 17, 2026
@meganrogge meganrogge marked this pull request as ready for review March 17, 2026 16:39
Copilot AI review requested due to automatic review settings March 17, 2026 16:39
@meganrogge meganrogge enabled auto-merge (squash) March 17, 2026 16:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an accessibility gap in the Chat “Accessible View” by ensuring inline file/location references (which are visually represented as clickable pills/links) are also included in the Accessible View text output with meaningful path context, addressing #301564.

Changes:

  • Add handling for inlineReference response parts in ChatResponseAccessibleProvider._getContent().
  • Format inline references to include both a display name and path/line context (where available).
  • Add unit tests for URI, Location, and unnamed inline reference variants.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.ts Adds Accessible View rendering for inlineReference parts to prevent references being dropped.
src/vs/workbench/contrib/chat/test/browser/accessibility/chatResponseAccessibleView.test.ts Adds tests asserting inline references include path/line context in Accessible View output.
Comments suppressed due to low confidence (2)

src/vs/workbench/contrib/chat/test/browser/accessibility/chatResponseAccessibleView.test.ts:596

  • This expectation hard-codes a POSIX path ("/src/app/main.ts:42"), but the provider formats file locations using ref.uri.fsPath when available, which differs on Windows. Build the expected path:line string from fileLocation.uri.fsPath || fileLocation.uri.path so the test passes on all platforms.
			assert.ok(content.includes('main.ts'));
			assert.ok(content.includes('/src/app/main.ts:42'));
		});

src/vs/workbench/contrib/chat/test/browser/accessibility/chatResponseAccessibleView.test.ts:645

  • This assertion hard-codes a POSIX path ("/workspace/src/utils.ts"), but provideContent() will use uri.fsPath for file URIs on Windows. Use the created URI’s fsPath || path as the expected value to make the test OS-agnostic.
			assert.ok(content.includes('utils.ts'));
			assert.ok(content.includes('/workspace/src/utils.ts'));
		});

meganrogge and others added 2 commits March 17, 2026 12:48
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@meganrogge meganrogge merged commit 29359ef into main Mar 23, 2026
17 of 19 checks passed
@meganrogge meganrogge deleted the copilot/add-file-paths-to-accessible-view branch March 23, 2026 22:18
@alexdima
Copy link
Member

@meganrogge Had to revert due to unit test failures on Windows

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.

Accessible View should include file paths when presenting file references

5 participants