Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
798a491a
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,发现更多精彩内容 >>
提交
798a491a
编写于
10月 10, 2016
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add generate-method tests.
上级
f511e8f4
变更
19
显示空白变更内容
内联
并排
Showing
19 changed file
with
96 addition
and
85 deletion
+96
-85
src/EditorFeatures/CSharpTest/CodeActions/EncapsulateField/EncapsulateFieldTests.cs
...est/CodeActions/EncapsulateField/EncapsulateFieldTests.cs
+2
-2
src/EditorFeatures/CSharpTest/CodeActions/GenerateFromMembers/GenerateConstructorFromMembers/GenerateConstructorFromMembersTests.cs
...tructorFromMembers/GenerateConstructorFromMembersTests.cs
+1
-1
src/EditorFeatures/CSharpTest/Completion/CompletionProviders/OverrideCompletionProviderTests.cs
...on/CompletionProviders/OverrideCompletionProviderTests.cs
+2
-2
src/EditorFeatures/CSharpTest/Diagnostics/GenerateConstructor/GenerateConstructorTests.cs
...agnostics/GenerateConstructor/GenerateConstructorTests.cs
+1
-1
src/EditorFeatures/CSharpTest/Diagnostics/GenerateMethod/GenerateMethodTests.cs
...arpTest/Diagnostics/GenerateMethod/GenerateMethodTests.cs
+11
-0
src/EditorFeatures/CSharpTest/Diagnostics/ImplementAbstractClass/ImplementAbstractClassTests.cs
...ics/ImplementAbstractClass/ImplementAbstractClassTests.cs
+11
-11
src/EditorFeatures/CSharpTest/Diagnostics/ImplementInterface/ImplementInterfaceTests.cs
...Diagnostics/ImplementInterface/ImplementInterfaceTests.cs
+18
-18
src/EditorFeatures/CSharpTest/EncapsulateField/EncapsulateFieldTestState.cs
.../CSharpTest/EncapsulateField/EncapsulateFieldTestState.cs
+2
-2
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForAccessorsTests.cs
...t/UseExpressionBody/UseExpressionBodyForAccessorsTests.cs
+7
-7
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForConstructorsTests.cs
...seExpressionBody/UseExpressionBodyForConstructorsTests.cs
+2
-2
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForConversionOperatorsTests.cs
...ssionBody/UseExpressionBodyForConversionOperatorsTests.cs
+2
-2
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForIndexerTests.cs
...est/UseExpressionBody/UseExpressionBodyForIndexerTests.cs
+6
-6
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForMethodsTests.cs
...est/UseExpressionBody/UseExpressionBodyForMethodsTests.cs
+2
-2
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForOperatorsTests.cs
...t/UseExpressionBody/UseExpressionBodyForOperatorsTests.cs
+2
-2
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForPropertiesTests.cs
.../UseExpressionBody/UseExpressionBodyForPropertiesTests.cs
+6
-6
src/EditorFeatures/Test/CodeGeneration/CodeGenerationTests.CSharp.cs
...eatures/Test/CodeGeneration/CodeGenerationTests.CSharp.cs
+2
-2
src/VisualStudio/Core/Test/CodeModel/CSharp/CodeClassTests.vb
...VisualStudio/Core/Test/CodeModel/CSharp/CodeClassTests.vb
+4
-4
src/Workspaces/CSharp/Portable/CodeStyle/CSharpCodeStyleOptions.cs
...paces/CSharp/Portable/CodeStyle/CSharpCodeStyleOptions.cs
+7
-7
src/Workspaces/Core/Portable/CodeStyle/CodeStyleOptions.cs
src/Workspaces/Core/Portable/CodeStyle/CodeStyleOptions.cs
+8
-8
未找到文件。
src/EditorFeatures/CSharpTest/CodeActions/EncapsulateField/EncapsulateFieldTests.cs
浏览文件 @
798a491a
...
...
@@ -23,8 +23,8 @@ protected override CodeRefactoringProvider CreateCodeRefactoringProvider(Workspa
private
static
readonly
Dictionary
<
OptionKey
,
object
>
AllOptionsOff
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
};
internal
Task
TestAllOptionsOffAsync
(
...
...
src/EditorFeatures/CSharpTest/CodeActions/GenerateFromMembers/GenerateConstructorFromMembers/GenerateConstructorFromMembersTests.cs
浏览文件 @
798a491a
...
...
@@ -33,7 +33,7 @@ public async Task TestSingleFieldWithCodeStyle()
await
TestAsync
(
@"using System . Collections . Generic ; class Z { [|int a ;|] } "
,
@"using System . Collections . Generic ; class Z { int a ; public Z ( int a ) => this . a = a ; } "
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
));
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsGenerateConstructorFromMembers
)]
...
...
src/EditorFeatures/CSharpTest/Completion/CompletionProviders/OverrideCompletionProviderTests.cs
浏览文件 @
798a491a
...
...
@@ -28,8 +28,8 @@ internal override CompletionProvider CreateCompletionProvider()
protected
override
void
SetWorkspaceOptions
(
TestWorkspace
workspace
)
{
workspace
.
Options
=
workspace
.
Options
.
WithChangedOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
)
.
WithChangedOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
);
workspace
.
Options
=
workspace
.
Options
.
WithChangedOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
)
.
WithChangedOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
);
}
#
region
"CompletionItem tests"
...
...
src/EditorFeatures/CSharpTest/Diagnostics/GenerateConstructor/GenerateConstructorTests.cs
浏览文件 @
798a491a
...
...
@@ -36,7 +36,7 @@ public async Task TestWithSimpleArgument_UseExpressionBody1()
await
TestAsync
(
@"class C { void M() { new [|C|](1); } }"
,
@"class C { private int v; public C(int v) => this.v = v; void M() { new C(1); } }"
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
));
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
));
}
[
Fact
,
WorkItem
(
910589
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/910589"
),
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsGenerateConstructor
)]
...
...
src/EditorFeatures/CSharpTest/Diagnostics/GenerateMethod/GenerateMethodTests.cs
浏览文件 @
798a491a
...
...
@@ -3,7 +3,9 @@
using
System
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.CodeFixes.GenerateMethod
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.Test.Utilities
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Roslyn.Test.Utilities
;
...
...
@@ -26,6 +28,15 @@ public async Task TestSimpleInvocationIntoSameType()
@"using System; class Class { void Method() { Foo(); } private void Foo() { throw new NotImplementedException(); } }"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsGenerateMethod
)]
public
async
Task
TestSimpleInvocationIntoSameType_CodeStyle1
()
{
await
TestAsync
(
@"class Class { void Method() { [|Foo|](); } }"
,
@"using System; class Class { void Method() { Foo(); } private void Foo() => throw new NotImplementedException(); }"
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
TrueWithNoneEnforcement
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsGenerateMethod
)]
[
WorkItem
(
11518
,
"https://github.com/dotnet/roslyn/issues/11518"
)]
public
async
Task
NameMatchesNamespaceName
()
...
...
src/EditorFeatures/CSharpTest/Diagnostics/ImplementAbstractClass/ImplementAbstractClassTests.cs
浏览文件 @
798a491a
...
...
@@ -25,12 +25,12 @@ public partial class ImplementAbstractClassTests : AbstractCSharpDiagnosticProvi
private
static
readonly
Dictionary
<
OptionKey
,
object
>
AllOptionsOff
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
};
internal
Task
TestAllOptionsOffAsync
(
...
...
@@ -493,7 +493,7 @@ class T : A
{
public override void M(int x) => throw new NotImplementedException();
}
"
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
));
"
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
));
}
[
WorkItem
(
581500
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/581500"
)]
...
...
@@ -519,7 +519,7 @@ class T : A
{
public override int M => throw new NotImplementedException();
}
"
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
));
"
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
));
}
[
WorkItem
(
581500
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/581500"
)]
...
...
@@ -604,7 +604,7 @@ class T : A
{
public override int this[int i] => throw new NotImplementedException();
}
"
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
));
"
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
));
}
[
WorkItem
(
581500
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/581500"
)]
...
...
@@ -717,7 +717,7 @@ class T : A
{
public override int M { set => throw new NotImplementedException(); }
}
"
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
));
"
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
));
}
[
WorkItem
(
581500
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/581500"
)]
...
...
@@ -746,7 +746,7 @@ class T : A
set => throw new NotImplementedException();
}
}
"
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
));
"
,
options
:
Option
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
));
}
}
}
\ No newline at end of file
src/EditorFeatures/CSharpTest/Diagnostics/ImplementInterface/ImplementInterfaceTests.cs
浏览文件 @
798a491a
...
...
@@ -26,34 +26,34 @@ public partial class ImplementInterfaceTests : AbstractCSharpDiagnosticProviderB
private
static
readonly
Dictionary
<
OptionKey
,
object
>
AllOptionsOff
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
}
};
private
static
readonly
Dictionary
<
OptionKey
,
object
>
AllOptionsOn
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
}
};
private
static
readonly
Dictionary
<
OptionKey
,
object
>
AccessorOptionsOn
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
}
};
internal
async
Task
TestWithAllCodeStyleOptionsOffAsync
(
...
...
src/EditorFeatures/CSharpTest/EncapsulateField/EncapsulateFieldTestState.cs
浏览文件 @
798a491a
...
...
@@ -47,8 +47,8 @@ public EncapsulateFieldTestState(TestWorkspace workspace)
public
static
async
Task
<
EncapsulateFieldTestState
>
CreateAsync
(
string
markup
)
{
var
workspace
=
await
TestWorkspace
.
CreateCSharpAsync
(
markup
,
exportProvider
:
s_exportProvider
);
workspace
.
Options
=
workspace
.
Options
.
WithChangedOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
)
.
WithChangedOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
);
workspace
.
Options
=
workspace
.
Options
.
WithChangedOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
)
.
WithChangedOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
);
return
new
EncapsulateFieldTestState
(
workspace
);
}
...
...
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForAccessorsTests.cs
浏览文件 @
798a491a
...
...
@@ -25,23 +25,23 @@ public class UseExpressionBodyForAccessorsTests : AbstractCSharpDiagnosticProvid
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseExpressionBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
}
};
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseExpressionBodyIncludingPropertiesAndIndexers
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
}
};
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseBlockBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
}
};
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsUseExpressionBody
)]
...
...
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForConstructorsTests.cs
浏览文件 @
798a491a
...
...
@@ -25,13 +25,13 @@ public class UseExpressionBodyForConstructorsTests : AbstractCSharpDiagnosticPro
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseExpressionBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
}
};
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseBlockBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
}
};
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsUseExpressionBody
)]
...
...
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForConversionOperatorsTests.cs
浏览文件 @
798a491a
...
...
@@ -25,13 +25,13 @@ public class UseExpressionBodyForConversionOperatorsTests : AbstractCSharpDiagno
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseExpressionBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
}
};
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseBlockBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
}
};
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsUseExpressionBody
)]
...
...
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForIndexerTests.cs
浏览文件 @
798a491a
...
...
@@ -25,23 +25,23 @@ public class UseExpressionBodyForIndexersTests : AbstractCSharpDiagnosticProvide
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseExpressionBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
};
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseBlockBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
}
};
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseBlockBodyExceptAccessor
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
}
};
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsUseExpressionBody
)]
...
...
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForMethodsTests.cs
浏览文件 @
798a491a
...
...
@@ -25,13 +25,13 @@ public class UseExpressionBodyForMethodsTests : AbstractCSharpDiagnosticProvider
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseExpressionBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
}
};
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseBlockBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
}
};
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsUseExpressionBody
)]
...
...
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForOperatorsTests.cs
浏览文件 @
798a491a
...
...
@@ -25,13 +25,13 @@ public class UseExpressionBodyForOperatorsTests : AbstractCSharpDiagnosticProvid
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseExpressionBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
}
};
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseBlockBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
}
};
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsUseExpressionBody
)]
...
...
src/EditorFeatures/CSharpTest/UseExpressionBody/UseExpressionBodyForPropertiesTests.cs
浏览文件 @
798a491a
...
...
@@ -25,23 +25,23 @@ public class UseExpressionBodyForPropertiesTests : AbstractCSharpDiagnosticProvi
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseExpressionBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
};
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseBlockBody
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
}
};
private
static
readonly
Dictionary
<
OptionKey
,
object
>
UseBlockBodyExceptAccessor
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
t
rueWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
T
rueWithNoneEnforcement
}
};
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsUseExpressionBody
)]
...
...
src/EditorFeatures/Test/CodeGeneration/CodeGenerationTests.CSharp.cs
浏览文件 @
798a491a
...
...
@@ -664,8 +664,8 @@ public async Task AddIndexer2()
getStatements
:
"return String.Empty;"
,
isIndexer
:
true
,
options
:
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
});
}
...
...
src/VisualStudio/Core/Test/CodeModel/CSharp/CodeClassTests.vb
浏览文件 @
798a491a
...
...
@@ -2202,8 +2202,8 @@ class C
code
,
expected
,
New
PropertyData
With
{.
GetterName
=
"Name"
,
.
PutterName
=
"Name"
,
.
Type
=
EnvDTE
.
vsCMTypeRef
.
vsCMTypeRefString
},
New
Dictionary
(
Of
OptionKey
,
Object
)
From
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
}
})
End
Function
...
...
@@ -2253,8 +2253,8 @@ class C
Await
TestAddProperty
(
code
,
expected
,
New
PropertyData
With
{.
GetterName
=
"Name"
,
.
PutterName
=
Nothing
,
.
Type
=
EnvDTE
.
vsCMTypeRef
.
vsCMTypeRefString
},
New
Dictionary
(
Of
OptionKey
,
Object
)
From
{
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
f
alseWithNoneEnforcement
}
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
},
{
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CodeStyleOptions
.
F
alseWithNoneEnforcement
}
})
End
Function
...
...
src/Workspaces/CSharp/Portable/CodeStyle/CSharpCodeStyleOptions.cs
浏览文件 @
798a491a
...
...
@@ -20,31 +20,31 @@ internal static class CSharpCodeStyleOptions
public
static
readonly
Option
<
CodeStyleOption
<
bool
>>
UseImplicitTypeWherePossible
=
new
Option
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
UseImplicitTypeWherePossible
),
defaultValue
:
CodeStyleOption
<
bool
>.
Default
,
storageLocations
:
new
RoamingProfileStorageLocation
(
"TextEditor.CSharp.Specific.UseImplicitTypeWherePossible"
));
public
static
readonly
Option
<
CodeStyleOption
<
bool
>>
PreferConditionalDelegateCall
=
new
Option
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferConditionalDelegateCall
),
defaultValue
:
CodeStyleOptions
.
t
rueWithSuggestionEnforcement
,
public
static
readonly
Option
<
CodeStyleOption
<
bool
>>
PreferConditionalDelegateCall
=
new
Option
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferConditionalDelegateCall
),
defaultValue
:
CodeStyleOptions
.
T
rueWithSuggestionEnforcement
,
storageLocations
:
new
RoamingProfileStorageLocation
(
"TextEditor.CSharp.Specific.PreferConditionalDelegateCall"
));
public
static
readonly
Option
<
CodeStyleOption
<
bool
>>
PreferExpressionBodiedConstructors
=
new
Option
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferExpressionBodiedConstructors
),
defaultValue
:
CodeStyleOptions
.
f
alseWithNoneEnforcement
,
nameof
(
CodeStyleOptions
),
nameof
(
PreferExpressionBodiedConstructors
),
defaultValue
:
CodeStyleOptions
.
F
alseWithNoneEnforcement
,
storageLocations
:
new
RoamingProfileStorageLocation
(
$"TextEditor.CSharp.Specific.
{
nameof
(
PreferExpressionBodiedConstructors
)}
"
));
public
static
readonly
Option
<
CodeStyleOption
<
bool
>>
PreferExpressionBodiedMethods
=
new
Option
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferExpressionBodiedMethods
),
defaultValue
:
CodeStyleOptions
.
f
alseWithNoneEnforcement
,
nameof
(
CodeStyleOptions
),
nameof
(
PreferExpressionBodiedMethods
),
defaultValue
:
CodeStyleOptions
.
F
alseWithNoneEnforcement
,
storageLocations
:
new
RoamingProfileStorageLocation
(
$"TextEditor.CSharp.Specific.
{
nameof
(
PreferExpressionBodiedMethods
)}
"
));
public
static
readonly
Option
<
CodeStyleOption
<
bool
>>
PreferExpressionBodiedOperators
=
new
Option
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferExpressionBodiedOperators
),
defaultValue
:
CodeStyleOptions
.
f
alseWithNoneEnforcement
,
nameof
(
CodeStyleOptions
),
nameof
(
PreferExpressionBodiedOperators
),
defaultValue
:
CodeStyleOptions
.
F
alseWithNoneEnforcement
,
storageLocations
:
new
RoamingProfileStorageLocation
(
$"TextEditor.CSharp.Specific.
{
nameof
(
PreferExpressionBodiedOperators
)}
"
));
public
static
readonly
Option
<
CodeStyleOption
<
bool
>>
PreferExpressionBodiedProperties
=
new
Option
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferExpressionBodiedProperties
),
defaultValue
:
CodeStyleOptions
.
t
rueWithNoneEnforcement
,
nameof
(
CodeStyleOptions
),
nameof
(
PreferExpressionBodiedProperties
),
defaultValue
:
CodeStyleOptions
.
T
rueWithNoneEnforcement
,
storageLocations
:
new
RoamingProfileStorageLocation
(
$"TextEditor.CSharp.Specific.
{
nameof
(
PreferExpressionBodiedProperties
)}
"
));
public
static
readonly
Option
<
CodeStyleOption
<
bool
>>
PreferExpressionBodiedIndexers
=
new
Option
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferExpressionBodiedIndexers
),
defaultValue
:
CodeStyleOptions
.
t
rueWithNoneEnforcement
,
nameof
(
CodeStyleOptions
),
nameof
(
PreferExpressionBodiedIndexers
),
defaultValue
:
CodeStyleOptions
.
T
rueWithNoneEnforcement
,
storageLocations
:
new
RoamingProfileStorageLocation
(
$"TextEditor.CSharp.Specific.
{
nameof
(
PreferExpressionBodiedIndexers
)}
"
));
public
static
readonly
Option
<
CodeStyleOption
<
bool
>>
PreferExpressionBodiedAccessors
=
new
Option
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferExpressionBodiedAccessors
),
defaultValue
:
CodeStyleOptions
.
t
rueWithNoneEnforcement
,
nameof
(
CodeStyleOptions
),
nameof
(
PreferExpressionBodiedAccessors
),
defaultValue
:
CodeStyleOptions
.
T
rueWithNoneEnforcement
,
storageLocations
:
new
RoamingProfileStorageLocation
(
$"TextEditor.CSharp.Specific.
{
nameof
(
PreferExpressionBodiedAccessors
)}
"
));
}
}
\ No newline at end of file
src/Workspaces/Core/Portable/CodeStyle/CodeStyleOptions.cs
浏览文件 @
798a491a
...
...
@@ -11,9 +11,9 @@ public class CodeStyleOptions
/// One such default(s), is that the feature is turned on, so that codegen consumes it,
/// but with none enforcement, so that the user is not prompted about their usage.
/// </remarks>
internal
static
readonly
CodeStyleOption
<
bool
>
t
rueWithNoneEnforcement
=
new
CodeStyleOption
<
bool
>(
value
:
true
,
notification
:
NotificationOption
.
None
);
internal
static
readonly
CodeStyleOption
<
bool
>
t
rueWithSuggestionEnforcement
=
new
CodeStyleOption
<
bool
>(
value
:
true
,
notification
:
NotificationOption
.
Suggestion
);
internal
static
readonly
CodeStyleOption
<
bool
>
f
alseWithNoneEnforcement
=
new
CodeStyleOption
<
bool
>(
value
:
false
,
notification
:
NotificationOption
.
None
);
internal
static
readonly
CodeStyleOption
<
bool
>
T
rueWithNoneEnforcement
=
new
CodeStyleOption
<
bool
>(
value
:
true
,
notification
:
NotificationOption
.
None
);
internal
static
readonly
CodeStyleOption
<
bool
>
T
rueWithSuggestionEnforcement
=
new
CodeStyleOption
<
bool
>(
value
:
true
,
notification
:
NotificationOption
.
Suggestion
);
internal
static
readonly
CodeStyleOption
<
bool
>
F
alseWithNoneEnforcement
=
new
CodeStyleOption
<
bool
>(
value
:
false
,
notification
:
NotificationOption
.
None
);
/// <summary>
/// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in field access expressions.
...
...
@@ -42,25 +42,25 @@ public class CodeStyleOptions
/// <summary>
/// This option says if we should prefer keyword for Intrinsic Predefined Types in Declarations
/// </summary>
public
static
readonly
PerLanguageOption
<
CodeStyleOption
<
bool
>>
PreferIntrinsicPredefinedTypeKeywordInDeclaration
=
new
PerLanguageOption
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferIntrinsicPredefinedTypeKeywordInDeclaration
),
defaultValue
:
t
rueWithNoneEnforcement
,
public
static
readonly
PerLanguageOption
<
CodeStyleOption
<
bool
>>
PreferIntrinsicPredefinedTypeKeywordInDeclaration
=
new
PerLanguageOption
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferIntrinsicPredefinedTypeKeywordInDeclaration
),
defaultValue
:
T
rueWithNoneEnforcement
,
storageLocations
:
new
RoamingProfileStorageLocation
(
"TextEditor.%LANGUAGE%.Specific.PreferIntrinsicPredefinedTypeKeywordInDeclaration"
));
/// <summary>
/// This option says if we should prefer keyword for Intrinsic Predefined Types in Member Access Expression
/// </summary>
public
static
readonly
PerLanguageOption
<
CodeStyleOption
<
bool
>>
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
=
new
PerLanguageOption
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
),
defaultValue
:
t
rueWithNoneEnforcement
,
public
static
readonly
PerLanguageOption
<
CodeStyleOption
<
bool
>>
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
=
new
PerLanguageOption
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
),
defaultValue
:
T
rueWithNoneEnforcement
,
storageLocations
:
new
RoamingProfileStorageLocation
(
"TextEditor.%LANGUAGE%.Specific.PreferIntrinsicPredefinedTypeKeywordInMemberAccess"
));
internal
static
readonly
PerLanguageOption
<
CodeStyleOption
<
bool
>>
PreferThrowExpression
=
new
PerLanguageOption
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferThrowExpression
),
defaultValue
:
t
rueWithSuggestionEnforcement
,
defaultValue
:
T
rueWithSuggestionEnforcement
,
storageLocations
:
new
RoamingProfileStorageLocation
(
"TextEditor.%LANGUAGE%.Specific.PreferThrowExpression"
));
internal
static
readonly
PerLanguageOption
<
CodeStyleOption
<
bool
>>
PreferObjectInitializer
=
new
PerLanguageOption
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferObjectInitializer
),
defaultValue
:
t
rueWithSuggestionEnforcement
,
defaultValue
:
T
rueWithSuggestionEnforcement
,
storageLocations
:
new
RoamingProfileStorageLocation
(
"TextEditor.%LANGUAGE%.Specific.PreferObjectInitializer"
));
internal
static
readonly
PerLanguageOption
<
bool
>
PreferObjectInitializer_FadeOutCode
=
new
PerLanguageOption
<
bool
>(
...
...
@@ -72,7 +72,7 @@ public class CodeStyleOptions
internal
static
readonly
PerLanguageOption
<
CodeStyleOption
<
bool
>>
PreferInlinedVariableDeclaration
=
new
PerLanguageOption
<
CodeStyleOption
<
bool
>>(
nameof
(
CodeStyleOptions
),
nameof
(
PreferInlinedVariableDeclaration
),
defaultValue
:
t
rueWithSuggestionEnforcement
,
defaultValue
:
T
rueWithSuggestionEnforcement
,
storageLocations
:
new
RoamingProfileStorageLocation
(
"TextEditor.%LANGUAGE%.Specific.PreferInlinedVariableDeclaration"
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录