提交 7d78797e 编写于 作者: C Cyrus Najmabadi

Make more of generate type async.

上级 43f6c5d1
......@@ -852,7 +852,7 @@ internal override async Task<Solution> TryAddUsingsOrImportToDocumentAsync(Solut
}
// Check if the GFU is triggered from the namespace same as the usings namespace
if (IsWithinTheImportingNamespace(document, simpleName.SpanStart, includeUsingsOrImports, cancellationToken))
if (await IsWithinTheImportingNamespaceAsync(document, simpleName.SpanStart, includeUsingsOrImports, cancellationToken).ConfigureAwait(false))
{
return updatedSolution;
}
......
......@@ -267,9 +267,9 @@ protected static string GetTypeName(State state)
return availableOuterTypeParameters.Concat(availableInnerTypeParameters).ToList();
}
protected bool IsWithinTheImportingNamespace(Document document, int triggeringPosition, string includeUsingsOrImports, CancellationToken cancellationToken)
protected async Task<bool> IsWithinTheImportingNamespaceAsync(Document document, int triggeringPosition, string includeUsingsOrImports, CancellationToken cancellationToken)
{
var semanticModel = document.GetSemanticModelAsync(cancellationToken).WaitAndGetResult(cancellationToken);
var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
if (semanticModel != null)
{
var namespaceSymbol = semanticModel.GetEnclosingNamespace(triggeringPosition, cancellationToken);
......
......@@ -663,7 +663,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.GenerateType
Next
' Check if the GFU is triggered from the namespace same as the imports namespace
If IsWithinTheImportingNamespace(document, simpleName.SpanStart, includeUsingsOrImports, cancellationToken) Then
If Await IsWithinTheImportingNamespaceAsync(document, simpleName.SpanStart, includeUsingsOrImports, cancellationToken).ConfigureAwait(False) Then
Return updatedSolution
End If
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册