Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
06a4af3e
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,发现更多精彩内容 >>
提交
06a4af3e
编写于
3月 26, 2020
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert sighelp
上级
31801795
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
67 addition
and
39 deletion
+67
-39
src/Features/CSharp/Portable/SignatureHelp/AbstractCSharpSignatureHelpProvider.cs
...able/SignatureHelp/AbstractCSharpSignatureHelpProvider.cs
+2
-1
src/Features/CSharp/Portable/SignatureHelp/AbstractOrdinaryMethodSignatureHelpProvider.cs
...natureHelp/AbstractOrdinaryMethodSignatureHelpProvider.cs
+3
-2
src/Features/CSharp/Portable/SignatureHelp/AttributeSignatureHelpProvider.cs
.../Portable/SignatureHelp/AttributeSignatureHelpProvider.cs
+1
-1
src/Features/CSharp/Portable/SignatureHelp/ConstructorInitializerSignatureHelpProvider.cs
...natureHelp/ConstructorInitializerSignatureHelpProvider.cs
+10
-6
src/Features/CSharp/Portable/SignatureHelp/ElementAccessExpressionSignatureHelpProvider.cs
...atureHelp/ElementAccessExpressionSignatureHelpProvider.cs
+20
-10
src/Features/CSharp/Portable/SignatureHelp/GenericNameSignatureHelpProvider.cs
...ortable/SignatureHelp/GenericNameSignatureHelpProvider.cs
+4
-3
src/Features/CSharp/Portable/SignatureHelp/GenericNameSignatureHelpProvider_NamedType.cs
...gnatureHelp/GenericNameSignatureHelpProvider_NamedType.cs
+5
-2
src/Features/CSharp/Portable/SignatureHelp/InitializerExpressionSignatureHelpProvider.cs
...gnatureHelp/InitializerExpressionSignatureHelpProvider.cs
+1
-1
src/Features/CSharp/Portable/SignatureHelp/InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs
...ocationExpressionSignatureHelpProviderBase_MethodGroup.cs
+1
-1
src/Features/CSharp/Portable/SignatureHelp/ObjectCreationExpressionSignatureHelpProvider.cs
...tureHelp/ObjectCreationExpressionSignatureHelpProvider.cs
+1
-1
src/Features/CSharp/Portable/SignatureHelp/ObjectCreationExpressionSignatureHelpProvider_DelegateType.cs
...ctCreationExpressionSignatureHelpProvider_DelegateType.cs
+9
-5
src/Features/CSharp/Portable/SignatureHelp/ObjectCreationExpressionSignatureHelpProvider_NormalType.cs
...jectCreationExpressionSignatureHelpProvider_NormalType.cs
+10
-6
未找到文件。
src/Features/CSharp/Portable/SignatureHelp/AbstractCSharpSignatureHelpProvider.cs
浏览文件 @
06a4af3e
...
@@ -55,7 +55,8 @@ protected static SymbolDisplayPart NewLine()
...
@@ -55,7 +55,8 @@ protected static SymbolDisplayPart NewLine()
IParameterSymbol
parameter
,
IParameterSymbol
parameter
,
SemanticModel
semanticModel
,
SemanticModel
semanticModel
,
int
position
,
int
position
,
IDocumentationCommentFormattingService
formatter
)
IDocumentationCommentFormattingService
formatter
,
CancellationToken
cancellationToken
)
{
{
return
new
SignatureHelpSymbolParameter
(
return
new
SignatureHelpSymbolParameter
(
parameter
.
Name
,
parameter
.
Name
,
...
...
src/Features/CSharp/Portable/SignatureHelp/AbstractOrdinaryMethodSignatureHelpProvider.cs
浏览文件 @
06a4af3e
...
@@ -19,7 +19,8 @@ internal abstract class AbstractOrdinaryMethodSignatureHelpProvider : AbstractCS
...
@@ -19,7 +19,8 @@ internal abstract class AbstractOrdinaryMethodSignatureHelpProvider : AbstractCS
Document
document
,
Document
document
,
IMethodSymbol
method
,
IMethodSymbol
method
,
int
position
,
int
position
,
SemanticModel
semanticModel
)
SemanticModel
semanticModel
,
CancellationToken
cancellationToken
)
{
{
return
ConvertMethodGroupMethod
(
document
,
method
,
position
,
semanticModel
,
descriptionParts
:
null
);
return
ConvertMethodGroupMethod
(
document
,
method
,
position
,
semanticModel
,
descriptionParts
:
null
);
}
}
...
@@ -43,7 +44,7 @@ internal abstract class AbstractOrdinaryMethodSignatureHelpProvider : AbstractCS
...
@@ -43,7 +44,7 @@ internal abstract class AbstractOrdinaryMethodSignatureHelpProvider : AbstractCS
GetMethodGroupPreambleParts
(
method
,
semanticModel
,
position
),
GetMethodGroupPreambleParts
(
method
,
semanticModel
,
position
),
GetSeparatorParts
(),
GetSeparatorParts
(),
GetMethodGroupPostambleParts
(),
GetMethodGroupPostambleParts
(),
method
.
Parameters
.
Select
(
p
=>
Convert
(
p
,
semanticModel
,
position
,
documentationCommentFormattingService
)).
ToList
(),
method
.
Parameters
.
Select
(
p
=>
Convert
(
p
,
semanticModel
,
position
,
documentationCommentFormattingService
,
CancellationToken
.
None
)).
ToList
(),
descriptionParts
:
descriptionParts
);
descriptionParts
:
descriptionParts
);
}
}
...
...
src/Features/CSharp/Portable/SignatureHelp/AttributeSignatureHelpProvider.cs
浏览文件 @
06a4af3e
...
@@ -159,7 +159,7 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
...
@@ -159,7 +159,7 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
var
result
=
new
List
<
SignatureHelpSymbolParameter
>();
var
result
=
new
List
<
SignatureHelpSymbolParameter
>();
foreach
(
var
parameter
in
constructor
.
Parameters
)
foreach
(
var
parameter
in
constructor
.
Parameters
)
{
{
result
.
Add
(
Convert
(
parameter
,
semanticModel
,
position
,
documentationCommentFormatter
));
result
.
Add
(
Convert
(
parameter
,
semanticModel
,
position
,
documentationCommentFormatter
,
cancellationToken
));
}
}
for
(
var
i
=
0
;
i
<
namedParameters
.
Count
;
i
++)
for
(
var
i
=
0
;
i
<
namedParameters
.
Count
;
i
++)
...
...
src/Features/CSharp/Portable/SignatureHelp/ConstructorInitializerSignatureHelpProvider.cs
浏览文件 @
06a4af3e
...
@@ -111,7 +111,7 @@ protected override async Task<SignatureHelpItems> GetItemsWorkerAsync(Document d
...
@@ -111,7 +111,7 @@ protected override async Task<SignatureHelpItems> GetItemsWorkerAsync(Document d
var
selectedItem
=
TryGetSelectedIndex
(
accessibleConstructors
,
symbolInfo
);
var
selectedItem
=
TryGetSelectedIndex
(
accessibleConstructors
,
symbolInfo
);
return
CreateSignatureHelpItems
(
accessibleConstructors
.
SelectAsArray
(
c
=>
return
CreateSignatureHelpItems
(
accessibleConstructors
.
SelectAsArray
(
c
=>
Convert
(
c
,
constructorInitializer
.
ArgumentList
.
OpenParenToken
,
semanticModel
,
symbolDisplayService
,
anonymousTypeDisplayService
,
documentationCommentFormattingService
)).
ToList
(),
Convert
(
c
,
constructorInitializer
.
ArgumentList
.
OpenParenToken
,
semanticModel
,
symbolDisplayService
,
anonymousTypeDisplayService
,
documentationCommentFormattingService
,
cancellationToken
)).
ToList
(),
textSpan
,
GetCurrentArgumentState
(
root
,
position
,
syntaxFacts
,
textSpan
,
cancellationToken
),
selectedItem
);
textSpan
,
GetCurrentArgumentState
(
root
,
position
,
syntaxFacts
,
textSpan
,
cancellationToken
),
selectedItem
);
}
}
...
@@ -132,7 +132,8 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
...
@@ -132,7 +132,8 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
SemanticModel
semanticModel
,
SemanticModel
semanticModel
,
ISymbolDisplayService
symbolDisplayService
,
ISymbolDisplayService
symbolDisplayService
,
IAnonymousTypeDisplayService
anonymousTypeDisplayService
,
IAnonymousTypeDisplayService
anonymousTypeDisplayService
,
IDocumentationCommentFormattingService
documentationCommentFormattingService
)
IDocumentationCommentFormattingService
documentationCommentFormattingService
,
CancellationToken
cancellationToken
)
{
{
var
position
=
openToken
.
SpanStart
;
var
position
=
openToken
.
SpanStart
;
var
item
=
CreateItem
(
var
item
=
CreateItem
(
...
@@ -142,8 +143,8 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
...
@@ -142,8 +143,8 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
constructor
.
GetDocumentationPartsFactory
(
semanticModel
,
position
,
documentationCommentFormattingService
),
constructor
.
GetDocumentationPartsFactory
(
semanticModel
,
position
,
documentationCommentFormattingService
),
GetPreambleParts
(
constructor
,
semanticModel
,
position
),
GetPreambleParts
(
constructor
,
semanticModel
,
position
),
GetSeparatorParts
(),
GetSeparatorParts
(),
GetPostambleParts
(),
GetPostambleParts
(
constructor
),
constructor
.
Parameters
.
Select
(
p
=>
Convert
(
p
,
semanticModel
,
position
,
documentationCommentFormattingService
)).
ToList
());
constructor
.
Parameters
.
Select
(
p
=>
Convert
(
p
,
semanticModel
,
position
,
documentationCommentFormattingService
,
cancellationToken
)).
ToList
());
return
item
;
return
item
;
}
}
...
@@ -160,7 +161,10 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
...
@@ -160,7 +161,10 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
return
result
;
return
result
;
}
}
private
IList
<
SymbolDisplayPart
>
GetPostambleParts
()
private
IList
<
SymbolDisplayPart
>
GetPostambleParts
(
IMethodSymbol
method
)
=>
SpecializedCollections
.
SingletonList
(
Punctuation
(
SyntaxKind
.
CloseParenToken
));
{
return
SpecializedCollections
.
SingletonList
(
Punctuation
(
SyntaxKind
.
CloseParenToken
));
}
}
}
}
}
src/Features/CSharp/Portable/SignatureHelp/ElementAccessExpressionSignatureHelpProvider.cs
浏览文件 @
06a4af3e
...
@@ -110,7 +110,7 @@ protected override async Task<SignatureHelpItems> GetItemsWorkerAsync(Document d
...
@@ -110,7 +110,7 @@ protected override async Task<SignatureHelpItems> GetItemsWorkerAsync(Document d
var
syntaxFacts
=
document
.
GetLanguageService
<
ISyntaxFactsService
>();
var
syntaxFacts
=
document
.
GetLanguageService
<
ISyntaxFactsService
>();
return
CreateSignatureHelpItems
(
accessibleIndexers
.
Select
(
p
=>
return
CreateSignatureHelpItems
(
accessibleIndexers
.
Select
(
p
=>
Convert
(
p
,
openBrace
,
semanticModel
,
symbolDisplayService
,
anonymousTypeDisplayService
,
documentationCommentFormattingService
)).
ToList
(),
Convert
(
p
,
openBrace
,
semanticModel
,
symbolDisplayService
,
anonymousTypeDisplayService
,
documentationCommentFormattingService
,
cancellationToken
)).
ToList
(),
textSpan
,
GetCurrentArgumentState
(
root
,
position
,
syntaxFacts
,
textSpan
,
cancellationToken
),
selectedItem
:
null
);
textSpan
,
GetCurrentArgumentState
(
root
,
position
,
syntaxFacts
,
textSpan
,
cancellationToken
),
selectedItem
:
null
);
}
}
...
@@ -118,9 +118,14 @@ private TextSpan GetTextSpan(ExpressionSyntax expression, SyntaxToken openBracke
...
@@ -118,9 +118,14 @@ private TextSpan GetTextSpan(ExpressionSyntax expression, SyntaxToken openBracke
{
{
if
(
openBracket
.
Parent
is
BracketedArgumentListSyntax
)
if
(
openBracket
.
Parent
is
BracketedArgumentListSyntax
)
{
{
return
expression
.
Parent
is
ConditionalAccessExpressionSyntax
conditional
if
(
expression
.
Parent
is
ConditionalAccessExpressionSyntax
conditional
)
?
TextSpan
.
FromBounds
(
conditional
.
Span
.
Start
,
openBracket
.
FullSpan
.
End
)
{
:
CompleteElementAccessExpression
.
GetTextSpan
(
openBracket
);
return
TextSpan
.
FromBounds
(
conditional
.
Span
.
Start
,
openBracket
.
FullSpan
.
End
);
}
else
{
return
CompleteElementAccessExpression
.
GetTextSpan
(
expression
,
openBracket
);
}
}
}
else
if
(
openBracket
.
Parent
is
ArrayRankSpecifierSyntax
)
else
if
(
openBracket
.
Parent
is
ArrayRankSpecifierSyntax
)
{
{
...
@@ -155,6 +160,7 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
...
@@ -155,6 +160,7 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
if
(
expression
.
Parent
is
ConditionalAccessExpressionSyntax
)
if
(
expression
.
Parent
is
ConditionalAccessExpressionSyntax
)
{
{
// The typed code looks like: <expression>?[
// The typed code looks like: <expression>?[
var
conditional
=
(
ConditionalAccessExpressionSyntax
)
expression
.
Parent
;
var
elementBinding
=
SyntaxFactory
.
ElementBindingExpression
(
newBracketedArgumentList
);
var
elementBinding
=
SyntaxFactory
.
ElementBindingExpression
(
newBracketedArgumentList
);
var
conditionalAccessExpression
=
SyntaxFactory
.
ConditionalAccessExpression
(
expression
,
elementBinding
);
var
conditionalAccessExpression
=
SyntaxFactory
.
ConditionalAccessExpression
(
expression
,
elementBinding
);
offset
=
expression
.
SpanStart
-
conditionalAccessExpression
.
SpanStart
;
offset
=
expression
.
SpanStart
-
conditionalAccessExpression
.
SpanStart
;
...
@@ -225,7 +231,8 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
...
@@ -225,7 +231,8 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
SemanticModel
semanticModel
,
SemanticModel
semanticModel
,
ISymbolDisplayService
symbolDisplayService
,
ISymbolDisplayService
symbolDisplayService
,
IAnonymousTypeDisplayService
anonymousTypeDisplayService
,
IAnonymousTypeDisplayService
anonymousTypeDisplayService
,
IDocumentationCommentFormattingService
documentationCommentFormattingService
)
IDocumentationCommentFormattingService
documentationCommentFormattingService
,
CancellationToken
cancellationToken
)
{
{
var
position
=
openToken
.
SpanStart
;
var
position
=
openToken
.
SpanStart
;
var
item
=
CreateItem
(
indexer
,
semanticModel
,
position
,
var
item
=
CreateItem
(
indexer
,
semanticModel
,
position
,
...
@@ -234,8 +241,8 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
...
@@ -234,8 +241,8 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
indexer
.
GetDocumentationPartsFactory
(
semanticModel
,
position
,
documentationCommentFormattingService
),
indexer
.
GetDocumentationPartsFactory
(
semanticModel
,
position
,
documentationCommentFormattingService
),
GetPreambleParts
(
indexer
,
position
,
semanticModel
),
GetPreambleParts
(
indexer
,
position
,
semanticModel
),
GetSeparatorParts
(),
GetSeparatorParts
(),
GetPostambleParts
(),
GetPostambleParts
(
indexer
),
indexer
.
Parameters
.
Select
(
p
=>
Convert
(
p
,
semanticModel
,
position
,
documentationCommentFormattingService
)).
ToList
());
indexer
.
Parameters
.
Select
(
p
=>
Convert
(
p
,
semanticModel
,
position
,
documentationCommentFormattingService
,
cancellationToken
)).
ToList
());
return
item
;
return
item
;
}
}
...
@@ -274,8 +281,11 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
...
@@ -274,8 +281,11 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
return
result
;
return
result
;
}
}
private
IList
<
SymbolDisplayPart
>
GetPostambleParts
()
private
IList
<
SymbolDisplayPart
>
GetPostambleParts
(
IPropertySymbol
indexer
)
=>
SpecializedCollections
.
SingletonList
(
Punctuation
(
SyntaxKind
.
CloseBracketToken
));
{
return
SpecializedCollections
.
SingletonList
(
Punctuation
(
SyntaxKind
.
CloseBracketToken
));
}
private
static
class
CompleteElementAccessExpression
private
static
class
CompleteElementAccessExpression
{
{
...
@@ -294,7 +304,7 @@ internal static bool IsArgumentListToken(ElementAccessExpressionSyntax expressio
...
@@ -294,7 +304,7 @@ internal static bool IsArgumentListToken(ElementAccessExpressionSyntax expressio
token
!=
expression
.
ArgumentList
.
CloseBracketToken
;
token
!=
expression
.
ArgumentList
.
CloseBracketToken
;
}
}
internal
static
TextSpan
GetTextSpan
(
SyntaxToken
openBracket
)
internal
static
TextSpan
GetTextSpan
(
Syntax
Node
expression
,
Syntax
Token
openBracket
)
{
{
Contract
.
ThrowIfFalse
(
openBracket
.
Parent
is
BracketedArgumentListSyntax
&&
Contract
.
ThrowIfFalse
(
openBracket
.
Parent
is
BracketedArgumentListSyntax
&&
(
openBracket
.
Parent
.
Parent
is
ElementAccessExpressionSyntax
||
openBracket
.
Parent
.
Parent
is
ElementBindingExpressionSyntax
));
(
openBracket
.
Parent
.
Parent
is
ElementAccessExpressionSyntax
||
openBracket
.
Parent
.
Parent
is
ElementBindingExpressionSyntax
));
...
...
src/Features/CSharp/Portable/SignatureHelp/GenericNameSignatureHelpProvider.cs
浏览文件 @
06a4af3e
...
@@ -186,7 +186,7 @@ protected virtual TextSpan GetTextSpan(SyntaxToken genericIdentifier, SyntaxToke
...
@@ -186,7 +186,7 @@ protected virtual TextSpan GetTextSpan(SyntaxToken genericIdentifier, SyntaxToke
symbol
.
GetDocumentationPartsFactory
(
semanticModel
,
position
,
documentationCommentFormattingService
),
symbol
.
GetDocumentationPartsFactory
(
semanticModel
,
position
,
documentationCommentFormattingService
),
GetPreambleParts
(
namedType
,
semanticModel
,
position
),
GetPreambleParts
(
namedType
,
semanticModel
,
position
),
GetSeparatorParts
(),
GetSeparatorParts
(),
GetPostambleParts
(),
GetPostambleParts
(
namedType
),
namedType
.
TypeParameters
.
Select
(
p
=>
Convert
(
p
,
semanticModel
,
position
,
documentationCommentFormattingService
,
cancellationToken
)).
ToList
());
namedType
.
TypeParameters
.
Select
(
p
=>
Convert
(
p
,
semanticModel
,
position
,
documentationCommentFormattingService
,
cancellationToken
)).
ToList
());
}
}
else
else
...
@@ -222,13 +222,14 @@ protected virtual TextSpan GetTextSpan(SyntaxToken genericIdentifier, SyntaxToke
...
@@ -222,13 +222,14 @@ protected virtual TextSpan GetTextSpan(SyntaxToken genericIdentifier, SyntaxToke
isOptional
:
false
,
isOptional
:
false
,
documentationFactory
:
parameter
.
GetDocumentationPartsFactory
(
semanticModel
,
position
,
formatter
),
documentationFactory
:
parameter
.
GetDocumentationPartsFactory
(
semanticModel
,
position
,
formatter
),
displayParts
:
parameter
.
ToMinimalDisplayParts
(
semanticModel
,
position
,
s_minimallyQualifiedFormat
),
displayParts
:
parameter
.
ToMinimalDisplayParts
(
semanticModel
,
position
,
s_minimallyQualifiedFormat
),
selectedDisplayParts
:
GetSelectedDisplayParts
(
parameter
,
semanticModel
,
position
));
selectedDisplayParts
:
GetSelectedDisplayParts
(
parameter
,
semanticModel
,
position
,
cancellationToken
));
}
}
private
IList
<
SymbolDisplayPart
>
GetSelectedDisplayParts
(
private
IList
<
SymbolDisplayPart
>
GetSelectedDisplayParts
(
ITypeParameterSymbol
typeParam
,
ITypeParameterSymbol
typeParam
,
SemanticModel
semanticModel
,
SemanticModel
semanticModel
,
int
position
)
int
position
,
CancellationToken
cancellationToken
)
{
{
var
parts
=
new
List
<
SymbolDisplayPart
>();
var
parts
=
new
List
<
SymbolDisplayPart
>();
...
...
src/Features/CSharp/Portable/SignatureHelp/GenericNameSignatureHelpProvider_NamedType.cs
浏览文件 @
06a4af3e
...
@@ -22,7 +22,10 @@ internal partial class GenericNameSignatureHelpProvider
...
@@ -22,7 +22,10 @@ internal partial class GenericNameSignatureHelpProvider
return
result
;
return
result
;
}
}
private
IList
<
SymbolDisplayPart
>
GetPostambleParts
()
private
IList
<
SymbolDisplayPart
>
GetPostambleParts
(
INamedTypeSymbol
namedType
)
=>
SpecializedCollections
.
SingletonList
(
Punctuation
(
SyntaxKind
.
GreaterThanToken
));
{
return
SpecializedCollections
.
SingletonList
(
Punctuation
(
SyntaxKind
.
GreaterThanToken
));
}
}
}
}
}
src/Features/CSharp/Portable/SignatureHelp/InitializerExpressionSignatureHelpProvider.cs
浏览文件 @
06a4af3e
...
@@ -61,7 +61,7 @@ protected override async Task<SignatureHelpItems> GetItemsWorkerAsync(Document d
...
@@ -61,7 +61,7 @@ protected override async Task<SignatureHelpItems> GetItemsWorkerAsync(Document d
var
semanticModel
=
await
document
.
GetSemanticModelAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
var
semanticModel
=
await
document
.
GetSemanticModelAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
return
CreateCollectionInitializerSignatureHelpItems
(
addMethods
.
Select
(
s
=>
return
CreateCollectionInitializerSignatureHelpItems
(
addMethods
.
Select
(
s
=>
ConvertMethodGroupMethod
(
document
,
s
,
initializerExpression
.
OpenBraceToken
.
SpanStart
,
semanticModel
)).
ToList
(),
ConvertMethodGroupMethod
(
document
,
s
,
initializerExpression
.
OpenBraceToken
.
SpanStart
,
semanticModel
,
cancellationToken
)).
ToList
(),
textSpan
,
GetCurrentArgumentState
(
root
,
position
,
syntaxFacts
,
textSpan
,
cancellationToken
));
textSpan
,
GetCurrentArgumentState
(
root
,
position
,
syntaxFacts
,
textSpan
,
cancellationToken
));
}
}
...
...
src/Features/CSharp/Portable/SignatureHelp/InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs
浏览文件 @
06a4af3e
...
@@ -26,7 +26,7 @@ internal partial class InvocationExpressionSignatureHelpProviderBase
...
@@ -26,7 +26,7 @@ internal partial class InvocationExpressionSignatureHelpProviderBase
CancellationToken
cancellationToken
)
CancellationToken
cancellationToken
)
{
{
return
Task
.
FromResult
(
return
Task
.
FromResult
(
(
accessibleMethods
.
SelectAsArray
(
m
=>
ConvertMethodGroupMethod
(
document
,
m
,
invocationExpression
.
SpanStart
,
semanticModel
)),
(
accessibleMethods
.
SelectAsArray
(
m
=>
ConvertMethodGroupMethod
(
document
,
m
,
invocationExpression
.
SpanStart
,
semanticModel
,
cancellationToken
)),
TryGetSelectedIndex
(
accessibleMethods
,
currentSymbol
)));
TryGetSelectedIndex
(
accessibleMethods
,
currentSymbol
)));
}
}
...
...
src/Features/CSharp/Portable/SignatureHelp/ObjectCreationExpressionSignatureHelpProvider.cs
浏览文件 @
06a4af3e
...
@@ -81,7 +81,7 @@ protected override async Task<SignatureHelpItems> GetItemsWorkerAsync(Document d
...
@@ -81,7 +81,7 @@ protected override async Task<SignatureHelpItems> GetItemsWorkerAsync(Document d
var
syntaxFacts
=
document
.
GetLanguageService
<
ISyntaxFactsService
>();
var
syntaxFacts
=
document
.
GetLanguageService
<
ISyntaxFactsService
>();
var
(
items
,
selectedItem
)
=
type
.
TypeKind
==
TypeKind
.
Delegate
var
(
items
,
selectedItem
)
=
type
.
TypeKind
==
TypeKind
.
Delegate
?
GetDelegateTypeConstructors
(
objectCreationExpression
,
semanticModel
,
symbolDisplayService
,
anonymousTypeDisplayService
,
type
,
cancellationToken
)
?
GetDelegateTypeConstructors
(
objectCreationExpression
,
semanticModel
,
symbolDisplayService
,
anonymousTypeDisplayService
,
type
,
within
,
cancellationToken
)
:
GetNormalTypeConstructors
(
document
,
objectCreationExpression
,
semanticModel
,
symbolDisplayService
,
anonymousTypeDisplayService
,
documentationCommentFormattingService
,
type
,
within
,
cancellationToken
);
:
GetNormalTypeConstructors
(
document
,
objectCreationExpression
,
semanticModel
,
symbolDisplayService
,
anonymousTypeDisplayService
,
documentationCommentFormattingService
,
type
,
within
,
cancellationToken
);
return
CreateSignatureHelpItems
(
items
,
textSpan
,
return
CreateSignatureHelpItems
(
items
,
textSpan
,
...
...
src/Features/CSharp/Portable/SignatureHelp/ObjectCreationExpressionSignatureHelpProvider_DelegateType.cs
浏览文件 @
06a4af3e
...
@@ -19,6 +19,7 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
...
@@ -19,6 +19,7 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
ISymbolDisplayService
symbolDisplayService
,
ISymbolDisplayService
symbolDisplayService
,
IAnonymousTypeDisplayService
anonymousTypeDisplayService
,
IAnonymousTypeDisplayService
anonymousTypeDisplayService
,
INamedTypeSymbol
delegateType
,
INamedTypeSymbol
delegateType
,
INamedTypeSymbol
containingType
,
CancellationToken
cancellationToken
)
CancellationToken
cancellationToken
)
{
{
var
invokeMethod
=
delegateType
.
DelegateInvokeMethod
;
var
invokeMethod
=
delegateType
.
DelegateInvokeMethod
;
...
@@ -35,8 +36,8 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
...
@@ -35,8 +36,8 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
documentationFactory
:
null
,
documentationFactory
:
null
,
prefixParts
:
GetDelegateTypePreambleParts
(
invokeMethod
,
semanticModel
,
position
),
prefixParts
:
GetDelegateTypePreambleParts
(
invokeMethod
,
semanticModel
,
position
),
separatorParts
:
GetSeparatorParts
(),
separatorParts
:
GetSeparatorParts
(),
suffixParts
:
GetDelegateTypePostambleParts
(),
suffixParts
:
GetDelegateTypePostambleParts
(
invokeMethod
),
parameters
:
GetDelegateTypeParameters
(
invokeMethod
,
semanticModel
,
position
));
parameters
:
GetDelegateTypeParameters
(
invokeMethod
,
semanticModel
,
position
,
cancellationToken
));
return
(
SpecializedCollections
.
SingletonList
(
item
),
0
);
return
(
SpecializedCollections
.
SingletonList
(
item
),
0
);
}
}
...
@@ -51,7 +52,7 @@ private IList<SymbolDisplayPart> GetDelegateTypePreambleParts(IMethodSymbol invo
...
@@ -51,7 +52,7 @@ private IList<SymbolDisplayPart> GetDelegateTypePreambleParts(IMethodSymbol invo
return
result
;
return
result
;
}
}
private
IList
<
SignatureHelpSymbolParameter
>
GetDelegateTypeParameters
(
IMethodSymbol
invokeMethod
,
SemanticModel
semanticModel
,
int
position
)
private
IList
<
SignatureHelpSymbolParameter
>
GetDelegateTypeParameters
(
IMethodSymbol
invokeMethod
,
SemanticModel
semanticModel
,
int
position
,
CancellationToken
cancellationToken
)
{
{
const
string
TargetName
=
"target"
;
const
string
TargetName
=
"target"
;
...
@@ -85,7 +86,10 @@ private IList<SignatureHelpSymbolParameter> GetDelegateTypeParameters(IMethodSym
...
@@ -85,7 +86,10 @@ private IList<SignatureHelpSymbolParameter> GetDelegateTypeParameters(IMethodSym
displayParts
:
parts
));
displayParts
:
parts
));
}
}
private
IList
<
SymbolDisplayPart
>
GetDelegateTypePostambleParts
()
private
IList
<
SymbolDisplayPart
>
GetDelegateTypePostambleParts
(
IMethodSymbol
invokeMethod
)
=>
SpecializedCollections
.
SingletonList
(
Punctuation
(
SyntaxKind
.
CloseParenToken
));
{
return
SpecializedCollections
.
SingletonList
(
Punctuation
(
SyntaxKind
.
CloseParenToken
));
}
}
}
}
}
src/Features/CSharp/Portable/SignatureHelp/ObjectCreationExpressionSignatureHelpProvider_NormalType.cs
浏览文件 @
06a4af3e
...
@@ -37,7 +37,7 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
...
@@ -37,7 +37,7 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
var
selectedItem
=
TryGetSelectedIndex
(
accessibleConstructors
,
symbolInfo
);
var
selectedItem
=
TryGetSelectedIndex
(
accessibleConstructors
,
symbolInfo
);
var
items
=
accessibleConstructors
.
SelectAsArray
(
c
=>
var
items
=
accessibleConstructors
.
SelectAsArray
(
c
=>
ConvertNormalTypeConstructor
(
c
,
objectCreationExpression
,
semanticModel
,
symbolDisplayService
,
anonymousTypeDisplayService
,
documentationCommentFormattingService
));
ConvertNormalTypeConstructor
(
c
,
objectCreationExpression
,
semanticModel
,
symbolDisplayService
,
anonymousTypeDisplayService
,
documentationCommentFormattingService
,
cancellationToken
));
return
(
items
,
selectedItem
);
return
(
items
,
selectedItem
);
}
}
...
@@ -48,7 +48,8 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
...
@@ -48,7 +48,8 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
SemanticModel
semanticModel
,
SemanticModel
semanticModel
,
ISymbolDisplayService
symbolDisplayService
,
ISymbolDisplayService
symbolDisplayService
,
IAnonymousTypeDisplayService
anonymousTypeDisplayService
,
IAnonymousTypeDisplayService
anonymousTypeDisplayService
,
IDocumentationCommentFormattingService
documentationCommentFormattingService
)
IDocumentationCommentFormattingService
documentationCommentFormattingService
,
CancellationToken
cancellationToken
)
{
{
var
position
=
objectCreationExpression
.
SpanStart
;
var
position
=
objectCreationExpression
.
SpanStart
;
var
item
=
CreateItem
(
var
item
=
CreateItem
(
...
@@ -58,8 +59,8 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
...
@@ -58,8 +59,8 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
constructor
.
GetDocumentationPartsFactory
(
semanticModel
,
position
,
documentationCommentFormattingService
),
constructor
.
GetDocumentationPartsFactory
(
semanticModel
,
position
,
documentationCommentFormattingService
),
GetNormalTypePreambleParts
(
constructor
,
semanticModel
,
position
),
GetNormalTypePreambleParts
(
constructor
,
semanticModel
,
position
),
GetSeparatorParts
(),
GetSeparatorParts
(),
GetNormalTypePostambleParts
(),
GetNormalTypePostambleParts
(
constructor
),
constructor
.
Parameters
.
Select
(
p
=>
Convert
(
p
,
semanticModel
,
position
,
documentationCommentFormattingService
)).
ToList
());
constructor
.
Parameters
.
Select
(
p
=>
Convert
(
p
,
semanticModel
,
position
,
documentationCommentFormattingService
,
cancellationToken
)).
ToList
());
return
item
;
return
item
;
}
}
...
@@ -77,7 +78,10 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
...
@@ -77,7 +78,10 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
return
result
;
return
result
;
}
}
private
IList
<
SymbolDisplayPart
>
GetNormalTypePostambleParts
()
private
IList
<
SymbolDisplayPart
>
GetNormalTypePostambleParts
(
IMethodSymbol
method
)
=>
SpecializedCollections
.
SingletonList
(
Punctuation
(
SyntaxKind
.
CloseParenToken
));
{
return
SpecializedCollections
.
SingletonList
(
Punctuation
(
SyntaxKind
.
CloseParenToken
));
}
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录