|
|
|
@ -46,6 +46,7 @@ namespace SharpRefactoring
@@ -46,6 +46,7 @@ namespace SharpRefactoring
|
|
|
|
|
if (current == null) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
using (textEditor.Document.OpenUndoGroup()) { |
|
|
|
|
ITextAnchor endAnchor = textEditor.Document.CreateAnchor(textEditor.Caret.Offset); |
|
|
|
|
endAnchor.MovementType = AnchorMovementType.AfterInsertion; |
|
|
|
|
|
|
|
|
@ -66,7 +67,7 @@ namespace SharpRefactoring
@@ -66,7 +67,7 @@ namespace SharpRefactoring
|
|
|
|
|
|
|
|
|
|
InsertionContext insertionContext = new InsertionContext(textEditor.GetService(typeof(TextArea)) as TextArea, startAnchor.Offset); |
|
|
|
|
|
|
|
|
|
AbstractInlineRefactorDialog dialog = new OverrideToStringMethodDialog(insertionContext, textEditor, startAnchor, insertionPos, current.Fields); |
|
|
|
|
AbstractInlineRefactorDialog dialog = new OverrideToStringMethodDialog(insertionContext, textEditor, startAnchor, insertionPos, current.Fields, codeForBaseCall.Trim()); |
|
|
|
|
dialog.Element = uiService.CreateInlineUIElement(insertionPos, dialog); |
|
|
|
|
|
|
|
|
|
textEditor.Document.InsertNormalized(endAnchor.Offset, Environment.NewLine + code.Substring(marker + codeForBaseCall.Length)); |
|
|
|
@ -74,6 +75,7 @@ namespace SharpRefactoring
@@ -74,6 +75,7 @@ namespace SharpRefactoring
|
|
|
|
|
insertionContext.RegisterActiveElement(new InlineRefactorSnippetElement(cxt => null, ""), dialog); |
|
|
|
|
insertionContext.RaiseInsertionCompleted(EventArgs.Empty); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool Handles(ICompletionItem item) |
|
|
|
|
{ |
|
|
|
|