Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the spell checker support by:
1. Including the spell checker definition assembly in the vsix 1. Creating a custom natural text tag for markdown files 1. No longer having the "markdown" content type inherit from "plaintext"
- Loading branch information
Noah Richards
committed
Mar 12, 2010
1 parent
e7de8cc
commit 9a8449c
Showing
5 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using SpellChecker.Definitions; | ||
using Microsoft.VisualStudio.Text; | ||
using Microsoft.VisualStudio.Text.Tagging; | ||
using System.ComponentModel.Composition; | ||
using Microsoft.VisualStudio.Utilities; | ||
|
||
namespace MarkdownMode.SpellcheckSupport | ||
{ | ||
[Export(typeof(ITaggerProvider))] | ||
[ContentType(ContentType.Name)] | ||
[TagType(typeof(NaturalTextTag))] | ||
class MarkdownNaturalTextTaggerProvider : ITaggerProvider | ||
{ | ||
public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag | ||
{ | ||
return new MarkdownNaturalTextTagger() as ITagger<T>; | ||
} | ||
} | ||
|
||
class MarkdownNaturalTextTagger : ITagger<NaturalTextTag> | ||
{ | ||
public IEnumerable<ITagSpan<NaturalTextTag>> GetTags(NormalizedSnapshotSpanCollection spans) | ||
{ | ||
foreach (var snapshotSpan in spans) | ||
{ | ||
yield return new TagSpan<NaturalTextTag>(snapshotSpan, new NaturalTextTag()); | ||
} | ||
} | ||
|
||
#pragma warning disable 67 | ||
public event EventHandler<SnapshotSpanEventArgs> TagsChanged; | ||
#pragma warning restore 67 | ||
} | ||
|
||
class NaturalTextTag : INaturalTextTag { } | ||
} |