提交 998cb5ba 编写于 作者: C CyrusNajmabadi

Expose the SemanticClassificationViewTagger for all Roslyn languages.

上级 b7bddced
......@@ -29,8 +29,7 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.Classification
/// </summary>
[Export(typeof(IViewTaggerProvider))]
[TagType(typeof(IClassificationTag))]
[ContentType(ContentTypeNames.CSharpContentType)]
[ContentType(ContentTypeNames.VisualBasicContentType)]
[ContentType(ContentTypeNames.RoslynContentType)]
internal partial class SemanticClassificationViewTaggerProvider : AsynchronousViewTaggerProvider<IClassificationTag>
{
private readonly ISemanticChangeNotificationService _semanticChangeNotificationService;
......@@ -92,15 +91,14 @@ protected override Task ProduceTagsAsync(TaggerContext<IClassificationTag> conte
Debug.Assert(context.SpansToTag.IsSingle());
var spanToTag = context.SpansToTag.Single();
var document = spanToTag.Document;
if (document == null)
_classificationService = _classificationService ??
spanToTag.Document?.Project.LanguageServices.GetService<IEditorClassificationService>();
if (_classificationService == null)
{
return SpecializedTasks.EmptyTask;
}
_classificationService = _classificationService ?? document.Project.LanguageServices.GetService<IEditorClassificationService>();
return SemanticClassificationUtilities.ProduceTagsAsync(context, spanToTag, _classificationService, _typeMap);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册