|
|
|
@ -4,6 +4,7 @@
@@ -4,6 +4,7 @@
|
|
|
|
|
using System; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.Collections.ObjectModel; |
|
|
|
|
using System.Globalization; |
|
|
|
|
using System.Windows; |
|
|
|
|
using System.Windows.Controls; |
|
|
|
|
using System.Windows.Controls.Primitives; |
|
|
|
@ -221,7 +222,7 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
@@ -221,7 +222,7 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
|
|
|
|
|
{ |
|
|
|
|
// if the user just typed one more character, don't filter all data but just filter what we are already displaying
|
|
|
|
|
var listToFilter = (this.currentList != null && (!string.IsNullOrEmpty(this.currentText)) && (!string.IsNullOrEmpty(query)) && |
|
|
|
|
query.StartsWith(this.currentText)) ? |
|
|
|
|
query.StartsWith(this.currentText, StringComparison.Ordinal)) ? |
|
|
|
|
this.currentList : this.completionData; |
|
|
|
|
|
|
|
|
|
var matchingItems = |
|
|
|
@ -328,7 +329,7 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
@@ -328,7 +329,7 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
|
|
|
|
|
if (string.Equals(itemText, query, StringComparison.OrdinalIgnoreCase)) |
|
|
|
|
return 7; |
|
|
|
|
|
|
|
|
|
if (itemText.StartsWith(query)) |
|
|
|
|
if (itemText.StartsWith(query, StringComparison.Ordinal)) |
|
|
|
|
return 6; |
|
|
|
|
if (itemText.StartsWith(query, StringComparison.OrdinalIgnoreCase)) |
|
|
|
|
return 5; |
|
|
|
@ -361,7 +362,7 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
@@ -361,7 +362,7 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
|
|
|
|
|
foreach (char upper in text.Where(c => char.IsUpper(c))) { |
|
|
|
|
if (i > query.Length - 1) |
|
|
|
|
return true; // return true here for CamelCase partial match ("CQ" matches "CodeQualityAnalysis")
|
|
|
|
|
if (char.ToUpper(query[i]) != upper) |
|
|
|
|
if (char.ToUpper(query[i], CultureInfo.InvariantCulture) != upper) |
|
|
|
|
return false; |
|
|
|
|
i++; |
|
|
|
|
} |
|
|
|
|