summaryrefslogtreecommitdiff
path: root/Source/DafnyExtension/ContentType.cs
blob: c528f4ed9b12e97d8471ea02dfc8ae2aae37e0ec (plain)
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
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;


namespace DafnyLanguage
{
  class DafnyContentType
  {
    [Export]
    [Name("dafny")]
    [BaseDefinition("code")]
    internal static ContentTypeDefinition ContentType = null;

    [Export(typeof(IWpfTextViewCreationListener))]
    [ContentType("text")]
    [TextViewRole(PredefinedTextViewRoles.Document)]
    internal sealed class DafnyTextViewCreationListener : IWpfTextViewCreationListener
    {
      [Export(typeof(AdornmentLayerDefinition))]
      [Name("ModelAdornment")]
      [Order(After = PredefinedAdornmentLayers.Selection, Before = PredefinedAdornmentLayers.Text)]
      [TextViewRole(PredefinedTextViewRoles.Document)]
      public AdornmentLayerDefinition editorAdornmentLayer = null;
      public void TextViewCreated(IWpfTextView textView)
      {
      }
    }

    [Export]
    [FileExtension(".dfy")]
    [ContentType("dafny")]
    internal static FileExtensionToContentTypeDefinition FileType = null;
  }
}