Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 3c0f740

Browse files
committed
Find definition for methodmaps. #1
1 parent f549f2a commit 3c0f740

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

App/AssemblyInfo1.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@
3333
#if (DEBUG)
3434
[assembly: AssemblyVersion("1.13.*")]
3535
#else
36-
[assembly: AssemblyVersion("1.3.0.1")]
36+
[assembly: AssemblyVersion("1.3.0.2")]
3737
#endif

UI/Components/IntelliSenseController.cs

+31-3
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)