Skip to content

Make code lens discoverable and invokable for screen reader users#317265

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-lens-screen-reader-accessibility
Draft

Make code lens discoverable and invokable for screen reader users#317265
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-lens-screen-reader-accessibility

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

Code lenses render as widgets above their target line and are not focusable from the keyboard, so screen reader users cannot discover or invoke them. The existing codelens.showLensesInCurrentLine command only matched lenses on the exact cursor line and was undiscoverable from the editor's accessibility help.

Changes

  • ShowLensesInCurrentLine now invokes the closest code lens at or above the cursor (largest startLineNumber ≤ cursor line) instead of requiring an exact match, per @meganrogge's suggestion. The model-re-creation fallback path uses the same resolved target line.
  • Editor Accessibility Help dialog documents the command when EditorContextKeys.hasCodeLensProvider is set, so screen reader users discover it alongside Go to Symbol, Show Hover, Set Breakpoint, etc. The entry is gated on the context key to avoid noise in editors without code lenses (e.g. Markdown previews, output channels).
  • New localized AccessibilityHelpNLS.codeLens string using the standard <keybinding:codelens.showLensesInCurrentLine> placeholder.

No new keybindings, accessibility signals, settings, or services were introduced — the existing command and accessibility-help infrastructure are reused.

Copilot AI self-assigned this May 19, 2026
Copilot AI review requested due to automatic review settings May 19, 2026 07:27
Copilot AI review requested due to automatic review settings May 19, 2026 07:27
Copilot AI linked an issue May 19, 2026 that may be closed by this pull request
…readers

Co-authored-by: dmitrivMS <9581278+dmitrivMS@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 19, 2026 07:35
Copilot AI changed the title [WIP] Fix code lens accessibility via screen reader Make code lens discoverable and invokable for screen reader users May 19, 2026
Copilot AI requested a review from dmitrivMS May 19, 2026 07:36
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.

Code lens is not accessible via screen reader

2 participants