Expose the line number of the current line to accessibility APIs
The current line number is displayed in the status bar and can also be obtained by looking at the column of numbers to the left of the editor. However, there is no way to easily and reliably obtain that via accessibility API (e.g. AT-SPI2). I (the Orca maintainer) would like to include the line number on demand to users via the WhereAmI command. Therefore I need a reliable way to get it.
Note that AT-SPI2 currently lacks API specific to this purpose. Determining what that API should be requires input from the GTK maintainers (see https://gitlab.gnome.org/GNOME/gtk/-/issues/7526). That said, an object attribute should do the trick until that's sorted out.
@isidorn Thoughts?
Currently, it is possible to find the current line number using the keyboard, but it requires multiple steps. I need to press F6 repeatedly to reach the status bar, then use the left or right arrow keys to locate the line number, and finally press Escape to return to the editor.
While this workflow functions, it's not very efficient. Ideally, I’d love to have a quicker way to access the current line number with fewer keystrokes — perhaps through a dedicated keyboard shortcut or a command available in the command palette.
Additionally, it would be helpful if this information could be exposed in a way that screen readers like Orca can announce it directly, improving accessibility for blind users.
Would it be helpful if we introduced a command that would use aria live alert to read the current line number? It's hard to find a keybinding, so users would have to assign it themselves, but we could describe this command in the editor's help dialog for discoverability.
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
cc @jooyoungseo @rperez030 what do you think of this request?
cc @jooyoungseo @rperez030 what do you think of this request?
I've heard this concern for years, and I believe it's a very valid request—especially since some developers using screen readers prefer to hear or read line numbers as they navigate code. NVDA offers a feature to automatically read line numbers in text editors, but this doesn't work with VS Code, likely because the line number can't be accessed / calculated from the textarea element on windows. Currently, you can use Ctrl+G to obtain the line number, but this requires pressing Escape afterward to close the dialog. Even having a command that announces the current line number without shifting the focus away from the editor would be an improvement, though it wouldn't fully solve the issue. An ideal solution would probably require native support from the browser to communicate this information directly to various platforms. In the meantime, an aria-live announcement triggered on demand could be helpful.
CC @scottaohara in case you have thoughts about this. CC @codeofdusk do you know how NVDA calculates the line number for multiline text fields?
In the recent Enhancements in JAWS 2025.2505.43 (May 2025), the following feature has been added in Visual Studio Code:
Added a new Quick Settings option, Speak Line Numbers, which allows you to configure whether or not JAWS announces line numbers as you navigate documents using UP or DOWN ARROW.
Maybe, JAWS has found their own workaround.
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
:slightly_frowning_face: In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
In the recent Enhancements in JAWS 2025.2505.43 (May 2025), the following feature has been added in Visual Studio Code:
Added a new Quick Settings option, Speak Line Numbers, which allows you to configure whether or not JAWS announces line numbers as you navigate documents using UP or DOWN ARROW.
Maybe, JAWS has found their own workaround.
Presumably so. But workarounds tend to be fragile. As the Orca maintainer, I would be happy to provide support for this -- but only if the line number is exposed in a reasonable and predictable fashion.