@@ -147,12 +147,15 @@ void CaretLocationChanged(object sender, EventArgs e)
147147 timer . Start ( ) ;
148148 }
149149
150- void ResolveAtCaret ( )
150+ async void ResolveAtCaret ( )
151151 {
152152 timer . Stop ( ) ;
153153 caretMovementTokenSource = new CancellationTokenSource ( ) ;
154- var rr = SD . ParserService . Resolve ( editor . FileName , editor . Caret . Location , editor . Document , cancellationToken : caretMovementTokenSource . Token ) ;
155- SetCurrentSymbol ( rr . GetSymbol ( ) ) ;
154+ try {
155+ var rr = await SD . ParserService . ResolveAsync ( editor . FileName , editor . Caret . Location , editor . Document , cancellationToken : caretMovementTokenSource . Token ) ;
156+ SetCurrentSymbol ( rr . GetSymbol ( ) ) ;
157+ } catch ( OperationCanceledException ) {
158+ }
156159 }
157160
158161 IResolveVisitorNavigator InitNavigator ( ICompilation compilation )
@@ -199,7 +202,7 @@ void FindCurrentReferences(int start, int end)
199202 void VisitVisibleNodes ( AstNode node , IResolveVisitorNavigator currentNavigator , CSharpAstResolver resolver , int start , int end )
200203 {
201204 if ( ! CSharpAstResolver . IsUnresolvableNode ( node ) )
202- currentNavigator . Resolved ( node , resolver . Resolve ( node , caretMovementTokenSource . Token ) ) ;
205+ currentNavigator . Resolved ( node , resolver . Resolve ( node ) ) ;
203206 for ( var child = node . FirstChild ; child != null ; child = child . NextSibling ) {
204207 if ( child . StartLocation . Line <= end && child . EndLocation . Line >= start )
205208 VisitVisibleNodes ( child , currentNavigator , resolver , start , end ) ;
0 commit comments