-
-
Notifications
You must be signed in to change notification settings - Fork 618
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work around VS Code specific performance issues (PR #11657)
- Loading branch information
1 parent
de18dc1
commit 18c737b
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# A part of NonVisual Desktop Access (NVDA) | ||
# Copyright (C) 2020 NV Access Limited, Leonard de Ruijter | ||
# This file is covered by the GNU General Public License. | ||
# See the file COPYING for more details. | ||
|
||
""" App module for Visual Studio Code Insiders. | ||
This app module simply inherrits from the app module for the stable version of Code. | ||
""" | ||
|
||
# Ignoring Flake8 imported but unused error since appModuleHandler yet uses the import. | ||
from .code import AppModule # noqa: F401 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# A part of NonVisual Desktop Access (NVDA) | ||
# Copyright (C) 2020 NV Access Limited, Leonard de Ruijter | ||
# 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 | ||
from NVDAObjects.IAccessible.chromium import Document | ||
from NVDAObjects import NVDAObject | ||
|
||
|
||
class VSCodeDocument(Document): | ||
"""The only content in the root document node of Visual Studio code is the application object. | ||
Creating a tree interceptor on this object causes a major slow down of Code. | ||
Therefore, forcefully block tree interceptor creation. | ||
""" | ||
_get_treeInterceptorClass = NVDAObject._get_treeInterceptorClass | ||
|
||
|
||
class AppModule(appModuleHandler.AppModule): | ||
|
||
def chooseNVDAObjectOverlayClasses(self, obj, clsList): | ||
if Document in clsList and obj.IA2Attributes.get("tag") == "#document": | ||
clsList.insert(0, VSCodeDocument) |
This file contains 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