提交 6f255c74 编写于 作者: J Jason Malinowski

Fix calls to WaitAndGetResult in Peek

This is allowed to be called on the background thread (since that's how
the editor API works), so let's mark it as such.
上级 1cc7305d
......@@ -58,7 +58,7 @@ public void FindResults(string relationshipName, IPeekResultCollection resultCol
var workspace = _peekableItem._workspace;
var solution = workspace.CurrentSolution;
var project = solution.GetProject(_peekableItem._projectId);
var compilation = project.GetCompilationAsync(cancellationToken).WaitAndGetResult(cancellationToken);
var compilation = project.GetCompilationAsync(cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken);
var symbol = _peekableItem._symbolKey.Resolve(compilation, ignoreAssemblyKey: true, cancellationToken: cancellationToken).Symbol;
if (symbol == null)
......@@ -72,7 +72,7 @@ public void FindResults(string relationshipName, IPeekResultCollection resultCol
if (!sourceLocations.Any())
{
// It's a symbol from metadata, so we want to go produce it from metadata
var declarationFile = _peekableItem._metadataAsSourceFileService.GetGeneratedFileAsync(project, symbol, allowDecompilation: false, cancellationToken).WaitAndGetResult(cancellationToken);
var declarationFile = _peekableItem._metadataAsSourceFileService.GetGeneratedFileAsync(project, symbol, allowDecompilation: false, cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken);
var peekDisplayInfo = new PeekResultDisplayInfo(declarationFile.DocumentTitle, declarationFile.DocumentTitle, declarationFile.DocumentTitle, declarationFile.DocumentTitle);
var identifierSpan = declarationFile.IdentifierLocation.GetLineSpan().Span;
var entityOfInterestSpan = PeekHelpers.GetEntityOfInterestSpan(symbol, workspace, declarationFile.IdentifierLocation, cancellationToken);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册