Avalon 编辑中的片段

Snippets in Avalon Edit

在 avalon edit 中有一个片段 class SnippetReplaceableTextElement 我不明白如何正确使用它,我写了类似的东西但它没有工作:

        SnippetReplaceableTextElement snip = new SnippetReplaceableTextElement();
        snip.Text = "Console.WriteLine();";
        InsertionContext context = new InsertionContext(textEditor.TextArea, 0);
        snip.Insert(context);

插入本身发生,但选择不起作用。如何使代码片段像 visual studio 中那样工作? Class 来源:https://github.com/icsharpcode/AvalonEdit/blob/28b887f78c821c7fede1d4fc461bde64f5f21bd1/ICSharpCode.AvalonEdit/Snippets/SnippetReplaceableTextElement.cs

我做了这样的东西:https://github.com/typicalHuman/typicalIDE/tree/master/CodeBox/Completions/CSCompletion/Snippets 不理想,但适合基地。