Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
ff930dec
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,发现更多精彩内容 >>
未验证
提交
ff930dec
编写于
11月 12, 2019
作者:
A
Andy Gocke
提交者:
GitHub
11月 12, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #39772 from dotnet/merges/release/dev16.4-to-release/dev16.4-vs-deps
Merge release/dev16.4 to release/dev16.4-vs-deps
上级
1cb14195
e9a37eb5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
71 addition
and
12 deletion
+71
-12
src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
...ures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
+42
-0
src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs
...aces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs
+25
-9
src/Workspaces/Remote/ServiceHub/Services/SnapshotService.JsonRpcAssetSource.cs
...ServiceHub/Services/SnapshotService.JsonRpcAssetSource.cs
+4
-3
未找到文件。
src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
浏览文件 @
ff930dec
...
...
@@ -6685,6 +6685,48 @@ public async Task TestInheritdocInlineSummary()
Documentation
(
"Summary documentation"
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
QuickInfo
)]
public
async
Task
TestInheritdocCycle1
()
{
var
markup
=
@"
/// <inheritdoc cref=""M(int, int)""/>
void M(int x) { }
/// <inheritdoc cref=""M(int)""/>
void $$M(int x, int y) { }"
;
await
TestInClassAsync
(
markup
,
MainDescription
(
"void C.M(int x, int y)"
),
Documentation
(
""
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
QuickInfo
)]
public
async
Task
TestInheritdocCycle2
()
{
var
markup
=
@"
/// <inheritdoc cref=""M(int)""/>
void $$M(int x) { }"
;
await
TestInClassAsync
(
markup
,
MainDescription
(
"void C.M(int x)"
),
Documentation
(
""
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
QuickInfo
)]
public
async
Task
TestInheritdocCycle3
()
{
var
markup
=
@"
/// <inheritdoc cref=""M""/>
void $$M(int x) { }"
;
await
TestInClassAsync
(
markup
,
MainDescription
(
"void C.M(int x)"
),
Documentation
(
""
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
QuickInfo
)]
[
WorkItem
(
38794
,
"https://github.com/dotnet/roslyn/issues/38794"
)]
public
async
Task
TestLinqGroupVariableDeclaration
()
...
...
src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs
浏览文件 @
ff930dec
...
...
@@ -894,6 +894,11 @@ public static DeclarationModifiers GetSymbolModifiers(this ISymbol symbol)
}
public
static
DocumentationComment
GetDocumentationComment
(
this
ISymbol
symbol
,
Compilation
compilation
,
CultureInfo
?
preferredCulture
=
null
,
bool
expandIncludes
=
false
,
bool
expandInheritdoc
=
false
,
CancellationToken
cancellationToken
=
default
)
{
return
GetDocumentationComment
(
symbol
,
visitedSymbols
:
null
,
compilation
,
preferredCulture
,
expandIncludes
,
expandInheritdoc
,
cancellationToken
);
}
private
static
DocumentationComment
GetDocumentationComment
(
ISymbol
symbol
,
HashSet
<
ISymbol
>?
visitedSymbols
,
Compilation
compilation
,
CultureInfo
?
preferredCulture
,
bool
expandIncludes
,
bool
expandInheritdoc
,
CancellationToken
cancellationToken
)
{
var
xmlText
=
symbol
.
GetDocumentationCommentXml
(
preferredCulture
,
expandIncludes
,
cancellationToken
);
if
(
expandInheritdoc
)
...
...
@@ -906,7 +911,7 @@ public static DocumentationComment GetDocumentationComment(this ISymbol symbol,
try
{
var
element
=
XElement
.
Parse
(
xmlText
,
LoadOptions
.
PreserveWhitespace
);
element
.
ReplaceNodes
(
RewriteMany
(
symbol
,
compilation
,
element
.
Nodes
().
ToArray
(),
cancellationToken
));
element
.
ReplaceNodes
(
RewriteMany
(
symbol
,
visitedSymbols
,
compilation
,
element
.
Nodes
().
ToArray
(),
cancellationToken
));
xmlText
=
element
.
ToString
(
SaveOptions
.
DisableFormatting
);
}
catch
...
...
@@ -953,14 +958,14 @@ static bool IsEligibleForAutomaticInheritdoc(ISymbol symbol)
}
}
private
static
XNode
[]
RewriteInheritdocElements
(
ISymbol
symbol
,
Compilation
compilation
,
XNode
node
,
CancellationToken
cancellationToken
)
private
static
XNode
[]
RewriteInheritdocElements
(
ISymbol
symbol
,
HashSet
<
ISymbol
>?
visitedSymbols
,
Compilation
compilation
,
XNode
node
,
CancellationToken
cancellationToken
)
{
if
(
node
.
NodeType
==
XmlNodeType
.
Element
)
{
var
element
=
(
XElement
)
node
;
if
(
ElementNameIs
(
element
,
DocumentationCommentXmlNames
.
InheritdocElementName
))
{
var
rewritten
=
RewriteInheritdocElement
(
symbol
,
compilation
,
element
,
cancellationToken
);
var
rewritten
=
RewriteInheritdocElement
(
symbol
,
visitedSymbols
,
compilation
,
element
,
cancellationToken
);
if
(
rewritten
is
object
)
{
return
rewritten
;
...
...
@@ -983,25 +988,25 @@ private static XNode[] RewriteInheritdocElements(ISymbol symbol, Compilation com
if
(
oldNodes
!=
null
)
{
XNode
[]
rewritten
=
RewriteMany
(
symbol
,
compilation
,
oldNodes
.
ToArray
(),
cancellationToken
);
XNode
[]
rewritten
=
RewriteMany
(
symbol
,
visitedSymbols
,
compilation
,
oldNodes
.
ToArray
(),
cancellationToken
);
container
.
ReplaceNodes
(
rewritten
);
}
return
new
XNode
[]
{
container
};
}
private
static
XNode
[]
RewriteMany
(
ISymbol
symbol
,
Compilation
compilation
,
XNode
[]
nodes
,
CancellationToken
cancellationToken
)
private
static
XNode
[]
RewriteMany
(
ISymbol
symbol
,
HashSet
<
ISymbol
>?
visitedSymbols
,
Compilation
compilation
,
XNode
[]
nodes
,
CancellationToken
cancellationToken
)
{
var
result
=
new
List
<
XNode
>();
foreach
(
var
child
in
nodes
)
{
result
.
AddRange
(
RewriteInheritdocElements
(
symbol
,
compilation
,
child
,
cancellationToken
));
result
.
AddRange
(
RewriteInheritdocElements
(
symbol
,
visitedSymbols
,
compilation
,
child
,
cancellationToken
));
}
return
result
.
ToArray
();
}
private
static
XNode
[]?
RewriteInheritdocElement
(
ISymbol
memberSymbol
,
Compilation
compilation
,
XElement
element
,
CancellationToken
cancellationToken
)
private
static
XNode
[]?
RewriteInheritdocElement
(
ISymbol
memberSymbol
,
HashSet
<
ISymbol
>?
visitedSymbols
,
Compilation
compilation
,
XElement
element
,
CancellationToken
cancellationToken
)
{
var
crefAttribute
=
element
.
Attribute
(
XName
.
Get
(
DocumentationCommentXmlNames
.
CrefAttributeName
));
var
pathAttribute
=
element
.
Attribute
(
XName
.
Get
(
DocumentationCommentXmlNames
.
PathAttributeName
));
...
...
@@ -1033,9 +1038,16 @@ private static XNode[] RewriteMany(ISymbol symbol, Compilation compilation, XNod
}
}
visitedSymbols
??=
new
HashSet
<
ISymbol
>();
if
(!
visitedSymbols
.
Add
(
symbol
))
{
// Prevent recursion
return
null
;
}
try
{
var
inheritedDocumentation
=
GetDocumentationComment
(
symbol
,
compilation
,
preferredCulture
:
null
,
expandIncludes
:
true
,
expandInheritdoc
:
true
,
cancellationToken
);
var
inheritedDocumentation
=
GetDocumentationComment
(
symbol
,
visitedSymbols
,
compilation
,
preferredCulture
:
null
,
expandIncludes
:
true
,
expandInheritdoc
:
true
,
cancellationToken
);
if
(
inheritedDocumentation
==
DocumentationComment
.
Empty
)
{
return
Array
.
Empty
<
XNode
>();
...
...
@@ -1067,7 +1079,7 @@ private static XNode[] RewriteMany(ISymbol symbol, Compilation compilation, XNod
{
// change the current XML file path for nodes contained in the document:
// prototype(inheritdoc): what should the file path be?
var
result
=
RewriteMany
(
symbol
,
compilation
,
loadedElements
,
cancellationToken
);
var
result
=
RewriteMany
(
symbol
,
visitedSymbols
,
compilation
,
loadedElements
,
cancellationToken
);
// The elements could be rewritten away if they are includes that refer to invalid
// (but existing and accessible) XML files. If this occurs, behave as if we
...
...
@@ -1084,6 +1096,10 @@ private static XNode[] RewriteMany(ISymbol symbol, Compilation compilation, XNod
{
return
Array
.
Empty
<
XNode
>();
}
finally
{
visitedSymbols
.
Remove
(
symbol
);
}
// Local functions
static
ISymbol
?
GetCandidateSymbol
(
ISymbol
memberSymbol
)
...
...
src/Workspaces/Remote/ServiceHub/Services/SnapshotService.JsonRpcAssetSource.cs
浏览文件 @
ff930dec
...
...
@@ -44,7 +44,7 @@ public override async Task<IList<(Checksum, object)>> RequestAssetsAsync(int sco
(
s
,
c
)
=>
ReadAssets
(
s
,
scopeId
,
checksums
,
serializerService
,
c
),
cancellationToken
);
},
cancellationToken
).
ConfigureAwait
(
false
);
}
catch
(
Exception
ex
)
when
(
ReportUnlessCanceled
(
ex
,
cancellationToken
))
catch
(
Exception
ex
)
when
(
ReportUnlessCanceled
(
ex
))
{
throw
ExceptionUtilities
.
Unreachable
;
}
...
...
@@ -63,9 +63,10 @@ public override async Task<bool> IsExperimentEnabledAsync(string experimentName,
}
}
private
bool
ReportUnlessCanceled
(
Exception
ex
,
CancellationToken
cancellationToken
)
private
bool
ReportUnlessCanceled
(
Exception
ex
)
{
if
(!
cancellationToken
.
IsCancellationRequested
&&
_owner
.
IsDisposed
)
// TODO: check !cancellationToken.IsCancellationRequeste instead (https://github.com/dotnet/roslyn/issues/39723)
if
(!(
ex
is
OperationCanceledException
)
&&
!(
ex
is
TaskCanceledException
)
&&
_owner
.
IsDisposed
)
{
// kill OOP if snapshot service got disconnected due to this exception.
FailFast
.
OnFatalException
(
ex
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录