Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
2bf2eae7
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,体验更适合开发者的 AI 搜索 >>
提交
2bf2eae7
编写于
11月 16, 2016
作者:
C
CyrusNajmabadi
提交者:
GitHub
11月 16, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15304 from CyrusNajmabadi/testOptions
Simplify API for tests to create options.
上级
3fff9403
1610c1bc
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
157 addition
and
154 deletion
+157
-154
src/EditorFeatures/CSharpTest/CodeActions/EncapsulateField/EncapsulateFieldTests.cs
...est/CodeActions/EncapsulateField/EncapsulateFieldTests.cs
+2
-2
src/EditorFeatures/CSharpTest/CodeActions/IntroduceVariable/IntroduceVariableTests.cs
...t/CodeActions/IntroduceVariable/IntroduceVariableTests.cs
+4
-3
src/EditorFeatures/CSharpTest/Diagnostics/GenerateVariable/GenerateVariableTests.cs
...est/Diagnostics/GenerateVariable/GenerateVariableTests.cs
+4
-4
src/EditorFeatures/CSharpTest/Diagnostics/ImplementAbstractClass/ImplementAbstractClassTests.cs
...ics/ImplementAbstractClass/ImplementAbstractClassTests.cs
+10
-10
src/EditorFeatures/CSharpTest/Diagnostics/PreferFrameworkType/PreferFrameworkTypeTests.cs
...agnostics/PreferFrameworkType/PreferFrameworkTypeTests.cs
+12
-12
src/EditorFeatures/CSharpTest/Diagnostics/SimplifyTypeNames/SimplifyTypeNamesTests.cs
...t/Diagnostics/SimplifyTypeNames/SimplifyTypeNamesTests.cs
+9
-9
src/EditorFeatures/CSharpTest/Diagnostics/SimplifyTypeNames/SimplifyTypeNamesTests_FixAllTests.cs
...s/SimplifyTypeNames/SimplifyTypeNamesTests_FixAllTests.cs
+3
-2
src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseExplicitTypeTests.cs
...nostics/UseImplicitOrExplicitType/UseExplicitTypeTests.cs
+24
-24
src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseImplicitTypeTests.cs
...nostics/UseImplicitOrExplicitType/UseImplicitTypeTests.cs
+29
-29
src/EditorFeatures/CSharpTest/InlineDeclaration/CSharpInlineDeclarationTests.cs
...arpTest/InlineDeclaration/CSharpInlineDeclarationTests.cs
+5
-5
src/EditorFeatures/TestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
...ies/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
+31
-13
src/EditorFeatures/TestUtilities/OptionExtensions.cs
src/EditorFeatures/TestUtilities/OptionExtensions.cs
+0
-23
src/EditorFeatures/TestUtilities/ServicesTestUtilities.csproj
...EditorFeatures/TestUtilities/ServicesTestUtilities.csproj
+0
-1
src/EditorFeatures/VisualBasicTest/Diagnostics/PreferFrameworkType/PreferFrameworkTypeTests.vb
...agnostics/PreferFrameworkType/PreferFrameworkTypeTests.vb
+12
-8
src/EditorFeatures/VisualBasicTest/Diagnostics/SimplifyTypeNames/SimplifyTypeNamesTests.vb
...t/Diagnostics/SimplifyTypeNames/SimplifyTypeNamesTests.vb
+10
-7
src/EditorFeatures/VisualBasicTest/Diagnostics/SimplifyTypeNames/SimplifyTypeNamesTests_FixAllTests.vb
...s/SimplifyTypeNames/SimplifyTypeNamesTests_FixAllTests.vb
+2
-2
未找到文件。
src/EditorFeatures/CSharpTest/CodeActions/EncapsulateField/EncapsulateFieldTests.cs
浏览文件 @
2bf2eae7
...
...
@@ -170,8 +170,8 @@ void baz()
"
;
await
TestAsync
(
text
,
expected
,
options
:
OptionsSet
(
Tuple
.
Create
((
IOption
)
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
true
,
NotificationOption
.
None
),
Tuple
.
Create
((
IOption
)
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
false
,
NotificationOption
.
None
)));
SingleOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
true
,
NotificationOption
.
None
),
SingleOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
false
,
NotificationOption
.
None
)));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
EncapsulateField
)]
...
...
src/EditorFeatures/CSharpTest/CodeActions/IntroduceVariable/IntroduceVariableTests.cs
浏览文件 @
2bf2eae7
...
...
@@ -24,9 +24,10 @@ protected override CodeRefactoringProvider CreateCodeRefactoringProvider(Workspa
// specify all options explicitly to override defaults.
private
IDictionary
<
OptionKey
,
object
>
ImplicitTypingEverywhere
()
=>
OptionSet
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
onWithInfo
);
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
onWithInfo
));
internal
IDictionary
<
OptionKey
,
object
>
OptionSet
(
OptionKey
option
,
object
value
)
{
...
...
src/EditorFeatures/CSharpTest/Diagnostics/GenerateVariable/GenerateVariableTests.cs
浏览文件 @
2bf2eae7
...
...
@@ -28,10 +28,10 @@ public class GenerateVariableTests : AbstractCSharpDiagnosticProviderBasedUserDi
private
readonly
CodeStyleOption
<
bool
>
onWithInfo
=
new
CodeStyleOption
<
bool
>(
true
,
NotificationOption
.
Suggestion
);
// specify all options explicitly to override defaults.
private
IDictionary
<
OptionKey
,
object
>
ImplicitTypingEverywhere
()
=>
OptionSet
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
onWithInfo
);
private
IDictionary
<
OptionKey
,
object
>
ImplicitTypingEverywhere
()
=>
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
onWithInfo
)
);
internal
IDictionary
<
OptionKey
,
object
>
OptionSet
(
OptionKey
option
,
object
value
)
{
...
...
src/EditorFeatures/CSharpTest/Diagnostics/ImplementAbstractClass/ImplementAbstractClassTests.cs
浏览文件 @
2bf2eae7
...
...
@@ -1257,8 +1257,8 @@ public override int M
}
}
}"
,
options
:
OptionsSet
(
Tuple
.
Create
((
IOption
)
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
true
,
NotificationOption
.
None
),
Tuple
.
Create
((
IOption
)
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
false
,
NotificationOption
.
None
)));
SingleOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
true
,
NotificationOption
.
None
),
SingleOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
false
,
NotificationOption
.
None
)));
}
[
WorkItem
(
581500
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/581500"
)]
...
...
@@ -1296,8 +1296,8 @@ public override int M
}
}
}"
,
options
:
OptionsSet
(
Tuple
.
Create
((
IOption
)
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
true
,
NotificationOption
.
None
),
Tuple
.
Create
((
IOption
)
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
false
,
NotificationOption
.
None
)));
SingleOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
true
,
NotificationOption
.
None
),
SingleOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
false
,
NotificationOption
.
None
)));
}
[
WorkItem
(
581500
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/581500"
)]
...
...
@@ -1356,8 +1356,8 @@ class T : A
}
}
}"
,
options
:
OptionsSet
(
Tuple
.
Create
((
IOption
)
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
true
,
NotificationOption
.
None
),
Tuple
.
Create
((
IOption
)
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
false
,
NotificationOption
.
None
)));
SingleOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
true
,
NotificationOption
.
None
),
SingleOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
false
,
NotificationOption
.
None
)));
}
[
WorkItem
(
581500
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/581500"
)]
...
...
@@ -1395,8 +1395,8 @@ class T : A
}
}
}"
,
options
:
OptionsSet
(
Tuple
.
Create
((
IOption
)
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
true
,
NotificationOption
.
None
),
Tuple
.
Create
((
IOption
)
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
false
,
NotificationOption
.
None
)));
SingleOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
true
,
NotificationOption
.
None
),
SingleOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
false
,
NotificationOption
.
None
)));
}
[
WorkItem
(
581500
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/581500"
)]
...
...
@@ -1426,8 +1426,8 @@ public override int M
get => throw new NotImplementedException();
}
}"
,
options
:
OptionsSet
(
Tuple
.
Create
((
IOption
)
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
false
,
NotificationOption
.
None
),
Tuple
.
Create
((
IOption
)
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
true
,
NotificationOption
.
None
)));
SingleOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
false
,
NotificationOption
.
None
),
SingleOption
(
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
true
,
NotificationOption
.
None
)));
}
[
WorkItem
(
581500
,
"http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/581500"
)]
...
...
src/EditorFeatures/CSharpTest/Diagnostics/PreferFrameworkType/PreferFrameworkTypeTests.cs
浏览文件 @
2bf2eae7
...
...
@@ -24,21 +24,21 @@ public partial class PreferFrameworkTypeTests : AbstractCSharpDiagnosticProvider
private
readonly
CodeStyleOption
<
bool
>
onWithInfo
=
new
CodeStyleOption
<
bool
>(
true
,
NotificationOption
.
Suggestion
);
private
readonly
CodeStyleOption
<
bool
>
offWithInfo
=
new
CodeStyleOption
<
bool
>(
false
,
NotificationOption
.
Suggestion
);
private
IDictionary
<
OptionKey
,
object
>
NoFrameworkType
=>
Option
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
true
,
NotificationOption
.
Suggestion
)
.
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
onWithInfo
,
GetLanguage
(
));
private
IDictionary
<
OptionKey
,
object
>
NoFrameworkType
=>
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
true
,
NotificationOption
.
Suggestion
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
onWithInfo
,
GetLanguage
()
));
private
IDictionary
<
OptionKey
,
object
>
FrameworkTypeEverywhere
=>
Option
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
false
,
NotificationOption
.
Suggestion
)
.
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
offWithInfo
,
GetLanguage
(
));
private
IDictionary
<
OptionKey
,
object
>
FrameworkTypeEverywhere
=>
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
false
,
NotificationOption
.
Suggestion
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
offWithInfo
,
GetLanguage
()
));
private
IDictionary
<
OptionKey
,
object
>
FrameworkTypeInDeclaration
=>
Option
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
false
,
NotificationOption
.
Suggestion
)
.
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
onWithInfo
,
GetLanguage
(
));
private
IDictionary
<
OptionKey
,
object
>
FrameworkTypeInDeclaration
=>
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
false
,
NotificationOption
.
Suggestion
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
onWithInfo
,
GetLanguage
()
));
private
IDictionary
<
OptionKey
,
object
>
FrameworkTypeInMemberAccess
=>
Option
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
true
,
NotificationOption
.
Suggestion
)
.
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
offWithInfo
,
GetLanguage
(
));
private
IDictionary
<
OptionKey
,
object
>
FrameworkTypeInMemberAccess
=>
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
true
,
NotificationOption
.
Suggestion
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
offWithInfo
,
GetLanguage
()
));
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsUseFrameworkType
)]
public
async
Task
NotWhenOptionsAreNotSet
()
...
...
src/EditorFeatures/CSharpTest/Diagnostics/SimplifyTypeNames/SimplifyTypeNamesTests.cs
浏览文件 @
2bf2eae7
...
...
@@ -3770,17 +3770,17 @@ private async Task TestWithPredefinedTypeOptionsAsync(string code, string expect
await
TestAsync
(
code
,
expected
,
index
,
options
:
PreferIntrinsicTypeEverywhere
);
}
private
IDictionary
<
OptionKey
,
object
>
PreferIntrinsicTypeEverywhere
=>
Option
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
true
,
NotificationOption
.
Error
)
.
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
this
.
onWithError
,
GetLanguage
(
));
private
IDictionary
<
OptionKey
,
object
>
PreferIntrinsicTypeEverywhere
=>
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
true
,
NotificationOption
.
Error
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
this
.
onWithError
,
GetLanguage
()
));
private
IDictionary
<
OptionKey
,
object
>
PreferIntrinsicTypeInDeclaration
=>
Option
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
true
,
NotificationOption
.
Error
)
.
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
this
.
offWithNone
,
GetLanguage
(
));
private
IDictionary
<
OptionKey
,
object
>
PreferIntrinsicTypeInDeclaration
=>
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
true
,
NotificationOption
.
Error
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
this
.
offWithNone
,
GetLanguage
()
));
private
IDictionary
<
OptionKey
,
object
>
PreferIntrinsicTypeInMemberAccess
=>
Option
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
true
,
NotificationOption
.
Error
)
.
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
this
.
offWithNone
,
GetLanguage
(
));
private
IDictionary
<
OptionKey
,
object
>
PreferIntrinsicTypeInMemberAccess
=>
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
true
,
NotificationOption
.
Error
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
this
.
offWithNone
,
GetLanguage
()
));
private
readonly
CodeStyleOption
<
bool
>
onWithNone
=
new
CodeStyleOption
<
bool
>(
true
,
NotificationOption
.
None
);
private
readonly
CodeStyleOption
<
bool
>
offWithNone
=
new
CodeStyleOption
<
bool
>(
false
,
NotificationOption
.
None
);
...
...
src/EditorFeatures/CSharpTest/Diagnostics/SimplifyTypeNames/SimplifyTypeNamesTests_FixAllTests.cs
浏览文件 @
2bf2eae7
...
...
@@ -932,8 +932,9 @@ void N()
</Workspace>"
;
var
options
=
OptionsSet
(
Tuple
.
Create
((
IOption
)
CodeStyleOptions
.
QualifyPropertyAccess
,
false
,
NotificationOption
.
Suggestion
),
Tuple
.
Create
((
IOption
)
CodeStyleOptions
.
QualifyFieldAccess
,
true
,
NotificationOption
.
Suggestion
));
SingleOption
(
CodeStyleOptions
.
QualifyPropertyAccess
,
false
,
NotificationOption
.
Suggestion
),
SingleOption
(
CodeStyleOptions
.
QualifyFieldAccess
,
true
,
NotificationOption
.
Suggestion
));
await
TestAsync
(
initialMarkup
:
input
,
expectedMarkup
:
expected
,
...
...
src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseExplicitTypeTests.cs
浏览文件 @
2bf2eae7
...
...
@@ -34,30 +34,30 @@ public partial class UseExplicitTypeTests : AbstractCSharpDiagnosticProviderBase
private
readonly
CodeStyleOption
<
bool
>
offWithError
=
new
CodeStyleOption
<
bool
>(
false
,
NotificationOption
.
Error
);
// specify all options explicitly to override defaults.
private
IDictionary
<
OptionKey
,
object
>
ExplicitTypeEverywhere
()
=>
Options
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
offWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
offWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithInfo
);
private
IDictionary
<
OptionKey
,
object
>
ExplicitTypeExceptWhereApparent
()
=>
Options
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
offWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithInfo
);
private
IDictionary
<
OptionKey
,
object
>
ExplicitTypeForBuiltInTypesOnly
()
=>
Options
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithInfo
);
private
IDictionary
<
OptionKey
,
object
>
ExplicitTypeEnforcements
()
=>
Options
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
offWithWarning
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
offWithError
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithInfo
);
private
IDictionary
<
OptionKey
,
object
>
ExplicitTypeNoneEnforcement
()
=>
Options
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
offWithNone
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
offWithNone
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithNone
);
private
IDictionary
<
OptionKey
,
object
>
ExplicitTypeEverywhere
()
=>
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
offWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
offWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithInfo
)
);
private
IDictionary
<
OptionKey
,
object
>
ExplicitTypeExceptWhereApparent
()
=>
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
offWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithInfo
)
);
private
IDictionary
<
OptionKey
,
object
>
ExplicitTypeForBuiltInTypesOnly
()
=>
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithInfo
)
);
private
IDictionary
<
OptionKey
,
object
>
ExplicitTypeEnforcements
()
=>
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
offWithWarning
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
offWithError
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithInfo
)
);
private
IDictionary
<
OptionKey
,
object
>
ExplicitTypeNoneEnforcement
()
=>
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
offWithNone
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
offWithNone
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithNone
)
);
private
IDictionary
<
OptionKey
,
object
>
Options
(
OptionKey
option
,
object
value
)
{
...
...
src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseImplicitTypeTests.cs
浏览文件 @
2bf2eae7
...
...
@@ -34,35 +34,35 @@ public partial class UseImplicitTypeTests : AbstractCSharpDiagnosticProviderBase
private
static
readonly
CodeStyleOption
<
bool
>
offWithError
=
new
CodeStyleOption
<
bool
>(
false
,
NotificationOption
.
Error
);
// specify all options explicitly to override defaults.
public
static
IDictionary
<
OptionKey
,
object
>
ImplicitTypeEverywhere
()
=>
Options
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
onWithInfo
);
private
IDictionary
<
OptionKey
,
object
>
ImplicitTypeWhereApparent
()
=>
Options
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
offWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithInfo
);
private
IDictionary
<
OptionKey
,
object
>
ImplicitTypeWhereApparentAndForIntrinsics
()
=>
Options
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
offWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
onWithInfo
);
public
static
IDictionary
<
OptionKey
,
object
>
ImplicitTypeButKeepIntrinsics
()
=>
Options
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithInfo
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
);
private
IDictionary
<
OptionKey
,
object
>
ImplicitTypeEnforcements
()
=>
Options
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithWarning
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithError
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
onWithInfo
);
private
IDictionary
<
OptionKey
,
object
>
ImplicitTypeNoneEnforcement
()
=>
Options
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithNone
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithNone
)
.
With
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
onWithNone
);
public
IDictionary
<
OptionKey
,
object
>
ImplicitTypeEverywhere
()
=>
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
onWithInfo
)
);
private
IDictionary
<
OptionKey
,
object
>
ImplicitTypeWhereApparent
()
=>
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
offWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithInfo
)
);
private
IDictionary
<
OptionKey
,
object
>
ImplicitTypeWhereApparentAndForIntrinsics
()
=>
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
offWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
onWithInfo
)
);
public
IDictionary
<
OptionKey
,
object
>
ImplicitTypeButKeepIntrinsics
()
=>
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
offWithInfo
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithInfo
)
);
private
IDictionary
<
OptionKey
,
object
>
ImplicitTypeEnforcements
()
=>
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithWarning
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithError
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
onWithInfo
)
);
private
IDictionary
<
OptionKey
,
object
>
ImplicitTypeNoneEnforcement
()
=>
OptionsSet
(
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWherePossible
,
onWithNone
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeWhereApparent
,
onWithNone
),
SingleOption
(
CSharpCodeStyleOptions
.
UseImplicitTypeForIntrinsicTypes
,
onWithNone
)
);
private
static
IDictionary
<
OptionKey
,
object
>
Options
(
OptionKey
option
,
object
value
)
{
...
...
src/EditorFeatures/CSharpTest/InlineDeclaration/CSharpInlineDeclarationTests.cs
浏览文件 @
2bf2eae7
...
...
@@ -209,7 +209,7 @@ void M(string v)
{
}
}
}"
,
options
:
UseImplicitTypeTests
.
ImplicitTypeEverywhere
());
}"
,
options
:
new
UseImplicitTypeTests
()
.
ImplicitTypeEverywhere
());
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsInlineDeclaration
)]
...
...
@@ -234,7 +234,7 @@ void M(string v)
{
}
}
}"
,
options
:
UseImplicitTypeTests
.
ImplicitTypeButKeepIntrinsics
());
}"
,
options
:
new
UseImplicitTypeTests
()
.
ImplicitTypeButKeepIntrinsics
());
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsInlineDeclaration
)]
...
...
@@ -568,7 +568,7 @@ void M2(out int i)
void M2(out string s)
{
}
}"
,
options
:
UseImplicitTypeTests
.
ImplicitTypeEverywhere
());
}"
,
options
:
new
UseImplicitTypeTests
()
.
ImplicitTypeEverywhere
());
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsInlineDeclaration
)]
...
...
@@ -609,7 +609,7 @@ void M2(out int i)
void M2(out string s)
{
}
}"
,
options
:
UseImplicitTypeTests
.
ImplicitTypeEverywhere
());
}"
,
options
:
new
UseImplicitTypeTests
()
.
ImplicitTypeEverywhere
());
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsInlineDeclaration
)]
...
...
@@ -642,7 +642,7 @@ void M()
void M2<T>(out T i)
{
}
}"
,
options
:
UseImplicitTypeTests
.
ImplicitTypeEverywhere
());
}"
,
options
:
new
UseImplicitTypeTests
()
.
ImplicitTypeEverywhere
());
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsInlineDeclaration
)]
...
...
src/EditorFeatures/TestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
浏览文件 @
2bf2eae7
...
...
@@ -534,25 +534,43 @@ protected static IList<CodeAction> FlattenActions(IEnumerable<CodeAction> codeAc
:
new
[]
{
a
}).
ToList
();
}
protected
IDictionary
<
OptionKey
,
object
>
Option
(
IOption
option
,
CodeStyleOption
<
bool
>
notification
)
=>
Option
(
option
,
notification
.
Value
,
notification
.
Notification
);
protected
(
OptionKey
,
object
)
SingleOption
(
Option
<
CodeStyleOption
<
bool
>>
option
,
bool
enabled
,
NotificationOption
notification
)
=>
SingleOption
(
option
,
new
CodeStyleOption
<
bool
>(
enabled
,
notification
)
);
protected
IDictionary
<
OptionKey
,
object
>
Option
(
IOption
option
,
bool
value
,
NotificationOption
notification
)
=>
OptionsSet
(
Tuple
.
Create
(
option
,
value
,
notification
)
);
protected
(
OptionKey
,
object
)
SingleOption
(
Option
<
CodeStyleOption
<
bool
>>
option
,
CodeStyleOption
<
bool
>
codeStyle
)
=>
(
new
OptionKey
(
option
),
codeStyle
);
protected
IDictionary
<
OptionKey
,
object
>
OptionsSet
(
params
Tuple
<
IOption
,
bool
,
NotificationOption
>[]
optionsToSet
)
protected
(
OptionKey
,
object
)
SingleOption
(
PerLanguageOption
<
CodeStyleOption
<
bool
>>
option
,
bool
enabled
,
NotificationOption
notification
)
=>
SingleOption
(
option
,
new
CodeStyleOption
<
bool
>(
enabled
,
notification
));
protected
(
OptionKey
,
object
)
SingleOption
(
PerLanguageOption
<
CodeStyleOption
<
bool
>>
option
,
CodeStyleOption
<
bool
>
codeStyle
)
=>
SingleOption
(
option
,
codeStyle
,
language
:
GetLanguage
());
protected
static
(
OptionKey
,
object
)
SingleOption
(
PerLanguageOption
<
CodeStyleOption
<
bool
>>
option
,
CodeStyleOption
<
bool
>
codeStyle
,
string
language
)
=>
(
new
OptionKey
(
option
,
language
),
codeStyle
);
protected
IDictionary
<
OptionKey
,
object
>
Option
(
Option
<
CodeStyleOption
<
bool
>>
option
,
bool
enabled
,
NotificationOption
notification
)
=>
OptionsSet
(
SingleOption
(
option
,
enabled
,
notification
));
protected
IDictionary
<
OptionKey
,
object
>
Option
(
Option
<
CodeStyleOption
<
bool
>>
option
,
CodeStyleOption
<
bool
>
codeStyle
)
=>
OptionsSet
(
SingleOption
(
option
,
codeStyle
));
protected
IDictionary
<
OptionKey
,
object
>
Option
(
PerLanguageOption
<
CodeStyleOption
<
bool
>>
option
,
bool
enabled
,
NotificationOption
notification
)
=>
OptionsSet
(
SingleOption
(
option
,
enabled
,
notification
));
protected
IDictionary
<
OptionKey
,
object
>
Option
(
PerLanguageOption
<
CodeStyleOption
<
bool
>>
option
,
CodeStyleOption
<
bool
>
codeStyle
)
=>
OptionsSet
(
SingleOption
(
option
,
codeStyle
));
protected
static
IDictionary
<
OptionKey
,
object
>
OptionsSet
(
params
(
OptionKey
key
,
object
value
)[]
options
)
{
var
options
=
new
Dictionary
<
OptionKey
,
object
>();
foreach
(
var
triple
in
optionsToSet
)
var
result
=
new
Dictionary
<
OptionKey
,
object
>();
foreach
(
var
option
in
options
)
{
var
option
=
triple
.
Item1
;
var
value
=
triple
.
Item2
;
var
notification
=
triple
.
Item3
;
var
optionKey
=
new
OptionKey
(
option
,
option
.
IsPerLanguage
?
GetLanguage
()
:
null
);
options
.
Add
(
optionKey
,
new
CodeStyleOption
<
bool
>(
value
,
notification
));
result
.
Add
(
option
.
key
,
option
.
value
);
}
return
options
;
return
result
;
}
}
}
\ No newline at end of file
src/EditorFeatures/TestUtilities/OptionExtensions.cs
已删除
100644 → 0
浏览文件 @
3fff9403
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using
System.Collections.Generic
;
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.Options
;
namespace
Microsoft.CodeAnalysis.Editor.UnitTests
{
internal
static
class
OptionExtensions
{
internal
static
IDictionary
<
OptionKey
,
object
>
With
(
this
IDictionary
<
OptionKey
,
object
>
options
,
OptionKey
option
,
object
value
)
{
options
.
Add
(
option
,
value
);
return
options
;
}
internal
static
IDictionary
<
OptionKey
,
object
>
With
(
this
IDictionary
<
OptionKey
,
object
>
options
,
PerLanguageOption
<
CodeStyleOption
<
bool
>>
option
,
object
value
,
string
language
)
{
options
.
Add
(
new
OptionKey
(
option
,
language
),
value
);
return
options
;
}
}
}
src/EditorFeatures/TestUtilities/ServicesTestUtilities.csproj
浏览文件 @
2bf2eae7
...
...
@@ -199,7 +199,6 @@
<Compile
Include=
"NavigateTo\AbstractNavigateToTests.cs"
/>
<Compile
Include=
"NavigateTo\NavigateToTestAggregator.Callback.cs"
/>
<Compile
Include=
"NavigateTo\NavigateToTestAggregator.cs"
/>
<Compile
Include=
"OptionExtensions.cs"
/>
<Compile
Include=
"Preview\MockPreviewPaneService.cs"
/>
<Compile
Include=
"QuickInfo\AbstractQuickInfoSourceTests.cs"
/>
<Compile
Include=
"QuickInfo\AbstractSemanticQuickInfoSourceTests.cs"
/>
...
...
src/EditorFeatures/VisualBasicTest/Diagnostics/PreferFrameworkType/PreferFrameworkTypeTests.vb
浏览文件 @
2bf2eae7
...
...
@@ -23,29 +23,33 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Diagnostics.Prefer
Private
ReadOnly
Property
NoFrameworkType
As
IDictionary
(
Of
OptionKey
,
Object
)
Get
Return
[
Option
]
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
True
,
NotificationOption
.
Suggestion
).
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
Me
.
onWithInfo
,
GetLanguage
())
Return
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
True
,
NotificationOption
.
Suggestion
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
Me
.
onWithInfo
,
GetLanguage
()))
End
Get
End
Property
Private
ReadOnly
Property
FrameworkTypeEverywhere
As
IDictionary
(
Of
OptionKey
,
Object
)
Get
Return
[
Option
]
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
False
,
NotificationOption
.
Suggestion
).
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
Me
.
offWithInfo
,
GetLanguage
())
Return
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
False
,
NotificationOption
.
Suggestion
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
Me
.
offWithInfo
,
GetLanguage
()))
End
Get
End
Property
Private
ReadOnly
Property
FrameworkTypeInDeclaration
As
IDictionary
(
Of
OptionKey
,
Object
)
Get
Return
[
Option
]
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
False
,
NotificationOption
.
Suggestion
).
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
Me
.
onWithInfo
,
GetLanguage
())
Return
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
False
,
NotificationOption
.
Suggestion
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
Me
.
onWithInfo
,
GetLanguage
()))
End
Get
End
Property
Private
ReadOnly
Property
FrameworkTypeInMemberAccess
As
IDictionary
(
Of
OptionKey
,
Object
)
Get
Return
[
Option
]
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
False
,
NotificationOption
.
Suggestion
).
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
Me
.
onWithInfo
,
GetLanguage
())
Return
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
False
,
NotificationOption
.
Suggestion
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
Me
.
onWithInfo
,
GetLanguage
()))
End
Get
End
Property
...
...
src/EditorFeatures/VisualBasicTest/Diagnostics/SimplifyTypeNames/SimplifyTypeNamesTests.vb
浏览文件 @
2bf2eae7
...
...
@@ -23,22 +23,25 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Diagnostics.Simpli
Private
Function
PreferIntrinsicPredefinedTypeEverywhere
()
As
IDictionary
(
Of
OptionKey
,
Object
)
Dim
language
=
GetLanguage
()
Return
[
Option
]
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
True
,
NotificationOption
.
Error
).
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
Me
.
onWithError
,
language
)
Return
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
True
,
NotificationOption
.
Error
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
Me
.
onWithError
,
language
))
End
Function
Private
Function
PreferIntrinsicPredefinedTypeInDeclaration
()
As
IDictionary
(
Of
OptionKey
,
Object
)
Dim
language
=
GetLanguage
()
Return
[
Option
]
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
True
,
NotificationOption
.
Error
).
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
Me
.
offWithNone
,
language
)
Return
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
True
,
NotificationOption
.
Error
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
Me
.
offWithNone
,
language
))
End
Function
Private
Function
PreferIntrinsicTypeInMemberAccess
()
As
IDictionary
(
Of
OptionKey
,
Object
)
Dim
language
=
GetLanguage
()
Return
[
Option
]
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
True
,
NotificationOption
.
Error
).
With
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
Me
.
offWithNone
,
language
)
Return
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInMemberAccess
,
True
,
NotificationOption
.
Error
),
SingleOption
(
CodeStyleOptions
.
PreferIntrinsicPredefinedTypeKeywordInDeclaration
,
Me
.
offWithNone
,
language
))
End
Function
Private
ReadOnly
onWithError
=
New
CodeStyleOption
(
Of
Boolean
)(
True
,
NotificationOption
.
Error
)
...
...
@@ -2444,7 +2447,7 @@ End Class")
Public
Async
Function
TestAppropriateDiagnosticOnMissingQualifier
()
As
Task
Await
TestDiagnosticSeverityAndCountAsync
(
"Class C : Property SomeProperty As Integer : Sub M() : [|Me|].SomeProperty = 1 : End Sub : End Class"
,
options
:
=
OptionsSet
(
Tuple
.
Create
(
DirectCast
(
CodeStyleOptions
.
QualifyPropertyAccess
,
IOption
)
,
False
,
NotificationOption
.
Error
)),
options
:
=
OptionsSet
(
SingleOption
(
CodeStyleOptions
.
QualifyPropertyAccess
,
False
,
NotificationOption
.
Error
)),
diagnosticCount
:
=
1
,
diagnosticId
:
=
IDEDiagnosticIds
.
RemoveQualificationDiagnosticId
,
diagnosticSeverity
:
=
DiagnosticSeverity
.
Error
)
...
...
src/EditorFeatures/VisualBasicTest/Diagnostics/SimplifyTypeNames/SimplifyTypeNamesTests_FixAllTests.vb
浏览文件 @
2bf2eae7
...
...
@@ -790,8 +790,8 @@ End Class]]>
</
Workspace
>
.
ToString
()
Dim
options
=
OptionsSet
(
Tuple
.
Create
(
DirectCast
(
CodeStyleOptions
.
QualifyPropertyAccess
,
IOption
)
,
False
,
NotificationOption
.
Suggestion
),
Tuple
.
Create
(
DirectCast
(
CodeStyleOptions
.
QualifyFieldAccess
,
IOption
)
,
True
,
NotificationOption
.
Suggestion
))
SingleOption
(
CodeStyleOptions
.
QualifyPropertyAccess
,
False
,
NotificationOption
.
Suggestion
),
SingleOption
(
CodeStyleOptions
.
QualifyFieldAccess
,
True
,
NotificationOption
.
Suggestion
))
Await
TestAsync
(
initialMarkup
:
=
input
,
expectedMarkup
:
=
expected
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录