-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrayLogTaggerProvider.cs
More file actions
33 lines (31 loc) · 1.03 KB
/
GrayLogTaggerProvider.cs
File metadata and controls
33 lines (31 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Tagging;
using Microsoft.VisualStudio.Utilities;
namespace GrayLog
{
/// <summary>
/// Export a <see cref="ITaggerProvider"/>
/// </summary>
[Export(typeof(ITaggerProvider))]
[ContentType("code")]
[TagType(typeof(GrayLogTag))]
internal class GrayLogTaggerProvider : ITaggerProvider
{
/// <summary>
/// Creates an instance of our custom GrayLogTagger for a given buffer.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="buffer">The buffer we are creating the tagger for.</param>
/// <returns>An instance of our custom GrayLogTagger.</returns>
public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag
{
if (buffer == null)
{
throw new ArgumentNullException(nameof(buffer));
}
return new GrayLogTagger() as ITagger<T>;
}
}
}