@@ -199,13 +199,19 @@ private void EvaluateIntelliSense()
199199 found = true ;
200200 }
201201
202+ // Try to find declaration
202203 if ( ! found )
203204 {
204- // Many any methodmap, since the ide is not aware of the types
205- foreach ( var methodMap in methodMaps )
205+ var pattern =
206+ $@ "\b((?<class>[a-zA-Z_]([a-zA-Z0-9_]?)+))\s+({ classString } )\s*(;|=)";
207+ var findDecl = new Regex ( pattern , RegexOptions . Compiled ) ;
208+ var match = findDecl . Match ( editor . Text ) ;
209+ var classMatch = match . Groups [ "class" ] . Value ;
210+ if ( classMatch . Length > 0 )
206211 {
212+ var methodMap = methodMaps . FirstOrDefault ( e => e . Name == classMatch ) ;
207213 var method =
208- methodMap . Methods . FirstOrDefault ( e => e . Name == methodString ) ;
214+ methodMap ? . Methods . FirstOrDefault ( e => e . Name == methodString ) ;
209215 if ( method != null )
210216 {
211217 xPos = ISMatches [ j ] . Groups [ "method" ] . Index +
@@ -214,9 +220,31 @@ private void EvaluateIntelliSense()
214220 ISFuncNameStr = method . FullName ;
215221 ISFuncDescriptionStr = method . CommentString ;
216222 ForceReSet = true ;
223+ found = true ;
217224 }
218225 }
219226 }
227+
228+ // Match the first found
229+ if ( ! found )
230+ {
231+ // Many any methodmap, since the ide is not aware of the types
232+ foreach ( var methodMap in methodMaps )
233+ {
234+ var method =
235+ methodMap . Methods . FirstOrDefault ( e => e . Name == methodString ) ;
236+
237+ if ( method == null )
238+ continue ;
239+
240+ xPos = ISMatches [ j ] . Groups [ "method" ] . Index +
241+ ISMatches [ j ] . Groups [ "method" ] . Length ;
242+ ForwardShowIS = true ;
243+ ISFuncNameStr = method . FullName ;
244+ ISFuncDescriptionStr = method . CommentString ;
245+ ForceReSet = true ;
246+ }
247+ }
220248 }
221249 else
222250 {
0 commit comments