Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
370d73ca
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,发现更多精彩内容 >>
提交
370d73ca
编写于
3月 14, 2020
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Properly show defaults for value types in sighelp
上级
4faf4ad5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
30 deletion
+16
-30
src/Features/Core/Portable/ChangeSignature/AbstractChangeSignatureService.cs
...ortable/ChangeSignature/AbstractChangeSignatureService.cs
+1
-4
src/Features/Core/Portable/ChangeSignature/IChangeSignatureOptionsService.cs
...ortable/ChangeSignature/IChangeSignatureOptionsService.cs
+1
-5
src/VisualStudio/Core/Def/Implementation/ChangeSignature/ChangeSignatureDialogViewModel.cs
...ntation/ChangeSignature/ChangeSignatureDialogViewModel.cs
+12
-19
src/VisualStudio/Core/Def/Implementation/ChangeSignature/VisualStudioChangeSignatureOptionsService.cs
...ngeSignature/VisualStudioChangeSignatureOptionsService.cs
+2
-2
未找到文件。
src/Features/Core/Portable/ChangeSignature/AbstractChangeSignatureService.cs
浏览文件 @
370d73ca
...
...
@@ -166,11 +166,8 @@ internal ChangeSignatureResult ChangeSignatureWithContext(ChangeSignatureAnalyze
internal
ChangeSignatureOptionsResult
GetChangeSignatureOptions
(
ChangeSignatureAnalyzedContext
context
)
{
var
notificationService
=
context
.
Solution
.
Workspace
.
Services
.
GetService
<
INotificationService
>();
var
changeSignatureOptionsService
=
context
.
Solution
.
Workspace
.
Services
.
GetService
<
IChangeSignatureOptionsService
>();
var
isExtensionMethod
=
context
.
Symbol
is
IMethodSymbol
&&
(
context
.
Symbol
as
IMethodSymbol
).
IsExtensionMethod
;
return
changeSignatureOptionsService
.
GetChangeSignatureOptions
(
context
.
Symbol
,
context
.
ParameterConfiguration
,
notificationService
);
return
changeSignatureOptionsService
.
GetChangeSignatureOptions
(
context
.
Symbol
,
context
.
ParameterConfiguration
);
}
private
static
async
Task
<
ImmutableArray
<
ReferencedSymbol
>>
FindChangeSignatureReferencesAsync
(
...
...
src/Features/Core/Portable/ChangeSignature/IChangeSignatureOptionsService.cs
浏览文件 @
370d73ca
...
...
@@ -3,15 +3,11 @@
// See the LICENSE file in the project root for more information.
using
Microsoft.CodeAnalysis.Host
;
using
Microsoft.CodeAnalysis.Notification
;
namespace
Microsoft.CodeAnalysis.ChangeSignature
{
internal
interface
IChangeSignatureOptionsService
:
IWorkspaceService
{
ChangeSignatureOptionsResult
GetChangeSignatureOptions
(
ISymbol
symbol
,
ParameterConfiguration
parameters
,
INotificationService
notificationService
);
ChangeSignatureOptionsResult
GetChangeSignatureOptions
(
ISymbol
symbol
,
ParameterConfiguration
parameters
);
}
}
src/VisualStudio/Core/Def/Implementation/ChangeSignature/ChangeSignatureDialogViewModel.cs
浏览文件 @
370d73ca
...
...
@@ -20,11 +20,9 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.ChangeSignature
{
internal
class
ChangeSignatureDialogViewModel
:
AbstractNotifyPropertyChanged
{
private
readonly
INotificationService
_notificationService
;
private
readonly
IClassificationFormatMap
_classificationFormatMap
;
private
readonly
ClassificationTypeMap
_classificationTypeMap
;
private
readonly
ParameterConfiguration
_originalParameterConfiguration
;
private
readonly
ISymbol
_symbol
;
private
readonly
ParameterViewModel
_thisParameter
;
private
readonly
List
<
ParameterViewModel
>
_parameterGroup1
;
...
...
@@ -34,10 +32,9 @@ internal class ChangeSignatureDialogViewModel : AbstractNotifyPropertyChanged
private
ImmutableArray
<
SymbolDisplayPart
>
_declarationParts
;
private
bool
_previewChanges
;
internal
ChangeSignatureDialogViewModel
(
INotificationService
notificationService
,
ParameterConfiguration
parameters
,
ISymbol
symbol
,
IClassificationFormatMap
classificationFormatMap
,
ClassificationTypeMap
classificationTypeMap
)
internal
ChangeSignatureDialogViewModel
(
ParameterConfiguration
parameters
,
ISymbol
symbol
,
IClassificationFormatMap
classificationFormatMap
,
ClassificationTypeMap
classificationTypeMap
)
{
_originalParameterConfiguration
=
parameters
;
_notificationService
=
notificationService
;
_classificationFormatMap
=
classificationFormatMap
;
_classificationTypeMap
=
classificationTypeMap
;
...
...
@@ -52,7 +49,6 @@ internal ChangeSignatureDialogViewModel(INotificationService notificationService
_paramsParameter
=
new
ParameterViewModel
(
this
,
parameters
.
ParamsParameter
);
}
_symbol
=
symbol
;
_declarationParts
=
symbol
.
ToDisplayParts
(
s_symbolDeclarationDisplayFormat
);
_parameterGroup1
=
parameters
.
ParametersWithoutDefaultValues
.
Select
(
p
=>
new
ParameterViewModel
(
this
,
p
)).
ToList
();
...
...
@@ -509,25 +505,22 @@ public string Default
get
{
if
(!
ParameterSymbol
.
HasExplicitDefaultValue
)
{
return
string
.
Empty
;
}
switch
(
ParameterSymbol
.
Language
)
return
ParameterSymbol
.
Language
switch
{
case
LanguageNames
.
CSharp
:
return
NullText
(
"null"
);
case
LanguageNames
.
VisualBasic
:
return
NullText
(
"Nothing"
);
}
return
string
.
Empty
;
LanguageNames
.
CSharp
=>
NullText
(
"null"
,
"default"
),
LanguageNames
.
VisualBasic
=>
NullText
(
"Nothing"
,
"Nothing"
),
_
=>
string
.
Empty
,
};
string
NullText
(
string
@null
)
string
NullText
(
string
@null
,
string
@default
)
{
return
ParameterSymbol
.
ExplicitDefaultValue
==
null
?
@null
:
ParameterSymbol
.
ExplicitDefaultValue
is
string
?
"\""
+
ParameterSymbol
.
ExplicitDefaultValue
.
ToString
()
+
"\""
:
ParameterSymbol
.
ExplicitDefaultValue
.
ToString
();
var
value
=
ParameterSymbol
.
ExplicitDefaultValue
;
return
value
==
null
?
ParameterSymbol
.
Type
.
IsReferenceType
?
@null
:
@default
:
value
is
string
?
"\""
+
value
.
ToString
()
+
"\""
:
value
.
ToString
();
}
}
}
...
...
src/VisualStudio/Core/Def/Implementation/ChangeSignature/VisualStudioChangeSignatureOptionsService.cs
浏览文件 @
370d73ca
...
...
@@ -25,9 +25,9 @@ public VisualStudioChangeSignatureOptionsService(IClassificationFormatMapService
_classificationTypeMap
=
classificationTypeMap
;
}
public
ChangeSignatureOptionsResult
GetChangeSignatureOptions
(
ISymbol
symbol
,
ParameterConfiguration
parameters
,
INotificationService
notificationService
)
public
ChangeSignatureOptionsResult
GetChangeSignatureOptions
(
ISymbol
symbol
,
ParameterConfiguration
parameters
)
{
var
viewModel
=
new
ChangeSignatureDialogViewModel
(
notificationService
,
parameters
,
symbol
,
_classificationFormatMap
,
_classificationTypeMap
);
var
viewModel
=
new
ChangeSignatureDialogViewModel
(
parameters
,
symbol
,
_classificationFormatMap
,
_classificationTypeMap
);
var
dialog
=
new
ChangeSignatureDialog
(
viewModel
);
var
result
=
dialog
.
ShowModal
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录