77available in Visual Studio and SQL Server Management Studio.
88"""
99
10- from . import UIA
10+ from . import UIA , ToolTip
1111import speech
1212import braille
1313import api
14+ import time
1415
1516
1617class IntelliSenseItem (UIA ):
@@ -53,6 +54,22 @@ class IntelliSenseLiveRegion(UIA):
5354}
5455
5556
57+ class CompletionToolTip (ToolTip ):
58+ """ A tool tip for which duplicate open events can be fired.
59+ """
60+
61+ _lastToolTipOpenedInfo = (None ,None ) #: Keeps track of the last ToolTipOpened event (text, time)
62+
63+ def event_UIA_toolTipOpened (self ):
64+ oldText , oldTime = self ._lastToolTipOpenedInfo
65+ newText = self .name
66+ newTime = time .time ()
67+ self .__class__ ._lastToolTipOpenedInfo = (newText , newTime )
68+ if newText == oldText and oldTime is not None and (newTime - oldTime ) < 0.2 :
69+ return
70+ super ().event_UIA_toolTipOpened ()
71+
72+
5673def findExtraOverlayClasses (obj , clsList ):
5774 if obj .UIAAutomationId in _INTELLISENSE_LIST_AUTOMATION_IDS :
5875 clsList .insert (0 , IntelliSenseList )
@@ -64,3 +81,5 @@ def findExtraOverlayClasses(obj, clsList):
6481 and isinstance (obj .previous .previous , IntelliSenseList )
6582 ):
6683 clsList .insert (0 , IntelliSenseLiveRegion )
84+ elif obj .UIAAutomationId == "completion tooltip" :
85+ clsList .insert (0 , CompletionToolTip )
0 commit comments