@@ -199,13 +199,19 @@ private void EvaluateIntelliSense()
199
199
found = true ;
200
200
}
201
201
202
+ // Try to find declaration
202
203
if ( ! found )
203
204
{
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 )
206
211
{
212
+ var methodMap = methodMaps . FirstOrDefault ( e => e . Name == classMatch ) ;
207
213
var method =
208
- methodMap . Methods . FirstOrDefault ( e => e . Name == methodString ) ;
214
+ methodMap ? . Methods . FirstOrDefault ( e => e . Name == methodString ) ;
209
215
if ( method != null )
210
216
{
211
217
xPos = ISMatches [ j ] . Groups [ "method" ] . Index +
@@ -214,9 +220,31 @@ private void EvaluateIntelliSense()
214
220
ISFuncNameStr = method . FullName ;
215
221
ISFuncDescriptionStr = method . CommentString ;
216
222
ForceReSet = true ;
223
+ found = true ;
217
224
}
218
225
}
219
226
}
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
+ }
220
248
}
221
249
else
222
250
{
0 commit comments