提交 5c392b93 编写于 作者: C Cyrus Najmabadi

Merge checks.

上级 3906c94c
......@@ -170,16 +170,15 @@ private void ProduceTags(TaggerContext<TTag> context, DocumentSnapshotSpan spanT
// and apply them directly to the snapshot we have. Either no new changes will
// have happened, and these spans will be accurate, or a change will happen
// and we'll hear about and it update the spans shortly to the right position.
_diagnosticIdToTextSnapshot.TryGetValue(id, out var diagnosticSnapshot);
diagnosticSnapshot = diagnosticSnapshot ?? editorSnapshot;
// This may happen if the file is closed/open. We can't map these spans forward.
//
// Also, only use the diagnoticSnapshot if its text buffer matches our. The text
// buffer might be different if the file was closed/reopened.
// Note: when this happens, the diagnostic service will reanalyze the file. So
// up to date diagnostic spans will appear shortly after this.
if (diagnosticSnapshot.TextBuffer != editorSnapshot.TextBuffer)
{
diagnosticSnapshot = editorSnapshot;
}
_diagnosticIdToTextSnapshot.TryGetValue(id, out var diagnosticSnapshot);
diagnosticSnapshot = diagnosticSnapshot?.TextBuffer == editorSnapshot.TextBuffer
? diagnosticSnapshot
: editorSnapshot;
var sourceText = diagnosticSnapshot.AsText();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册