如何覆盖大括号完成视觉工作室?

时间:2016-01-09 00:16:26

标签: c# visual-studio-extensions vsix

我正在尝试在visual studio扩展中实现我自己的大括号完成版本,因为我需要能够在它发生时进行过滤。

[Export(typeof(IBraceCompletionContextProvider))]
public class CollabBrace : IBraceCompletionContextProvider {
    public bool TryCreateContext(ITextView textView, SnapshotPoint openingPoint, char openingBrace, char closingBrace, out IBraceCompletionContext context) {
        throw new NotImplementedException();
    }
}

[Export(typeof(IBraceCompletionSessionProvider))]
[ContentType("text")]
[BracePair('{', '}')]
[BracePair('[', ']')]
public class CollabBrace2 : IBraceCompletionSessionProvider {
    public bool TryCreateSession(ITextView textView, SnapshotPoint openingPoint, char openingBrace, char closingBrace, out IBraceCompletionSession session) {
        throw new NotImplementedException();
    }
}

以下是我试图获得大括号完成的上下文和会话的两种方式,但它们从未触发过。

非常感谢任何示例或帮助。

0 个答案:

没有答案