提交 f67c227f 编写于 作者: A Artur Spychaj

Merge pull request #8376 from drognanar/fixencdocumentid

Fix EnC issue with out of sync DocumentId
......@@ -590,10 +590,13 @@ private void AddActiveStatements(Solution solution, ShellInterop.ENC_ACTIVE_STAT
var flags = (ActiveStatementFlags)vsActiveStatement.ASINFO;
IVisualStudioHostDocument vsDocument = _vsProject.GetCurrentDocumentFromPath(vsActiveStatement.filename);
if (vsDocument != null)
// Finds a document id in the solution with the specified file path.
DocumentId documentId = solution.GetDocumentIdsWithFilePath(vsActiveStatement.filename)
.Where(dId => dId.ProjectId == _vsProject.Id).SingleOrDefault();
if (documentId != null)
{
var document = solution.GetDocument(vsDocument.Id);
var document = solution.GetDocument(documentId);
Debug.Assert(document != null);
SourceText source = document.GetTextAsync(default(CancellationToken)).Result;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册