Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for text review commands on object name in Visual Studio Code #16248

Merged
merged 11 commits into from
Jun 26, 2024
15 changes: 12 additions & 3 deletions source/appModules/code.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2020 NV Access Limited, Leonard de Ruijter
# Copyright (C) 2020-2024 NV Access Limited, Leonard de Ruijter, Cary-Rowen
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.

""" App module for Visual Studio Code.
"""

import appModuleHandler
import controlTypes
from NVDAObjects.IAccessible.chromium import Document
from NVDAObjects import NVDAObject

from NVDAObjects import NVDAObject, NVDAObjectTextInfo

class VSCodeDocument(Document):
"""The only content in the root document node of Visual Studio code is the application object.
Expand All @@ -24,3 +24,12 @@ class AppModule(appModuleHandler.AppModule):
def chooseNVDAObjectOverlayClasses(self, obj, clsList):
if Document in clsList and obj.IA2Attributes.get("tag") == "#document":
clsList.insert(0, VSCodeDocument)

def event_NVDAObject_init(self, obj: NVDAObject):
# This is a specific fix for Visual Studio Code,
# However, the root cause of the issue is issue #15159.
# Once issue #15159 is fixed,
# The PR #16248 that introduced this code can be immediately reverted.
# (see issue #15159 for full description)
if obj.role != controlTypes.Role.EDITABLETEXT:
obj.TextInfo = NVDAObjectTextInfo
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ What's New in NVDA
- ``alt+downArrow`` is now mapped to ``dot5+dot6+dot7+space``
-
- Fixed a bug causing NVDA to fail to read the ribbon and options within Geekbench. (#16251, @mzanm)
- Support added for text review commands for an object's name in Visual Studio Code. (#16248, @Cary-Rowen)
- Windows 11 fixes:
- NVDA will once again announce hardware keyboard input suggestions. (#16283, @josephsl)
- In Version 24H2 (2024 Update and Windows Server 2025), mouse and touch interaction can be used in quick settings. (#16348, @josephsl)
Expand Down