Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
170d0a68
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
170d0a68
编写于
1月 11, 2018
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cleanup.
上级
c6b74a29
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
11 deletion
+13
-11
src/EditorFeatures/Core/Implementation/Diagnostics/AbstractDiagnosticsTaggerProvider.cs
...entation/Diagnostics/AbstractDiagnosticsTaggerProvider.cs
+13
-11
未找到文件。
src/EditorFeatures/Core/Implementation/Diagnostics/AbstractDiagnosticsTaggerProvider.cs
浏览文件 @
170d0a68
...
...
@@ -97,15 +97,16 @@ private void ProduceTags(TaggerContext<TTag> context, DocumentSnapshotSpan spanT
foreach
(
var
updateArg
in
eventArgs
)
{
ProduceTags
(
context
,
spanToTag
,
workspace
,
document
,
sourceText
,
editorSnapshot
,
context
,
spanToTag
,
workspace
,
document
,
sourceText
,
suppressedDiagnosticsSpans
,
updateArg
,
cancellationToken
);
}
}
private
void
ProduceTags
(
TaggerContext
<
TTag
>
context
,
DocumentSnapshotSpan
spanToTag
,
Workspace
workspace
,
Document
document
,
SourceText
sourceText
,
ITextSnapshot
editorSnapshot
,
NormalizedSnapshotSpanCollection
suppressedDiagnosticsSpans
,
UpdatedEventArgs
updateArgs
,
CancellationToken
cancellationToken
)
Workspace
workspace
,
Document
document
,
SourceText
sourceText
,
NormalizedSnapshotSpanCollection
suppressedDiagnosticsSpans
,
UpdatedEventArgs
updateArgs
,
CancellationToken
cancellationToken
)
{
try
{
...
...
@@ -116,7 +117,7 @@ private void ProduceTags(TaggerContext<TTag> context, DocumentSnapshotSpan spanT
var
isLiveUpdate
=
id
is
ISupportLiveUpdate
;
var
requestedSpan
=
spanToTag
.
SnapshotSpan
;
var
requested
Snapshot
=
requestedSpan
.
Snapshot
;
var
editor
Snapshot
=
requestedSpan
.
Snapshot
;
foreach
(
var
diagnosticData
in
diagnostics
)
{
...
...
@@ -124,13 +125,14 @@ private void ProduceTags(TaggerContext<TTag> context, DocumentSnapshotSpan spanT
{
// We're going to be retrieving the diagnostics against the last time the engine
// computed them against this document *id*. That might have been a different
// version of the document vs what we're looking at now. As such, we have to
// ensure that the information we get back is not outside the bounds of the editor
// snapshot we're currently looking at.
// Note: GetExistingOrCalculatedTextSpan always succeeds. But it does not ensure
// that the span it returns is within the span of sourceText. So we make sure that
// the start/end of it fits in our snapshot.
// version of the document vs what we're looking at now. But that's ok:
//
// 1) GetExistingOrCalculatedTextSpan will ensure that the diagnostics spans are
// contained within 'editorSnapshot'.
// 2) We'll eventually hear about an update to the diagnostics for this document
// for whatever edits happened between the last time and this current snapshot.
// So we'll eventually reach a point where the diagnostics exactly match the
// editorSnapshot.
var
diagnosticSpan
=
diagnosticData
.
GetExistingOrCalculatedTextSpan
(
sourceText
)
.
ToSnapshotSpan
(
editorSnapshot
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录