Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
1f95a043
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,发现更多精彩内容 >>
提交
1f95a043
编写于
9月 01, 2015
作者:
B
Brett V. Forsgren
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
don't sort exception types before display
上级
0b9617f0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
17 deletion
+27
-17
src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
...ures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
+3
-2
src/EditorFeatures/VisualBasicTest/QuickInfo/SemanticQuickInfoSourceTests.vb
...VisualBasicTest/QuickInfo/SemanticQuickInfoSourceTests.vb
+3
-2
src/Features/Core/Portable/LanguageServices/SymbolDisplayService/AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs
...tSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs
+21
-13
未找到文件。
src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
浏览文件 @
1f95a043
...
...
@@ -4152,7 +4152,8 @@ class TestClass
/// <exception cref=""T:MyNs.MyException2""></exception>
/// <exception cref=""System.Int32""></exception>
/// <exception cref=""double""></exception>
/// <exception cref=""Not_A_Class_And_Therefore_Not_Listed""></exception>
/// <exception cref=""Not_A_Class_But_Still_Displayed""></exception>
/// <exception cref=""T:"">looks like a proper prefix but isn't</exception>
void M()
{
M$$();
...
...
@@ -4160,7 +4161,7 @@ void M()
}
}
"
,
Exceptions
(
$"\r\n
{
WorkspacesResources
.
Exceptions
}
\r\n MyException1\r\n MyException2\r\n
double\r\n int
"
));
Exceptions
(
$"\r\n
{
WorkspacesResources
.
Exceptions
}
\r\n MyException1\r\n MyException2\r\n
int\r\n double\r\n Not_A_Class_But_Still_Displayed\r\n T:
"
));
}
}
}
src/EditorFeatures/VisualBasicTest/QuickInfo/SemanticQuickInfoSourceTests.vb
浏览文件 @
1f95a043
...
...
@@ -2049,14 +2049,15 @@ Namespace MyNs
''' <exception cref=
""
T:MyNs.MyException2
""
></exception>
''' <exception cref=
""
System.Int32
""
></exception>
''' <exception cref=
""
Double
""
></exception>
''' <exception cref=
""
Not_A_Class_And_Therefore_Not_Listed
""
></exception>
''' <exception cref=
""
Not_A_Class_But_Still_Displayed
""
></exception>
''' <exception cref=
""
T:
""
>looks like a proper prefix but isn't</exception>
Sub M()
M$$()
End Sub
End Class
End Namespace
"
,
Exceptions
(
$
"{vbCrLf}{WorkspacesResources.Exceptions}{vbCrLf} MyException1{vbCrLf} MyException2{vbCrLf}
Double{vbCrLf} Integer
"
))
Exceptions
(
$
"{vbCrLf}{WorkspacesResources.Exceptions}{vbCrLf} MyException1{vbCrLf} MyException2{vbCrLf}
Integer{vbCrLf} Double{vbCrLf} Not_A_Class_But_Still_Displayed{vbCrLf} T:
"
))
End
Sub
End
Class
...
...
src/Features/Core/Portable/LanguageServices/SymbolDisplayService/AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs
浏览文件 @
1f95a043
...
...
@@ -156,24 +156,32 @@ private async Task AddPartsAsync(ImmutableArray<ISymbol> symbols)
private
void
AddExceptions
(
ISymbol
symbol
)
{
// clean up the list of possible exceptions by de-duplicating and ordering them
var
exceptions
=
symbol
.
GetDocumentationComment
().
ExceptionTypes
.
Distinct
()
.
OrderBy
(
e
=>
e
)
.
Select
(
e
=>
DocumentationCommentId
.
GetFirstSymbolForDeclarationId
(
e
,
_semanticModel
.
Compilation
))
.
WhereNotNull
()
.
ToList
();
if
(
exceptions
.
Any
())
var
exceptionTypes
=
symbol
.
GetDocumentationComment
().
ExceptionTypes
;
if
(
exceptionTypes
.
Any
())
{
var
parts
=
new
List
<
SymbolDisplayPart
>();
parts
.
Add
(
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
Text
,
null
,
$"\r\n
{
WorkspacesResources
.
Exceptions
}
"
));
foreach
(
var
exception
in
exceptions
)
parts
.
Add
(
new
SymbolDisplayPart
(
kind
:
SymbolDisplayPartKind
.
Text
,
symbol
:
null
,
text
:
$"\r\n
{
WorkspacesResources
.
Exceptions
}
"
));
foreach
(
var
exceptionString
in
exceptionTypes
)
{
parts
.
AddRange
(
LineBreak
());
parts
.
AddRange
(
Space
(
count
:
2
));
parts
.
AddRange
(
_displayService
.
ToMinimalDisplayParts
(
_semanticModel
,
_position
,
exception
));
// try to get the actual exception symbol
var
exceptionSymbol
=
DocumentationCommentId
.
GetFirstSymbolForDeclarationId
(
exceptionString
,
_semanticModel
.
Compilation
);
if
(
exceptionSymbol
!=
null
)
{
parts
.
AddRange
(
_displayService
.
ToMinimalDisplayParts
(
_semanticModel
,
_position
,
exceptionSymbol
));
}
else
{
// unable to parse exception symbol, fall back to displaying the raw text after trying to
// strip off the leading prefix of "[E|F|M|N|P|T|!]:"
var
colonIndex
=
exceptionString
.
IndexOf
(
':'
);
var
displayText
=
colonIndex
>=
0
&&
exceptionString
.
Length
>
colonIndex
+
1
?
exceptionString
.
Substring
(
colonIndex
+
1
)
:
exceptionString
;
parts
.
Add
(
new
SymbolDisplayPart
(
kind
:
SymbolDisplayPartKind
.
Text
,
symbol
:
null
,
text
:
displayText
));
}
}
AddToGroup
(
SymbolDescriptionGroups
.
Exceptions
,
parts
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录