提交 9b4119af 编写于 作者: J Jason Malinowski

Ensure to call the coding conventions API off the UI thread

上级 0175c60f
......@@ -102,8 +102,11 @@ public async Task<IDocumentOptions> GetOptionsForDocumentAsync(Document document
}
// We don't have anything cached, so we'll just get it now lazily and not hold onto it. The workspace layer will ensure
// that we maintain snapshot rules for the document options.
using (var context = await _codingConventionsManager.GetConventionContextAsync(path, cancellationToken).ConfigureAwait(false))
// that we maintain snapshot rules for the document options. We'll also run it on the thread pool
// as in some builds the ICodingConventionsManager captures the thread pool.
var conventionsAsync = Task.Run(() => _codingConventionsManager.GetConventionContextAsync(path, cancellationToken));
using (var context = await conventionsAsync.ConfigureAwait(false))
{
return new DocumentOptions(context.CurrentConventions);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册