File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
ICSharpCode.AvalonEdit/Editing Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1085,6 +1085,15 @@ public bool OverstrikeMode {
10851085
10861086 #endregion
10871087
1088+ #region AutomationPeer override for CodeCompletion
1089+ /// <summary>
1090+ /// Gets or sets AutomationPeer instance used by CodeCompletion.
1091+ /// CompletionWindow can use this property to inject AutomationPeer that reflects
1092+ /// the suggestion list and the value of the currently selected CompletionData item.
1093+ /// </summary>
1094+ public System . Windows . Automation . Peers . AutomationPeer CodeCompletionAutomationPeer { get ; set ; }
1095+ #endregion
1096+
10881097 /// <inheritdoc/>
10891098 protected override System . Windows . Automation . Peers . AutomationPeer OnCreateAutomationPeer ( )
10901099 {
Original file line number Diff line number Diff line change @@ -76,6 +76,11 @@ public ITextRangeProvider Clone()
7676 public bool Compare ( ITextRangeProvider range )
7777 {
7878 TextRangeProvider other = ( TextRangeProvider ) range ;
79+ if ( textArea . CodeCompletionAutomationPeer != null ) {
80+ Log ( "{0}.Compare({1}) [ActiveIntelliSenseAutomationPeer != null]= false" , ID , other . ID ) ;
81+ return false ;
82+ }
83+
7984 bool result = doc == other . doc
8085 && segment . Offset == other . segment . Offset
8186 && segment . EndOffset == other . segment . EndOffset ;
@@ -194,6 +199,11 @@ public IRawElementProviderSimple GetEnclosingElement()
194199 public string GetText ( int maxLength )
195200 {
196201 Log ( "{0}.GetText({1})" , ID , maxLength ) ;
202+ if ( textArea . CodeCompletionAutomationPeer != null ) {
203+ var result = textArea . CodeCompletionAutomationPeer . GetName ( ) ;
204+ Log ( "{0}.GetText({1}) --> {2}" , ID , maxLength , result ) ;
205+ return result ;
206+ }
197207 if ( maxLength < 0 )
198208 return doc . GetText ( segment ) ;
199209 else
You can’t perform that action at this time.
0 commit comments