Browse Source

fixed XAML CC unit tests

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5671 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Siegfried Pammer 16 years ago
parent
commit
c919c50647
  1. 4
      src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/TextEditorBasedTests.cs
  2. 2
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataHelper.cs
  3. 10
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCodeCompletionBinding.cs
  4. 6
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompletionItemList.cs

4
src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/TextEditorBasedTests.cs

@ -28,7 +28,7 @@ namespace ICSharpCode.XamlBinding.Tests @@ -28,7 +28,7 @@ namespace ICSharpCode.XamlBinding.Tests
this.textEditor.Caret.Offset = fileHeader.Length;
this.textEditor.CreateParseInformation();
bool invoked = XamlCodeCompletionBinding.Instance.CtrlSpace(textEditor);
bool invoked = new XamlCodeCompletionBinding().CtrlSpace(textEditor);
Assert.AreEqual(expected, invoked);
@ -43,7 +43,7 @@ namespace ICSharpCode.XamlBinding.Tests @@ -43,7 +43,7 @@ namespace ICSharpCode.XamlBinding.Tests
this.textEditor.Caret.Offset = fileHeader.Length;
this.textEditor.CreateParseInformation();
CodeCompletionKeyPressResult result = XamlCodeCompletionBinding.Instance.HandleKeyPress(textEditor, keyPressed);
CodeCompletionKeyPressResult result = new XamlCodeCompletionBinding().HandleKeyPress(textEditor, keyPressed);
Assert.AreEqual(keyPressResult, result);

2
src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataHelper.cs

@ -533,7 +533,7 @@ namespace ICSharpCode.XamlBinding @@ -533,7 +533,7 @@ namespace ICSharpCode.XamlBinding
DebugTimer.Stop("CreateListForContext - InTag");
break;
case XamlContextDescription.InAttributeValue:
XamlCodeCompletionBinding.Instance.CtrlSpace(editor);
new XamlCodeCompletionBinding().CtrlSpace(editor);
break;
}

10
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCodeCompletionBinding.cs

@ -16,18 +16,8 @@ namespace ICSharpCode.XamlBinding @@ -16,18 +16,8 @@ namespace ICSharpCode.XamlBinding
{
public class XamlCodeCompletionBinding : ICodeCompletionBinding
{
static XamlCodeCompletionBinding instance;
bool trackForced = true;
public static XamlCodeCompletionBinding Instance {
get {
if (instance == null)
instance = new XamlCodeCompletionBinding();
return instance;
}
}
public CodeCompletionKeyPressResult HandleKeyPress(ITextEditor editor, char ch)
{
XamlCompletionContext context = CompletionDataHelper.ResolveCompletionContext(editor, ch);

6
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompletionItemList.cs

@ -76,7 +76,7 @@ namespace ICSharpCode.XamlBinding @@ -76,7 +76,7 @@ namespace ICSharpCode.XamlBinding
context.Editor.Document.Insert(context.EndOffset, "=\"\"");
context.CompletionCharHandled = context.CompletionChar == '=';
context.Editor.Caret.Offset--;
XamlCodeCompletionBinding.Instance.CtrlSpace(context.Editor);
new XamlCodeCompletionBinding().CtrlSpace(context.Editor);
} else if (xamlContext.Description == XamlContextDescription.InMarkupExtension && !string.IsNullOrEmpty(xamlContext.RawAttributeValue)) {
string valuePart = xamlContext.RawAttributeValue.Substring(0, xamlContext.ValueStartOffset);
AttributeValue value = MarkupExtensionParser.ParseValue(valuePart);
@ -100,7 +100,7 @@ namespace ICSharpCode.XamlBinding @@ -100,7 +100,7 @@ namespace ICSharpCode.XamlBinding
}
if (cItem.Text.EndsWith("=", StringComparison.OrdinalIgnoreCase))
XamlCodeCompletionBinding.Instance.CtrlSpace(context.Editor);
new XamlCodeCompletionBinding().CtrlSpace(context.Editor);
}
}
}
@ -121,7 +121,7 @@ namespace ICSharpCode.XamlBinding @@ -121,7 +121,7 @@ namespace ICSharpCode.XamlBinding
if (item is XamlCompletionItem && xamlContext.Description == XamlContextDescription.InTag) {
context.Editor.Document.Insert(context.EndOffset, "=\"\"");
context.Editor.Caret.Offset--;
XamlCodeCompletionBinding.Instance.CtrlSpace(context.Editor);
new XamlCodeCompletionBinding().CtrlSpace(context.Editor);
}
switch (item.Text) {

Loading…
Cancel
Save