Avalon编辑中的代码段

问题描述 投票:0回答:1

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

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

插入本身发生,但是选择不起作用。如何使代码段像在Visual Studio中一样工作?类别来源:https://github.com/icsharpcode/AvalonEdit/blob/28b887f78c821c7fede1d4fc461bde64f5f21bd1/ICSharpCode.AvalonEdit/Snippets/SnippetReplaceableTextElement.cs

c# wpf avalonedit
1个回答
0
投票

我做了这样的事情:https://github.com/typicalHuman/typicalIDE/tree/master/CodeBox/Completions/CSCompletion/Snippets它不是理想的,但适合基础。

© www.soinside.com 2019 - 2024. All rights reserved.