11#nullable enable
22#pragma warning disable VSTHRD010
33
4- using System . Collections . ObjectModel ;
54using System . Runtime . InteropServices ;
65using ChinesePinyinIntelliSenseExtender . Options ;
76using Microsoft . VisualStudio ;
@@ -73,14 +72,12 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv
7372 }
7473 }
7574
76- ReadOnlyCollection < ICompletionSession > ? completionSessions = null ;
77-
7875 if ( nCmdID == ( uint ) VSConstants . VSStd2KCmdID . RETURN
7976 || nCmdID == ( uint ) VSConstants . VSStd2KCmdID . TAB
8077 || isTypedWhiteSpace
8178 || isTypedPunctuation )
8279 {
83- completionSessions ?? = _completionBroker . GetSessions ( _textView ) ;
80+ var completionSessions = _completionBroker . GetSessions ( _textView ) ;
8481 foreach ( var completionSession in completionSessions )
8582 {
8683 if ( ! completionSession . IsDismissed )
@@ -102,24 +99,7 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv
10299 }
103100 }
104101
105- var result = _nextCommandHandler . Exec ( ref pguidCmdGroup , nCmdID , nCmdexecopt , pvaIn , pvaOut ) ;
106-
107- if ( nCmdID == ( uint ) VSConstants . VSStd2KCmdID . BACKSPACE
108- || nCmdID == ( uint ) VSConstants . VSStd2KCmdID . DELETE )
109- {
110- completionSessions ??= _completionBroker . GetSessions ( _textView ) ;
111-
112- foreach ( var completionSession in completionSessions )
113- {
114- if ( ! completionSession . IsDismissed )
115- {
116- completionSession . Filter ( ) ;
117- }
118- return VSConstants . S_OK ;
119- }
120- }
121-
122- return result ;
102+ return _nextCommandHandler . Exec ( ref pguidCmdGroup , nCmdID , nCmdexecopt , pvaIn , pvaOut ) ;
123103 }
124104
125105 public int QueryStatus ( ref Guid pguidCmdGroup , uint cCmds , OLECMD [ ] prgCmds , IntPtr pCmdText ) => _nextCommandHandler . QueryStatus ( ref pguidCmdGroup , cCmds , prgCmds , pCmdText ) ;
0 commit comments