diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-06-21 11:12:19 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-06-21 11:12:19 +0400 |
commit | 6f706886ad68580d1f3264da6e1c6a2ed411bd8a (patch) | |
tree | 62434316b0bfdb0b146babd4b5c9d6d35f5d041b /main/src/addins/CBinding | |
parent | b4cb1d697d4841b35b7b6dd5a85ec267ec1892d2 (diff) |
Worked on passing code completion unit tests.
Diffstat (limited to 'main/src/addins/CBinding')
-rw-r--r-- | main/src/addins/CBinding/Gui/CTextEditorExtension.cs | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/main/src/addins/CBinding/Gui/CTextEditorExtension.cs b/main/src/addins/CBinding/Gui/CTextEditorExtension.cs index 2575395544..b4717f1995 100644 --- a/main/src/addins/CBinding/Gui/CTextEditorExtension.cs +++ b/main/src/addins/CBinding/Gui/CTextEditorExtension.cs @@ -250,31 +250,31 @@ namespace CBinding return null; } - public override ICompletionDataList HandleCodeCompletion ( - CodeCompletionContext completionContext, char completionChar) - { - int triggerWordLength = 0; - return HandleCodeCompletion (completionContext, completionChar, ref triggerWordLength); - - string lineText = Editor.GetLineText (completionContext.TriggerLine).TrimEnd(); - - // If the line ends with a matched extension, invoke its handler - foreach (KeyValuePair<string, GetMembersForExtension> pair in completionExtensions) { - if (lineText.EndsWith(pair.Key)) { - lineText = lineText.Substring (0, lineText.Length - pair.Key.Length); - - int nameStart = lineText.LastIndexOfAny (allowedCharsMinusColon) + 1; - string itemName = lineText.Substring (nameStart).Trim (); - - if (string.IsNullOrEmpty (itemName)) - return null; - - return pair.Value (this, pair.Key, itemName); - } - } - - return null; - } +// public override ICompletionDataList HandleCodeCompletion ( +// CodeCompletionContext completionContext, char completionChar) +// { +// int triggerWordLength = 0; +// return HandleCodeCompletion (completionContext, completionChar, ref triggerWordLength); +// +// string lineText = Editor.GetLineText (completionContext.TriggerLine).TrimEnd(); +// +// // If the line ends with a matched extension, invoke its handler +// foreach (KeyValuePair<string, GetMembersForExtension> pair in completionExtensions) { +// if (lineText.EndsWith(pair.Key)) { +// lineText = lineText.Substring (0, lineText.Length - pair.Key.Length); +// +// int nameStart = lineText.LastIndexOfAny (allowedCharsMinusColon) + 1; +// string itemName = lineText.Substring (nameStart).Trim (); +// +// if (string.IsNullOrEmpty (itemName)) +// return null; +// +// return pair.Value (this, pair.Key, itemName); +// } +// } +// +// return null; +// } public override ICompletionDataList CodeCompletionCommand ( CodeCompletionContext completionContext) @@ -284,7 +284,8 @@ namespace CBinding foreach (KeyValuePair<string, GetMembersForExtension> pair in completionExtensions) { if(lineText.EndsWith(pair.Key)) { - return HandleCodeCompletion (completionContext, Editor.GetCharAt (pos)); + int triggerWordLength = completionContext.TriggerWordLength; + return HandleCodeCompletion (completionContext, Editor.GetCharAt (pos), ref triggerWordLength); } } |