summaryrefslogtreecommitdiff
path: root/Source/DafnyExtension/IdentifierTagger.cs
diff options
context:
space:
mode:
authorGravatar wuestholz <unknown>2013-06-11 10:24:31 -0700
committerGravatar wuestholz <unknown>2013-06-11 10:24:31 -0700
commit4314d2bf8634ddc573c4f0a4266a6771cb5eb696 (patch)
tree56dfaee0e35b989e8b7a600dd5c33119054f3fb5 /Source/DafnyExtension/IdentifierTagger.cs
parente2508e12bf24a84f731884fcbd8f5f128dbf9f9a (diff)
DafnyExtension: Did some refactoring.
Diffstat (limited to 'Source/DafnyExtension/IdentifierTagger.cs')
-rw-r--r--Source/DafnyExtension/IdentifierTagger.cs36
1 files changed, 20 insertions, 16 deletions
diff --git a/Source/DafnyExtension/IdentifierTagger.cs b/Source/DafnyExtension/IdentifierTagger.cs
index a4cd3547..86fb2696 100644
--- a/Source/DafnyExtension/IdentifierTagger.cs
+++ b/Source/DafnyExtension/IdentifierTagger.cs
@@ -1,29 +1,26 @@
//***************************************************************************
// Copyright © 2010 Microsoft Corporation. All Rights Reserved.
-// This code released under the terms of the
+// This code released under the terms of the
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
//***************************************************************************
-using EnvDTE;
+
+
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.ComponentModel.Composition;
-using System.Windows.Threading;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.Shell.Interop;
+using System.Diagnostics.Contracts;
+using Microsoft.Dafny;
using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Classification;
-using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Tagging;
-using Microsoft.VisualStudio.Text.Projection;
using Microsoft.VisualStudio.Utilities;
-using System.Diagnostics.Contracts;
using Bpl = Microsoft.Boogie;
-using Microsoft.Dafny;
+
namespace DafnyLanguage
{
+
+ #region Provider
+
[Export(typeof(ITaggerProvider))]
[ContentType("dafny")]
[TagType(typeof(DafnyTokenTag))]
@@ -40,6 +37,11 @@ namespace DafnyLanguage
}
}
+ #endregion
+
+
+ #region Tagger
+
/// <summary>
/// Translate DafnyResolverTag's into IOutliningRegionTag's
/// </summary>
@@ -77,14 +79,14 @@ namespace DafnyLanguage
int end = entire.End;
foreach (var r in _regions) {
if (0 <= r.Length && r.Start <= end && start <= r.Start + r.Length) {
- DafnyTokenKinds kind;
+ DafnyTokenKind kind;
switch (r.Kind) {
case IdRegion.OccurrenceKind.Use:
- kind = DafnyTokenKinds.VariableIdentifier; break;
+ kind = DafnyTokenKind.VariableIdentifier; break;
case IdRegion.OccurrenceKind.Definition:
- kind = DafnyTokenKinds.VariableIdentifierDefinition; break;
+ kind = DafnyTokenKind.VariableIdentifierDefinition; break;
case IdRegion.OccurrenceKind.WildDefinition:
- kind = DafnyTokenKinds.Keyword; break;
+ kind = DafnyTokenKind.Keyword; break;
default:
Contract.Assert(false); // unexpected OccurrenceKind
goto case IdRegion.OccurrenceKind.Use; // to please compiler
@@ -386,4 +388,6 @@ namespace DafnyLanguage
}
}
+ #endregion
+
}