Accessible View: include file paths for inline references in chat responses#301565
Merged
meganrogge merged 9 commits intomainfrom Mar 23, 2026
Merged
Accessible View: include file paths for inline references in chat responses#301565meganrogge merged 9 commits intomainfrom
meganrogge merged 9 commits intomainfrom
Conversation
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
meganrogge
reviewed
Mar 13, 2026
meganrogge
approved these changes
Mar 17, 2026
Contributor
There was a problem hiding this comment.
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
inlineReferenceresponse parts inChatResponseAccessibleProvider._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.fsPathwhen available, which differs on Windows. Build the expectedpath:linestring fromfileLocation.uri.fsPath || fileLocation.uri.pathso 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 useuri.fsPathfor file URIs on Windows. Use the created URI’sfsPath || pathas the expected value to make the test OS-agnostic.
assert.ok(content.includes('utils.ts'));
assert.ok(content.includes('/workspace/src/utils.ts'));
});
src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/test/browser/accessibility/chatResponseAccessibleView.test.ts
Show resolved
Hide resolved
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
approved these changes
Mar 17, 2026
roblourens
approved these changes
Mar 17, 2026
Member
|
@meganrogge Had to revert due to unit test failures on Windows |
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.
fixes #301564
The
_getContentmethod inChatResponseAccessibleProviderhad 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
case 'inlineReference'in_getContentto render references with full path context:index.ts (/path/to/index.ts)main.ts (/src/app/main.ts:42)MyClass (/src/myClass.ts:10)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/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)./.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)/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.