diff --git a/App/AssemblyInfo1.cs b/App/AssemblyInfo1.cs index 3be6a0d6..75648a82 100644 --- a/App/AssemblyInfo1.cs +++ b/App/AssemblyInfo1.cs @@ -33,5 +33,5 @@ #if (DEBUG) [assembly: AssemblyVersion("1.13.*")] #else -[assembly: AssemblyVersion("1.3.0.0")] +[assembly: AssemblyVersion("1.3.0.1")] #endif diff --git a/UI/Components/IntelliSenseController.cs b/UI/Components/IntelliSenseController.cs index 19239187..1c1987c1 100644 --- a/UI/Components/IntelliSenseController.cs +++ b/UI/Components/IntelliSenseController.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Text.RegularExpressions; using System.Windows; using System.Windows.Input; @@ -182,65 +183,53 @@ private void EvaluateIntelliSense() { var methodString = ISMatches[j].Groups["method"].Value; var found = false; + // Match for static methods. - foreach (var methodMap in methodMaps) + var staticMethodMap = methodMaps.FirstOrDefault(e => e.Name == classString); + var staticMethod = + staticMethodMap?.Methods.FirstOrDefault(e => e.Name == methodString); + if (staticMethod != null) { - if (classString == methodMap.Name) - { - foreach (var method in methodMap.Methods) - { - if (method.Name == methodString) - { - xPos = ISMatches[j].Groups["method"].Index + - ISMatches[j].Groups["method"].Length; - ForwardShowIS = true; - ISFuncNameStr = method.FullName; - ISFuncDescriptionStr = method.CommentString; - ForceReSet = true; - found = true; - break; - } - } - - break; - } + xPos = ISMatches[j].Groups["method"].Index + + ISMatches[j].Groups["method"].Length; + ForwardShowIS = true; + ISFuncNameStr = staticMethod.FullName; + ISFuncDescriptionStr = staticMethod.CommentString; + ForceReSet = true; + found = true; } + if (!found) { // Many any methodmap, since the ide is not aware of the types foreach (var methodMap in methodMaps) { - Console.WriteLine(methodMap.Name); - foreach (var method in methodMap.Methods) + var method = + methodMap.Methods.FirstOrDefault(e => e.Name == methodString); + if (method != null) { - if (method.Name == methodString) - { - xPos = ISMatches[j].Groups["method"].Index + - ISMatches[j].Groups["method"].Length; - ForwardShowIS = true; - ISFuncNameStr = method.FullName; - ISFuncDescriptionStr = method.CommentString; - ForceReSet = true; - found = true; - break; - } + xPos = ISMatches[j].Groups["method"].Index + + ISMatches[j].Groups["method"].Length; + ForwardShowIS = true; + ISFuncNameStr = method.FullName; + ISFuncDescriptionStr = method.CommentString; + ForceReSet = true; } } } } else { - foreach (var func in funcs) - if (testString == func.Name) - { - xPos = ISMatches[j].Groups["name"].Index + - ISMatches[j].Groups["name"].Length; - ForwardShowIS = true; - ISFuncNameStr = func.FullName; - ISFuncDescriptionStr = func.CommentString; - ForceReSet = true; - break; - } + var func = funcs.FirstOrDefault(e => e.Name == testString); + if (func != null) + { + xPos = ISMatches[j].Groups["name"].Index + + ISMatches[j].Groups["name"].Length; + ForwardShowIS = true; + ISFuncNameStr = func.FullName; + ISFuncDescriptionStr = func.CommentString; + ForceReSet = true; + } } break; @@ -248,6 +237,7 @@ private void EvaluateIntelliSense() if (FoundMatch) { + // ReSharper disable once RedundantAssignment scopeLevel--; //i have no idea why this works... break; }