Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
1097a1bc
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,发现更多精彩内容 >>
提交
1097a1bc
编写于
7月 27, 2015
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename method.
Make it clearer that a method is for testing only.
上级
31db7a25
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
16 addition
and
12 deletion
+16
-12
src/EditorFeatures/CSharpTest/Interactive/BraceMatching/InteractiveBraceHighlightingTests.cs
...active/BraceMatching/InteractiveBraceHighlightingTests.cs
+1
-1
src/EditorFeatures/Core/Implementation/Classification/SemanticClassificationTaggerProvider.cs
...on/Classification/SemanticClassificationTaggerProvider.cs
+1
-1
src/EditorFeatures/Core/Implementation/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs
...ceHighlighting/ReferenceHighlightingViewTaggerProvider.cs
+1
-1
src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.Tagger.cs
...Core/Tagging/AbstractAsynchronousTaggerProvider.Tagger.cs
+2
-2
src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.cs
...atures/Core/Tagging/AbstractAsynchronousTaggerProvider.cs
+6
-2
src/EditorFeatures/Test/BraceHighlighting/AbstractBraceHighlightingTests.cs
.../Test/BraceHighlighting/AbstractBraceHighlightingTests.cs
+1
-1
src/EditorFeatures/Test/Outlining/OutliningTaggerTests.cs
src/EditorFeatures/Test/Outlining/OutliningTaggerTests.cs
+1
-1
src/EditorFeatures/Test2/KeywordHighlighting/AbstractKeywordHighlightingTests.vb
...2/KeywordHighlighting/AbstractKeywordHighlightingTests.vb
+1
-1
src/EditorFeatures/Test2/ReferenceHighlighting/AbstractReferenceHighlightingTests.vb
...ferenceHighlighting/AbstractReferenceHighlightingTests.vb
+1
-1
src/EditorFeatures/VisualBasicTest/BraceMatching/BraceHighlightingTests.vb
...s/VisualBasicTest/BraceMatching/BraceHighlightingTests.vb
+1
-1
未找到文件。
src/EditorFeatures/CSharpTest/Interactive/BraceMatching/InteractiveBraceHighlightingTests.cs
浏览文件 @
1097a1bc
...
...
@@ -42,7 +42,7 @@ private IEnumerable<T> Enumerable<T>(params T[] array)
var
context
=
new
TaggerContext
<
BraceHighlightTag
>(
buffer
.
CurrentSnapshot
.
GetRelatedDocumentsWithChanges
().
FirstOrDefault
(),
buffer
.
CurrentSnapshot
,
new
SnapshotPoint
(
buffer
.
CurrentSnapshot
,
position
));
producer
.
ProduceTagsAsync
(
context
).
Wait
();
producer
.
ProduceTagsAsync
_ForTestingPurposesOnly
(
context
).
Wait
();
return
context
.
tagSpans
;
}
...
...
src/EditorFeatures/Core/Implementation/Classification/SemanticClassificationTaggerProvider.cs
浏览文件 @
1097a1bc
...
...
@@ -65,7 +65,7 @@ protected override ITaggerEventSource CreateEventSource(ITextView textViewOpt, I
TaggerEventSources
.
OnDocumentActiveContextChanged
(
subjectBuffer
,
TaggerDelay
.
Short
));
}
protected
internal
override
async
Task
ProduceTagsAsync
(
TaggerContext
<
IClassificationTag
>
context
)
protected
override
async
Task
ProduceTagsAsync
(
TaggerContext
<
IClassificationTag
>
context
)
{
Debug
.
Assert
(
context
.
SpansToTag
.
IsSingle
());
Debug
.
Assert
(
context
.
CaretPosition
==
null
);
...
...
src/EditorFeatures/Core/Implementation/ReferenceHighlighting/ReferenceHighlightingViewTaggerProvider.cs
浏览文件 @
1097a1bc
...
...
@@ -69,7 +69,7 @@ protected override IEnumerable<SnapshotSpan> GetSpansToTag(ITextView textViewOpt
.
ToList
();
}
protected
internal
override
Task
ProduceTagsAsync
(
TaggerContext
<
NavigableHighlightTag
>
context
)
protected
override
Task
ProduceTagsAsync
(
TaggerContext
<
NavigableHighlightTag
>
context
)
{
// NOTE(cyrusn): Normally we'd limit ourselves to producing tags in the span we were
// asked about. However, we want to produce all tags here so that the user can actually
...
...
src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.Tagger.cs
浏览文件 @
1097a1bc
...
...
@@ -133,14 +133,14 @@ public IEnumerable<ITagSpan<TTag>> GetAllTags(NormalizedSnapshotSpanCollection r
return
SpecializedCollections
.
EmptyEnumerable
<
ITagSpan
<
TTag
>>();
}
var
result
=
Get
Tag
s
(
requestedSpans
,
tags
);
var
result
=
Get
IntersectingTagSpan
s
(
requestedSpans
,
tags
);
DebugVerifyTags
(
requestedSpans
,
result
);
return
result
;
}
private
static
IEnumerable
<
ITagSpan
<
TTag
>>
Get
Tag
s
(
NormalizedSnapshotSpanCollection
requestedSpans
,
TagSpanIntervalTree
<
TTag
>
tags
)
private
static
IEnumerable
<
ITagSpan
<
TTag
>>
Get
IntersectingTagSpan
s
(
NormalizedSnapshotSpanCollection
requestedSpans
,
TagSpanIntervalTree
<
TTag
>
tags
)
{
// Special case the case where there is only one requested span. In that case, we don't
// need to allocate any intermediate collections
...
...
src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.cs
浏览文件 @
1097a1bc
...
...
@@ -174,11 +174,15 @@ protected virtual IEnumerable<SnapshotSpan> GetSpansToTag(ITextView textViewOpt,
/// </summary>
protected
abstract
ITaggerEventSource
CreateEventSource
(
ITextView
textViewOpt
,
ITextBuffer
subjectBuffer
);
internal
Task
ProduceTagsAsync_ForTestingPurposesOnly
(
TaggerContext
<
TTag
>
context
)
{
return
ProduceTagsAsync
(
context
);
}
/// <summary>
/// Produce tags for the given context.
/// </summary>
// internal for testing purposes only.
protected
internal
virtual
async
Task
ProduceTagsAsync
(
TaggerContext
<
TTag
>
context
)
protected
virtual
async
Task
ProduceTagsAsync
(
TaggerContext
<
TTag
>
context
)
{
foreach
(
var
spanToTag
in
context
.
SpansToTag
)
{
...
...
src/EditorFeatures/Test/BraceHighlighting/AbstractBraceHighlightingTests.cs
浏览文件 @
1097a1bc
...
...
@@ -27,7 +27,7 @@ protected void TestBraceHighlighting(string markup)
var
context
=
new
TaggerContext
<
BraceHighlightTag
>(
document
,
buffer
.
CurrentSnapshot
,
new
SnapshotPoint
(
buffer
.
CurrentSnapshot
,
testDocument
.
CursorPosition
.
Value
));
provider
.
ProduceTagsAsync
(
context
).
Wait
();
provider
.
ProduceTagsAsync
_ForTestingPurposesOnly
(
context
).
Wait
();
var
expectedHighlights
=
testDocument
.
SelectedSpans
.
Select
(
ts
=>
ts
.
ToSpan
()).
OrderBy
(
s
=>
s
.
Start
).
ToList
();
var
actualHighlights
=
context
.
tagSpans
.
Select
(
ts
=>
ts
.
Span
.
Span
).
OrderBy
(
s
=>
s
.
Start
).
ToList
();
...
...
src/EditorFeatures/Test/Outlining/OutliningTaggerTests.cs
浏览文件 @
1097a1bc
...
...
@@ -142,7 +142,7 @@ private static List<IOutliningRegionTag> GetTagsFromWorkspace(TestWorkspace work
var
document
=
workspace
.
CurrentSolution
.
GetDocument
(
hostdoc
.
Id
);
var
context
=
new
TaggerContext
<
IOutliningRegionTag
>(
document
,
view
.
TextSnapshot
);
provider
.
ProduceTagsAsync
(
context
).
Wait
();
provider
.
ProduceTagsAsync
_ForTestingPurposesOnly
(
context
).
Wait
();
return
context
.
tagSpans
.
Select
(
x
=>
x
.
Tag
).
ToList
();
}
...
...
src/EditorFeatures/Test2/KeywordHighlighting/AbstractKeywordHighlightingTests.vb
浏览文件 @
1097a1bc
...
...
@@ -35,7 +35,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.KeywordHighlighting
AggregateAsynchronousOperationListener
.
EmptyListeners
)
Dim
context
=
New
TaggerContext
(
Of
KeywordHighlightTag
)(
document
,
snapshot
,
New
SnapshotPoint
(
snapshot
,
caretPosition
))
tagProducer
.
ProduceTagsAsync
(
context
).
Wait
()
tagProducer
.
ProduceTagsAsync
_ForTestingPurposesOnly
(
context
).
Wait
()
Dim
producedTags
=
From
tag
In
context
.
tagSpans
Order
By
tag
.
Span
.
Start
...
...
src/EditorFeatures/Test2/ReferenceHighlighting/AbstractReferenceHighlightingTests.vb
浏览文件 @
1097a1bc
...
...
@@ -37,7 +37,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.ReferenceHighlighting
Dim
document
=
workspace
.
CurrentSolution
.
GetDocument
(
hostDocument
.
Id
)
Dim
context
=
New
TaggerContext
(
Of
NavigableHighlightTag
)(
document
,
snapshot
,
New
SnapshotPoint
(
snapshot
,
caretPosition
))
tagProducer
.
ProduceTagsAsync
(
context
).
Wait
()
tagProducer
.
ProduceTagsAsync
_ForTestingPurposesOnly
(
context
).
Wait
()
Dim
producedTags
=
From
tag
In
context
.
tagSpans
Order
By
tag
.
Span
.
Start
...
...
src/EditorFeatures/VisualBasicTest/BraceMatching/BraceHighlightingTests.vb
浏览文件 @
1097a1bc
...
...
@@ -34,7 +34,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.BraceMatching
Dim
doc
=
buffer
.
CurrentSnapshot
.
GetRelatedDocumentsWithChanges
().
FirstOrDefault
()
Dim
context
=
New
TaggerContext
(
Of
BraceHighlightTag
)(
doc
,
buffer
.
CurrentSnapshot
,
New
SnapshotPoint
(
buffer
.
CurrentSnapshot
,
position
))
producer
.
ProduceTagsAsync
(
context
).
Wait
()
producer
.
ProduceTagsAsync
_ForTestingPurposesOnly
(
context
).
Wait
()
Return
context
.
tagSpans
End
Function
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录