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

Commit

Permalink
Find definition for methodmaps. #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexer10 committed Mar 27, 2020
1 parent f549f2a commit 3c0f740
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion App/AssemblyInfo1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
#if (DEBUG)
[assembly: AssemblyVersion("1.13.*")]
#else
[assembly: AssemblyVersion("1.3.0.1")]
[assembly: AssemblyVersion("1.3.0.2")]
#endif
34 changes: 31 additions & 3 deletions UI/Components/IntelliSenseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,19 @@ private void EvaluateIntelliSense()
found = true;
}

// Try to find declaration
if (!found)
{
// Many any methodmap, since the ide is not aware of the types
foreach (var methodMap in methodMaps)
var pattern =
$@"\b((?<class>[a-zA-Z_]([a-zA-Z0-9_]?)+))\s+({classString})\s*(;|=)";
var findDecl = new Regex(pattern, RegexOptions.Compiled);
var match = findDecl.Match(editor.Text);
var classMatch = match.Groups["class"].Value;
if (classMatch.Length > 0)
{
var methodMap = methodMaps.FirstOrDefault(e => e.Name == classMatch);
var method =
methodMap.Methods.FirstOrDefault(e => e.Name == methodString);
methodMap?.Methods.FirstOrDefault(e => e.Name == methodString);
if (method != null)
{
xPos = ISMatches[j].Groups["method"].Index +
Expand All @@ -214,9 +220,31 @@ private void EvaluateIntelliSense()
ISFuncNameStr = method.FullName;
ISFuncDescriptionStr = method.CommentString;
ForceReSet = true;
found = true;
}
}
}

// Match the first found
if (!found)
{
// Many any methodmap, since the ide is not aware of the types
foreach (var methodMap in methodMaps)
{
var method =
methodMap.Methods.FirstOrDefault(e => e.Name == methodString);

if (method == null)
continue;

xPos = ISMatches[j].Groups["method"].Index +
ISMatches[j].Groups["method"].Length;
ForwardShowIS = true;
ISFuncNameStr = method.FullName;
ISFuncDescriptionStr = method.CommentString;
ForceReSet = true;
}
}
}
else
{
Expand Down

0 comments on commit 3c0f740

Please sign in to comment.