Skip to content

Commit

Permalink
Fix: Use GetSemanticModelAsync instead of TryGetSemanticModel to make…
Browse files Browse the repository at this point in the history
… available the SemanticModel in Roslyn conventions (#95)
  • Loading branch information
paulegradie authored Apr 17, 2024
1 parent dc51f8a commit f704f87
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public IEnumerable<ConventionResult> IsSatisfiedBy(Solution solution)
private IEnumerable<ConventionResult> IsSatisfiedBy(Document document)
{
var node = document.GetSyntaxRootAsync().Result;
if (document.TryGetSemanticModel(out var semanticModel))
var semanticModel = document.GetSemanticModelAsync().GetAwaiter().GetResult();
if (semanticModel is not null)
{
return IsSatisfiedBy(document, node, semanticModel);
}
Expand Down

0 comments on commit f704f87

Please sign in to comment.