提交 5b0ab5ea 编写于 作者: C CyrusNajmabadi

Make code less subtle.

上级 998cb5ba
......@@ -92,8 +92,15 @@ protected override Task ProduceTagsAsync(TaggerContext<IClassificationTag> conte
var spanToTag = context.SpansToTag.Single();
_classificationService = _classificationService ??
spanToTag.Document?.Project.LanguageServices.GetService<IEditorClassificationService>();
// Attempt to get a classification service which will actually produce the results.
// If we can't (because we have no Document, or because the language doesn't support
// this service), then bail out immediately.
if (_classificationService == null)
{
var document = spanToTag.Document;
_classificationService = document?.Project.LanguageServices.GetService<IEditorClassificationService>();
}
if (_classificationService == null)
{
return SpecializedTasks.EmptyTask;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册