Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 7c5b1f9

Browse files
XAML CC: do not insert equals sign and quotation marks while trying to type the name of an attached property/event
1 parent 6585614 commit 7c5b1f9

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ public override void Complete(CompletionContext context, ICompletionItem item)
8383
XamlCompletionItem cItem = item as XamlCompletionItem;
8484

8585
if (xamlContext.Description == XamlContextDescription.InTag) {
86-
context.Editor.Document.Insert(context.EndOffset, "=\"\"");
87-
context.CompletionCharHandled = context.CompletionChar == '=';
88-
context.Editor.Caret.Offset--;
89-
new XamlCodeCompletionBinding().CtrlSpace(context.Editor);
86+
if (cItem.Entity.SymbolKind == SymbolKind.Property || cItem.Entity.SymbolKind == SymbolKind.Event) {
87+
context.Editor.Document.Insert(context.EndOffset, "=\"\"");
88+
context.CompletionCharHandled = context.CompletionChar == '=';
89+
context.Editor.Caret.Offset--;
90+
new XamlCodeCompletionBinding().CtrlSpace(context.Editor);
91+
}
9092
} else if (xamlContext.Description == XamlContextDescription.InMarkupExtension && !string.IsNullOrEmpty(xamlContext.RawAttributeValue)) {
9193
string valuePart = xamlContext.RawAttributeValue.Substring(0, xamlContext.ValueStartOffset);
9294
AttributeValue value = MarkupExtensionParser.ParseValue(valuePart);

0 commit comments

Comments
 (0)