Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
d9be31da
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,发现更多精彩内容 >>
提交
d9be31da
编写于
12月 09, 2019
作者:
D
David Poeschl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove "Usage: await x();" help text in QuickInfo and SigHelp
上级
1f746111
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
16 addition
and
242 deletion
+16
-242
src/EditorFeatures/CSharpTest/Completion/CompletionProviders/SymbolCompletionProviderTests.cs
...tion/CompletionProviders/SymbolCompletionProviderTests.cs
+2
-6
src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
...ures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
+0
-20
src/EditorFeatures/CSharpTest/SignatureHelp/GenericNamePartiallyWrittenSignatureHelpProviderTests.cs
.../GenericNamePartiallyWrittenSignatureHelpProviderTests.cs
+1
-4
src/EditorFeatures/CSharpTest/SignatureHelp/InvocationExpressionSignatureHelpProviderTests.cs
...ureHelp/InvocationExpressionSignatureHelpProviderTests.cs
+2
-10
src/EditorFeatures/VisualBasicTest/Completion/CompletionProviders/SymbolCompletionProviderTests.vb
...tion/CompletionProviders/SymbolCompletionProviderTests.vb
+1
-3
src/EditorFeatures/VisualBasicTest/QuickInfo/SemanticQuickInfoSourceTests.vb
...VisualBasicTest/QuickInfo/SemanticQuickInfoSourceTests.vb
+1
-3
src/EditorFeatures/VisualBasicTest/SignatureHelp/InvocationExpressionSignatureHelpProviderTests.vb
...ureHelp/InvocationExpressionSignatureHelpProviderTests.vb
+2
-6
src/Features/CSharp/Portable/LanguageServices/CSharpSymbolDisplayService.SymbolDescriptionBuilder.cs
...es/CSharpSymbolDisplayService.SymbolDescriptionBuilder.cs
+0
-6
src/Features/CSharp/Portable/SignatureHelp/AbstractCSharpSignatureHelpProvider.cs
...able/SignatureHelp/AbstractCSharpSignatureHelpProvider.cs
+4
-6
src/Features/CSharp/Portable/SignatureHelp/AbstractOrdinaryMethodSignatureHelpProvider.cs
...natureHelp/AbstractOrdinaryMethodSignatureHelpProvider.cs
+1
-1
src/Features/CSharp/Portable/SignatureHelp/GenericNameSignatureHelpProvider.cs
...ortable/SignatureHelp/GenericNameSignatureHelpProvider.cs
+1
-1
src/Features/Core/Portable/LanguageServices/SymbolDisplayService/AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs
...tSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs
+0
-7
src/Features/Core/Portable/Shared/Extensions/ISymbolExtensions_2.cs
...es/Core/Portable/Shared/Extensions/ISymbolExtensions_2.cs
+0
-78
src/Features/VisualBasic/Portable/LanguageServices/VisualBasicSymbolDisplayService.SymbolDescriptionBuilder.vb
...sualBasicSymbolDisplayService.SymbolDescriptionBuilder.vb
+0
-5
src/Features/VisualBasic/Portable/SignatureHelp/AbstractOrdinaryMethodSignatureHelpProvider.vb
...natureHelp/AbstractOrdinaryMethodSignatureHelpProvider.vb
+1
-9
src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs
src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs
+0
-9
src/Workspaces/Core/Portable/WorkspacesResources.resx
src/Workspaces/Core/Portable/WorkspacesResources.resx
+0
-3
src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf
+0
-5
src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf
+0
-5
src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf
+0
-5
src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf
+0
-5
src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf
+0
-5
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf
+0
-5
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf
+0
-5
src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf
+0
-5
src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf
...orkspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf
+0
-5
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf
+0
-5
src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf
src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf
+0
-5
src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf
...kspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf
+0
-5
src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf
...kspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf
+0
-5
未找到文件。
src/EditorFeatures/CSharpTest/Completion/CompletionProviders/SymbolCompletionProviderTests.cs
浏览文件 @
d9be31da
...
...
@@ -7162,9 +7162,7 @@ async Task goo()
}
}"
;
var
description
=
$@"(
{
CSharpFeaturesResources
.
awaitable
}
) Task Program.goo()
{
WorkspacesResources
.
Usage_colon
}
{
SyntaxFacts
.
GetText
(
SyntaxKind
.
AwaitKeyword
)}
goo();"
;
var
description
=
$@"(
{
CSharpFeaturesResources
.
awaitable
}
) Task Program.goo()"
;
await
VerifyItemWithMscorlib45Async
(
markup
,
"goo"
,
description
,
"C#"
);
}
...
...
@@ -7183,9 +7181,7 @@ async Task<int> goo()
}
}"
;
var
description
=
$@"(
{
CSharpFeaturesResources
.
awaitable
}
) Task<int> Program.goo()
{
WorkspacesResources
.
Usage_colon
}
int x =
{
SyntaxFacts
.
GetText
(
SyntaxKind
.
AwaitKeyword
)}
goo();"
;
var
description
=
$@"(
{
CSharpFeaturesResources
.
awaitable
}
) Task<int> Program.goo()"
;
await
VerifyItemWithMscorlib45Async
(
markup
,
"goo"
,
description
,
"C#"
);
}
...
...
src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
浏览文件 @
d9be31da
...
...
@@ -4370,26 +4370,6 @@ class C<T>
MainDescription
(
@"class C<T>"
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
QuickInfo
)]
public
async
Task
TestAwaitableMethod
()
{
var
markup
=
@"using System.Threading.Tasks;
class C
{
async Task Goo()
{
Go$$o();
}
}"
;
var
description
=
$"(
{
CSharpFeaturesResources
.
awaitable
}
) Task C.Goo()"
;
var
documentation
=
$@"
{
WorkspacesResources
.
Usage_colon
}
{
SyntaxFacts
.
GetText
(
SyntaxKind
.
AwaitKeyword
)}
Goo();"
;
await
VerifyWithMscorlib45Async
(
markup
,
new
[]
{
MainDescription
(
description
),
Usage
(
documentation
)
});
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
QuickInfo
)]
public
async
Task
ObsoleteItem
()
{
...
...
src/EditorFeatures/CSharpTest/SignatureHelp/GenericNamePartiallyWrittenSignatureHelpProviderTests.cs
浏览文件 @
d9be31da
...
...
@@ -82,12 +82,9 @@ Task<int> Goo<T>()
}
}
"
;
var
documentation
=
$@"
{
WorkspacesResources
.
Usage_colon
}
int x = await Goo();"
;
var
expectedOrderedItems
=
new
List
<
SignatureHelpTestItem
>();
expectedOrderedItems
.
Add
(
new
SignatureHelpTestItem
(
$"(
{
CSharpFeaturesResources
.
awaitable
}
) Task<int> Program.Goo<T>()"
,
documentation
,
string
.
Empty
,
currentParameterIndex
:
0
));
expectedOrderedItems
.
Add
(
new
SignatureHelpTestItem
(
$"(
{
CSharpFeaturesResources
.
awaitable
}
) Task<int> Program.Goo<T>()"
,
methodDocumentation
:
string
.
Empty
,
string
.
Empty
,
currentParameterIndex
:
0
));
// TODO: Enable the script case when we have support for extension methods in scripts
await
TestAsync
(
markup
,
expectedOrderedItems
,
usePreviousCharAsTrigger
:
false
,
sourceCodeKind
:
Microsoft
.
CodeAnalysis
.
SourceCodeKind
.
Regular
);
...
...
src/EditorFeatures/CSharpTest/SignatureHelp/InvocationExpressionSignatureHelpProviderTests.cs
浏览文件 @
d9be31da
...
...
@@ -1653,12 +1653,8 @@ async Task Goo()
}
}"
;
var
description
=
$@"
{
WorkspacesResources
.
Usage_colon
}
await Goo();"
;
var
expectedOrderedItems
=
new
List
<
SignatureHelpTestItem
>();
expectedOrderedItems
.
Add
(
new
SignatureHelpTestItem
(
$"(
{
CSharpFeaturesResources
.
awaitable
}
) Task C.Goo()"
,
methodDocumentation
:
description
,
currentParameterIndex
:
0
));
expectedOrderedItems
.
Add
(
new
SignatureHelpTestItem
(
$"(
{
CSharpFeaturesResources
.
awaitable
}
) Task C.Goo()"
,
methodDocumentation
:
string
.
Empty
,
currentParameterIndex
:
0
));
await
TestSignatureHelpWithMscorlib45Async
(
markup
,
expectedOrderedItems
,
"C#"
);
}
...
...
@@ -1676,12 +1672,8 @@ async Task<Task<int>> Goo()
}
}"
;
var
description
=
$@"
{
WorkspacesResources
.
Usage_colon
}
Task<int> x = await Goo();"
;
var
expectedOrderedItems
=
new
List
<
SignatureHelpTestItem
>();
expectedOrderedItems
.
Add
(
new
SignatureHelpTestItem
(
$"(
{
CSharpFeaturesResources
.
awaitable
}
) Task<Task<int>> C.Goo()"
,
methodDocumentation
:
description
,
currentParameterIndex
:
0
));
expectedOrderedItems
.
Add
(
new
SignatureHelpTestItem
(
$"(
{
CSharpFeaturesResources
.
awaitable
}
) Task<Task<int>> C.Goo()"
,
methodDocumentation
:
string
.
Empty
,
currentParameterIndex
:
0
));
await
TestSignatureHelpWithMscorlib45Async
(
markup
,
expectedOrderedItems
,
"C#"
);
}
...
...
src/EditorFeatures/VisualBasicTest/Completion/CompletionProviders/SymbolCompletionProviderTests.vb
浏览文件 @
d9be31da
...
...
@@ -2992,9 +2992,7 @@ End Class</Code>.Value
Dim
description
=
$
"<{VBFeaturesResources.Awaitable}> Function C.Goo() As Task
Doc Comment!
{WorkspacesResources.Usage_colon}
{SyntaxFacts.GetText(SyntaxKind.AwaitKeyword)} Goo()"
Doc Comment!"
Await
VerifyItemWithMscorlib45Async
(
code
,
"Goo"
,
description
,
LanguageNames
.
VisualBasic
)
End
Function
...
...
src/EditorFeatures/VisualBasicTest/QuickInfo/SemanticQuickInfoSourceTests.vb
浏览文件 @
d9be31da
...
...
@@ -1419,10 +1419,8 @@ End Class
Dim
description
=
<
File
>&
lt
;
<
%
=
VBFeaturesResources
.
Awaitable
%
>&
gt
;
Function
C
.
goo
()
As
Task
</
File
>
.
ConvertTestSourceTag
()
Dim
doc
=
StringFromLines
(
""
,
WorkspacesResources
.
Usage_colon
,
$
" {SyntaxFacts.GetText(SyntaxKind.AwaitKeyword)} goo()"
)
Await
TestFromXmlAsync
(
markup
,
MainDescription
(
description
),
Usage
(
doc
))
MainDescription
(
description
),
Usage
(
String
.
Empty
))
End
Function
<
WorkItem
(
7100
,
"https://github.com/dotnet/roslyn/issues/7100"
)
>
...
...
src/EditorFeatures/VisualBasicTest/SignatureHelp/InvocationExpressionSignatureHelpProviderTests.vb
浏览文件 @
d9be31da
...
...
@@ -803,10 +803,8 @@ Class C
End
Class
]]
></
a
>
.
Value
Dim
documentation
=
StringFromLines
(
""
,
WorkspacesResources
.
Usage_colon
,
" Await Goo()"
)
Dim
expectedOrderedItems
=
New
List
(
Of
SignatureHelpTestItem
)()
From
{
New
SignatureHelpTestItem
(
"C.Goo() As Task"
,
currentParameterIndex
:
=
0
,
methodDocumentation
:
=
documentation
)
New
SignatureHelpTestItem
(
"C.Goo() As Task"
,
currentParameterIndex
:
=
0
,
methodDocumentation
:
=
String
.
Empty
)
}
Await
TestSignatureHelpWithMscorlib45Async
(
markup
,
expectedOrderedItems
,
LanguageNames
.
VisualBasic
)
...
...
@@ -827,10 +825,8 @@ Class C
End
Class
]]
></
a
>
.
Value
Dim
documentation
=
StringFromLines
(
""
,
WorkspacesResources
.
Usage_colon
,
" Dim r as Integer = Await Goo()"
)
Dim
expectedOrderedItems
=
New
List
(
Of
SignatureHelpTestItem
)()
From
{
New
SignatureHelpTestItem
(
"C.Goo() As Task(Of Integer)"
,
currentParameterIndex
:
=
0
,
methodDocumentation
:
=
documentation
)
New
SignatureHelpTestItem
(
"C.Goo() As Task(Of Integer)"
,
currentParameterIndex
:
=
0
,
methodDocumentation
:
=
String
.
Empty
)
}
Await
TestSignatureHelpWithMscorlib45Async
(
markup
,
expectedOrderedItems
,
LanguageNames
.
VisualBasic
)
...
...
src/Features/CSharp/Portable/LanguageServices/CSharpSymbolDisplayService.SymbolDescriptionBuilder.cs
浏览文件 @
d9be31da
...
...
@@ -181,12 +181,6 @@ protected override void AddAwaitableExtensionPrefix()
return
ImmutableArray
<
SymbolDisplayPart
>.
Empty
;
}
protected
override
void
AddAwaitableUsageText
(
IMethodSymbol
method
,
SemanticModel
semanticModel
,
int
position
)
{
AddToGroup
(
SymbolDescriptionGroups
.
AwaitableUsageText
,
method
.
ToAwaitableParts
(
SyntaxFacts
.
GetText
(
SyntaxKind
.
AwaitKeyword
),
"x"
,
semanticModel
,
position
));
}
protected
override
void
AddCaptures
(
ISymbol
symbol
)
{
if
(
symbol
is
IMethodSymbol
method
&&
method
.
ContainingSymbol
.
IsKind
(
SymbolKind
.
Method
))
...
...
src/Features/CSharp/Portable/SignatureHelp/AbstractCSharpSignatureHelpProvider.cs
浏览文件 @
d9be31da
...
...
@@ -62,14 +62,12 @@ protected static SymbolDisplayPart NewLine()
parameter
.
ToMinimalDisplayParts
(
semanticModel
,
position
));
}
/// <summary>
/// We no longer show awaitable usage text in SignatureHelp, but IntelliCode expects this
/// method to exist.
/// </summary>
protected
IList
<
TaggedText
>
GetAwaitableUsage
(
IMethodSymbol
method
,
SemanticModel
semanticModel
,
int
position
)
{
if
(
method
.
IsAwaitableNonDynamic
(
semanticModel
,
position
))
{
return
method
.
ToAwaitableParts
(
SyntaxFacts
.
GetText
(
SyntaxKind
.
AwaitKeyword
),
"x"
,
semanticModel
,
position
)
.
ToTaggedText
(
TaggedTextStyle
.
None
);
}
return
SpecializedCollections
.
EmptyList
<
TaggedText
>();
}
}
...
...
src/Features/CSharp/Portable/SignatureHelp/AbstractOrdinaryMethodSignatureHelpProvider.cs
浏览文件 @
d9be31da
...
...
@@ -28,7 +28,7 @@ internal abstract class AbstractOrdinaryMethodSignatureHelpProvider : AbstractCS
method
,
semanticModel
,
position
,
symbolDisplayService
,
anonymousTypeDisplayService
,
method
.
IsParams
(),
c
=>
method
.
OriginalDefinition
.
GetDocumentationParts
(
semanticModel
,
position
,
documentationCommentFormattingService
,
c
)
.
Concat
(
GetAwaitableUsage
(
method
,
semanticModel
,
position
))
,
c
=>
method
.
OriginalDefinition
.
GetDocumentationParts
(
semanticModel
,
position
,
documentationCommentFormattingService
,
c
),
GetMethodGroupPreambleParts
(
method
,
semanticModel
,
position
),
GetSeparatorParts
(),
GetMethodGroupPostambleParts
(
method
),
...
...
src/Features/CSharp/Portable/SignatureHelp/GenericNameSignatureHelpProvider.cs
浏览文件 @
d9be31da
...
...
@@ -194,7 +194,7 @@ protected virtual TextSpan GetTextSpan(SyntaxToken genericIdentifier, SyntaxToke
symbol
,
semanticModel
,
position
,
symbolDisplayService
,
anonymousTypeDisplayService
,
false
,
c
=>
symbol
.
GetDocumentationParts
(
semanticModel
,
position
,
documentationCommentFormattingService
,
c
)
.
Concat
(
GetAwaitableUsage
(
method
,
semanticModel
,
position
))
,
c
=>
symbol
.
GetDocumentationParts
(
semanticModel
,
position
,
documentationCommentFormattingService
,
c
),
GetPreambleParts
(
method
,
semanticModel
,
position
),
GetSeparatorParts
(),
GetPostambleParts
(
method
,
semanticModel
,
position
),
...
...
src/Features/Core/Portable/LanguageServices/SymbolDisplayService/AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs
浏览文件 @
d9be31da
...
...
@@ -569,15 +569,8 @@ private void AddDescriptionForMethod(IMethodSymbol method)
AddToGroup
(
SymbolDescriptionGroups
.
MainDescription
,
ToMinimalDisplayParts
(
method
,
s_memberSignatureDisplayFormat
));
if
(
awaitable
)
{
AddAwaitableUsageText
(
method
,
_semanticModel
,
_position
);
}
}
protected
abstract
void
AddAwaitableUsageText
(
IMethodSymbol
method
,
SemanticModel
semanticModel
,
int
position
);
private
async
Task
AddDescriptionForParameterAsync
(
IParameterSymbol
symbol
)
{
if
(
symbol
.
IsOptional
)
...
...
src/Features/Core/Portable/Shared/Extensions/ISymbolExtensions_2.cs
浏览文件 @
d9be31da
...
...
@@ -252,83 +252,5 @@ private static string GetMethodDocumentation(IMethodSymbol method, Compilation c
return
method
.
GetDocumentationComment
(
compilation
,
expandIncludes
:
true
,
expandInheritdoc
:
true
,
cancellationToken
:
cancellationToken
).
SummaryText
;
}
}
public
static
IList
<
SymbolDisplayPart
>
ToAwaitableParts
(
this
ISymbol
symbol
,
string
awaitKeyword
,
string
initializedVariableName
,
SemanticModel
semanticModel
,
int
position
)
{
var
spacePart
=
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
Space
,
null
,
" "
);
var
parts
=
new
List
<
SymbolDisplayPart
>();
parts
.
AddLineBreak
();
parts
.
AddText
(
WorkspacesResources
.
Usage_colon
);
parts
.
AddLineBreak
();
parts
.
AddText
(
" "
);
var
returnType
=
symbol
.
InferAwaitableReturnType
(
semanticModel
,
position
);
returnType
=
returnType
!=
null
&&
returnType
.
SpecialType
!=
SpecialType
.
System_Void
?
returnType
:
null
;
if
(
returnType
!=
null
)
{
if
(
semanticModel
.
Language
==
"C#"
)
{
parts
.
AddRange
(
returnType
.
ToMinimalDisplayParts
(
semanticModel
,
position
));
parts
.
Add
(
spacePart
);
parts
.
Add
(
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
LocalName
,
null
,
initializedVariableName
));
}
else
{
parts
.
Add
(
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
Keyword
,
null
,
"Dim"
));
parts
.
Add
(
spacePart
);
parts
.
Add
(
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
LocalName
,
null
,
initializedVariableName
));
parts
.
Add
(
spacePart
);
parts
.
Add
(
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
Keyword
,
null
,
"as"
));
parts
.
Add
(
spacePart
);
parts
.
AddRange
(
returnType
.
ToMinimalDisplayParts
(
semanticModel
,
position
));
}
parts
.
Add
(
spacePart
);
parts
.
Add
(
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
Punctuation
,
null
,
"="
));
parts
.
Add
(
spacePart
);
}
parts
.
Add
(
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
Keyword
,
null
,
awaitKeyword
));
parts
.
Add
(
spacePart
);
parts
.
Add
(
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
MethodName
,
symbol
,
symbol
.
Name
));
parts
.
Add
(
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
Punctuation
,
null
,
"("
));
parts
.
Add
(
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
Punctuation
,
null
,
symbol
.
GetParameters
().
Any
()
?
"..."
:
""
));
parts
.
Add
(
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
Punctuation
,
null
,
")"
));
parts
.
Add
(
new
SymbolDisplayPart
(
SymbolDisplayPartKind
.
Punctuation
,
null
,
semanticModel
.
Language
==
"C#"
?
";"
:
""
));
return
parts
;
}
public
static
ITypeSymbol
InferAwaitableReturnType
(
this
ISymbol
symbol
,
SemanticModel
semanticModel
,
int
position
)
{
if
(!(
symbol
is
IMethodSymbol
methodSymbol
))
{
return
null
;
}
var
returnType
=
methodSymbol
.
ReturnType
;
if
(
returnType
==
null
)
{
return
null
;
}
var
potentialGetAwaiters
=
semanticModel
.
LookupSymbols
(
position
,
container
:
returnType
,
name
:
WellKnownMemberNames
.
GetAwaiter
,
includeReducedExtensionMethods
:
true
);
var
getAwaiters
=
potentialGetAwaiters
.
OfType
<
IMethodSymbol
>().
Where
(
x
=>
!
x
.
Parameters
.
Any
());
if
(!
getAwaiters
.
Any
())
{
return
null
;
}
var
getResults
=
getAwaiters
.
SelectMany
(
g
=>
semanticModel
.
LookupSymbols
(
position
,
container
:
g
.
ReturnType
,
name
:
WellKnownMemberNames
.
GetResult
));
var
getResult
=
getResults
.
OfType
<
IMethodSymbol
>().
FirstOrDefault
(
g
=>
!
g
.
IsStatic
);
if
(
getResult
==
null
)
{
return
null
;
}
return
getResult
.
ReturnType
;
}
}
}
src/Features/VisualBasic/Portable/LanguageServices/VisualBasicSymbolDisplayService.SymbolDescriptionBuilder.vb
浏览文件 @
d9be31da
...
...
@@ -150,11 +150,6 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LanguageServices
Return
Nothing
End
Function
Protected
Overrides
Sub
AddAwaitableUsageText
(
method
As
IMethodSymbol
,
semanticModel
As
SemanticModel
,
position
As
Integer
)
AddToGroup
(
SymbolDescriptionGroups
.
AwaitableUsageText
,
method
.
ToAwaitableParts
(
SyntaxFacts
.
GetText
(
SyntaxKind
.
AwaitKeyword
),
"r"
,
semanticModel
,
position
))
End
Sub
Protected
Overrides
Sub
AddCaptures
(
symbol
As
ISymbol
)
Dim
method
=
TryCast
(
symbol
,
IMethodSymbol
)
If
method
IsNot
Nothing
AndAlso
method
.
ContainingSymbol
.
IsKind
(
SymbolKind
.
Method
)
Then
...
...
src/Features/VisualBasic/Portable/SignatureHelp/AbstractOrdinaryMethodSignatureHelpProvider.vb
浏览文件 @
d9be31da
...
...
@@ -23,21 +23,13 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.SignatureHelp
member
,
semanticModel
,
position
,
symbolDisplayService
,
anonymousTypeDisplayService
,
member
.
IsParams
(),
Function
(
c
)
member
.
GetDocumentationParts
(
semanticModel
,
position
,
documentationCommentFormattingService
,
c
)
.
Concat
(
GetAwaitableDescription
(
member
,
semanticModel
,
position
).
ToTaggedText
())
,
Function
(
c
)
member
.
GetDocumentationParts
(
semanticModel
,
position
,
documentationCommentFormattingService
,
c
),
GetMemberGroupPreambleParts
(
member
,
semanticModel
,
position
),
GetSeparatorParts
(),
GetMemberGroupPostambleParts
(
member
,
semanticModel
,
position
),
member
.
GetParameters
().
Select
(
Function
(
p
)
Convert
(
p
,
semanticModel
,
position
,
documentationCommentFormattingService
,
cancellationToken
)).
ToList
())
End
Function
Private
Function
GetAwaitableDescription
(
member
As
ISymbol
,
semanticModel
As
SemanticModel
,
position
As
Integer
)
As
IList
(
Of
SymbolDisplayPart
)
If
member
.
IsAwaitableNonDynamic
(
semanticModel
,
position
)
Then
Return
member
.
ToAwaitableParts
(
SyntaxFacts
.
GetText
(
SyntaxKind
.
AwaitKeyword
),
"r"
,
semanticModel
,
position
)
End
If
Return
SpecializedCollections
.
EmptyList
(
Of
SymbolDisplayPart
)
End
Function
Private
Function
GetMemberGroupPreambleParts
(
symbol
As
ISymbol
,
semanticModel
As
SemanticModel
,
position
As
Integer
)
As
IList
(
Of
SymbolDisplayPart
)
Dim
result
=
New
List
(
Of
SymbolDisplayPart
)()
...
...
src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs
浏览文件 @
d9be31da
...
...
@@ -3745,15 +3745,6 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to Usage:.
/// </summary>
internal
static
string
Usage_colon
{
get
{
return
ResourceManager
.
GetString
(
"Usage_colon"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Value too large to be represented as a 30 bit unsigned integer..
/// </summary>
...
...
src/Workspaces/Core/Portable/WorkspacesResources.resx
浏览文件 @
d9be31da
...
...
@@ -459,9 +459,6 @@
<data
name=
"This_workspace_does_not_support_opening_and_closing_documents"
xml:space=
"preserve"
>
<value>
This workspace does not support opening and closing documents.
</value>
</data>
<data
name=
"Usage_colon"
xml:space=
"preserve"
>
<value>
Usage:
</value>
</data>
<data
name=
"Exceptions_colon"
xml:space=
"preserve"
>
<value>
Exceptions:
</value>
</data>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ Pozitivní kontrolní výrazy zpětného vyhledávání s nulovou šířkou se o
<target
state=
"translated"
>
Tento pracovní prostor nepodporuje otevírání a zavírání dokumentů.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
Použití:
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
Výjimky:
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ Positive Lookbehindassertionen mit Nullbreite werden normalerweise am Anfang reg
<target
state=
"translated"
>
Das Öffnen und Schließen von Dokumenten wird in diesem Arbeitsbereich nicht unterstützt.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
Nutzung:
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
Ausnahmen:
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ Las aserciones posteriores positivas de ancho cero se usan normalmente al princi
<target
state=
"translated"
>
Esta área de trabajo no admite la apertura y el cierre de documentos.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
Uso:
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
Excepciones:
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ Les assertions de postanalyse positives de largeur nulle sont généralement uti
<target
state=
"translated"
>
Cet espace de travail ne prend pas en charge l'ouverture et la fermeture de documents.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
Utilisation :
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
Exceptions :
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ Le asserzioni lookbehind positive di larghezza zero vengono usate in genere all'
<target
state=
"translated"
>
Questa area di lavoro non supporta l'apertura e la chiusura di documenti.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
Utilizzo:
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
Eccezioni:
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<target
state=
"translated"
>
このワークスペースではドキュメントの開閉をサポートしません。
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
使用法:
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
例外:
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<target
state=
"translated"
>
이 작업 영역에서는 문서 열기 및 닫기를 지원하지 않습니다.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
사용법:
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
예외:
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ Pozytywne asercje wsteczne o zerowej szerokości są zwykle używane na początk
<target
state=
"translated"
>
Otwieranie i zamykanie dokumentów nie jest obsługiwane w tym obszarze roboczym.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
Użycie:
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
Wyjątki:
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ As declarações de lookbehind positivas de largura zero normalmente são usadas
<target
state=
"translated"
>
Este espaço de trabalho não oferece suporte a abertura e fechamento de documentos.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
Uso:
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
Exceções:
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<target
state=
"translated"
>
Эта рабочая область не поддерживает открытие и закрытие документов.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
Использование:
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
Исключения:
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ Sıfır genişlikli pozitif geri yönlü onaylamalar genellikle normal ifadeleri
<target
state=
"translated"
>
Bu çalışma alanı, belgeleri açıp kapatmayı desteklemiyor.
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
Kullanım:
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
Özel Durumlar:
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<target
state=
"translated"
>
此工作区不支持打开和关闭文档。
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
使用情况:
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
异常:
</target>
...
...
src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf
浏览文件 @
d9be31da
...
...
@@ -1812,11 +1812,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<target
state=
"translated"
>
這個工作區不支援開啟及關閉文件。
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Usage_colon"
>
<source>
Usage:
</source>
<target
state=
"translated"
>
使用方式:
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Exceptions_colon"
>
<source>
Exceptions:
</source>
<target
state=
"translated"
>
例外狀況:
</target>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录