forked from yysun/Git-Source-Control-Provider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDiffClassifierProvider.cs
39 lines (33 loc) · 1.33 KB
/
DiffClassifierProvider.cs
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
34
35
36
37
38
39
//***************************************************************************
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// This code is licensed under the Visual Studio SDK license terms.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//***************************************************************************
// Copyright (c) Microsoft Corporation
// All rights reserved
namespace DiffClassifier
{
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Utilities;
[Export(typeof(IClassifierProvider))]
[ContentType("diff")]
internal class DiffClassifierProvider : IClassifierProvider
{
[Import]
internal IClassificationTypeRegistryService ClassificationRegistry = null;
static DiffClassifier diffClassifier;
public IClassifier GetClassifier(ITextBuffer buffer)
{
if (diffClassifier == null)
diffClassifier = new DiffClassifier(ClassificationRegistry);
return diffClassifier;
}
}
}