summaryrefslogtreecommitdiff
path: root/Source/DafnyExtension/BraceMatching.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/BraceMatching.cs
parente2508e12bf24a84f731884fcbd8f5f128dbf9f9a (diff)
DafnyExtension: Did some refactoring.
Diffstat (limited to 'Source/DafnyExtension/BraceMatching.cs')
-rw-r--r--Source/DafnyExtension/BraceMatching.cs18
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/DafnyExtension/BraceMatching.cs b/Source/DafnyExtension/BraceMatching.cs
index 44b1affe..50d264ef 100644
--- a/Source/DafnyExtension/BraceMatching.cs
+++ b/Source/DafnyExtension/BraceMatching.cs
@@ -1,5 +1,4 @@
using System;
-using System.Linq;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text;
@@ -7,8 +6,12 @@ using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Tagging;
using Microsoft.VisualStudio.Utilities;
+
namespace DafnyLanguage
{
+
+ #region Provider
+
[Export(typeof(IViewTaggerProvider))]
[ContentType("dafny")]
[TagType(typeof(TextMarkerTag))]
@@ -30,6 +33,11 @@ namespace DafnyLanguage
}
}
+ #endregion
+
+
+ #region Tagger
+
internal abstract class TokenBasedTagger
{
ITagAggregator<DafnyTokenTag> _aggregator;
@@ -42,8 +50,8 @@ namespace DafnyLanguage
SnapshotSpan span = new SnapshotSpan(pt, 1);
foreach (var tagSpan in this._aggregator.GetTags(span)) {
switch (tagSpan.Tag.Kind) {
- case DafnyTokenKinds.Comment:
- case DafnyTokenKinds.String:
+ case DafnyTokenKind.Comment:
+ case DafnyTokenKind.String:
foreach (var s in tagSpan.Span.GetSpans(pt.Snapshot)) {
if (s.Contains(span))
return true;
@@ -57,6 +65,7 @@ namespace DafnyLanguage
}
}
+
internal class BraceMatchingTagger : TokenBasedTagger, ITagger<TextMarkerTag>
{
ITextView View { get; set; }
@@ -250,4 +259,7 @@ namespace DafnyLanguage
return false;
}
}
+
+ #endregion
+
}