public void Complete(ICSharpCode.AvalonEdit.Editing.TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs) { string tokenLeftOfCaret = textArea.Document.GetIdentifierLeftOf(textArea.Caret.Offset); textArea.Document.Replace(textArea.Caret.Offset - tokenLeftOfCaret.Length, tokenLeftOfCaret.Length, ""); TemplateEngine.Expand(textArea, $"{System.IO.Path.GetFileNameWithoutExtension(Text)}\""); }
public void Complete(ICSharpCode.AvalonEdit.Editing.TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs) { string tokenLeftOfCaret = textArea.Document.GetIdentifierLeftOf(textArea.Caret.Offset); textArea.Document.Replace(textArea.Caret.Offset - tokenLeftOfCaret.Length, tokenLeftOfCaret.Length, ""); TemplateEngine.Expand(textArea, $"{Text}/{TemplateEngine.GetCommand("CodeCompletion")}"); }