Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion source/NVDAObjects/UIA/VisualStudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
available in Visual Studio and SQL Server Management Studio.
"""

from . import UIA
from . import UIA, ToolTip
import speech
import braille
import api
import time


class IntelliSenseItem(UIA):
Expand Down Expand Up @@ -53,6 +54,34 @@ class IntelliSenseLiveRegion(UIA):
}


class CompletionToolTip(ToolTip):
""" A tool tip for which duplicate open events can be fired.
"""

#: Keeps track of the last ToolTipOpened event (text, time)
_lastToolTipOpenedInfo = (None, None)
#: The duplicate tooltip events will be dropped within this time window
_preventDuplicateToolTipSeconds = 0.2

def event_UIA_toolTipOpened(self):
oldText, oldTime = self._lastToolTipOpenedInfo
newText = self.name
newTime = time.time()
self.__class__._lastToolTipOpenedInfo = (newText, newTime)
withinPossibleDupToolTipTimeWindow = (
oldTime is not None
and (newTime - oldTime) < self._preventDuplicateToolTipSeconds
)
if newText == oldText and withinPossibleDupToolTipTimeWindow:
# Tool-tip event suspected to be a duplicate, drop the event.
# - Users attempting to rapidly re-announce tool-tips may
# have the announcement erroneously suppressed
# - Users on slower systems (or systems under load) may still
# receive duplicate announcements
return
super().event_UIA_toolTipOpened()


def findExtraOverlayClasses(obj, clsList):
if obj.UIAAutomationId in _INTELLISENSE_LIST_AUTOMATION_IDS:
clsList.insert(0, IntelliSenseList)
Expand All @@ -64,3 +93,5 @@ def findExtraOverlayClasses(obj, clsList):
and isinstance(obj.previous.previous, IntelliSenseList)
):
clsList.insert(0, IntelliSenseLiveRegion)
elif obj.UIAAutomationId == "completion tooltip":
clsList.insert(0, CompletionToolTip)
1 change: 1 addition & 0 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ What's New in NVDA
- In Microsoft Teams builds with version numbers like 1.3.00.28xxx, NVDA no longer fails reading messages in chats or Teams channels due to an incorrectly focused menu. (#11821)
- Text marked both as being a spelling and grammar error at the same time in Google Chrome will be appropriately announced as both a spelling and grammar error by NVDA. (#11787)
- When using Outlook (French locale), the shortcut for 'Reply all' (control+shift+R) works again. (#11196)
- In Visual Studio, IntelliSense tool tips that provide additional details about the currently selected IntelliSense item are now only reported once. (#11611)


== Changes for Developers ==
Expand Down