Visual Studio MEF Extension - Force Margin Glyphs To Be Updated or Redraw

后端 未结 1 1704
夕颜
夕颜 2021-01-12 02:13

The extension I am writing started life from the Walkthrough: Creating a Margin Glyph example provided by Microsoft: https://msdn.microsoft.com/en-us/library/ee361745.aspx

相关标签:
1条回答
  • 2021-01-12 02:53

    You were on the right path, changing from ITaggerProvider to IViewTaggerProvider allowed me to redraw the glyphs. I used the Implementing a Brace Matching Tagger Provider section in Walkthrough: Displaying Matching Braces example to make these changes.

    Using the IViewTaggerProvider, you can then call

    TagsChanged?.Invoke(this, new SnapshotSpanEventArgs(
                                  new SnapshotSpan(
                                          SourceBuffer.CurrentSnapshot,
                                          0, 
                                          SourceBuffer.CurrentSnapshot.Length)));
    

    in your functions to explicitly call GetTags and go over the spans in the current snapshot.

    0 讨论(0)
提交回复
热议问题