Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
4985a18e
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,发现更多精彩内容 >>
提交
4985a18e
编写于
3月 18, 2020
作者:
M
Manish Vasani
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Address feedback
上级
50287dea
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
64 addition
and
123 deletion
+64
-123
src/Analyzers/CSharp/Tests/AddBraces/AddBracesTests.cs
src/Analyzers/CSharp/Tests/AddBraces/AddBracesTests.cs
+3
-1
src/Analyzers/VisualBasic/Analyzers/AddAccessibilityModifiers/VisualBasicAddAccessibilityModifiersDiagnosticAnalyzer.vb
...VisualBasicAddAccessibilityModifiersDiagnosticAnalyzer.vb
+3
-3
src/CodeStyle/Directory.Build.targets
src/CodeStyle/Directory.Build.targets
+1
-1
src/EditorFeatures/CSharpTest/Diagnostics/AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest.cs
...bstractCSharpDiagnosticProviderBasedUserDiagnosticTest.cs
+12
-13
src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
...ies/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
+12
-51
src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/CSharpCodeFixVerifier`2+Test.cs
...TestUtilities/CodeActions/CSharpCodeFixVerifier`2+Test.cs
+2
-2
src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/VisualBasicCodeFixVerifier`2+Test.cs
...tilities/CodeActions/VisualBasicCodeFixVerifier`2+Test.cs
+1
-1
src/EditorFeatures/VisualBasicTest/Diagnostics/AbstractVisualBasicDiagnosticProviderBasedUserDiagnosticTest.vb
...ctVisualBasicDiagnosticProviderBasedUserDiagnosticTest.vb
+14
-15
src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs
src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs
+0
-4
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.cs
...ble/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.cs
+0
-1
src/Features/Core/Portable/PreferFrameworkType/PreferFrameworkTypeDiagnosticAnalyzerBase.cs
...rameworkType/PreferFrameworkTypeDiagnosticAnalyzerBase.cs
+0
-1
src/Features/Directory.Build.targets
src/Features/Directory.Build.targets
+2
-2
src/Workspaces/CSharp/Portable/Formatting/CSharpFormattingOptions.cs
...ces/CSharp/Portable/Formatting/CSharpFormattingOptions.cs
+1
-1
src/Workspaces/Core/Portable/CodeStyle/CodeStyleOption.cs
src/Workspaces/Core/Portable/CodeStyle/CodeStyleOption.cs
+1
-2
src/Workspaces/Core/Portable/CodeStyle/NotificationOption2_operators.cs
.../Core/Portable/CodeStyle/NotificationOption2_operators.cs
+3
-7
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CodeStyle/CodeStyleOptions2.cs
...ndExtensions/Compiler/Core/CodeStyle/CodeStyleOptions2.cs
+2
-2
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CodeStyle/NotificationOption2.cs
...Extensions/Compiler/Core/CodeStyle/NotificationOption2.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/AnalyzerConfigOptionsExtensions.cs
...mpiler/Core/Extensions/AnalyzerConfigOptionsExtensions.cs
+5
-5
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/FormattingOptions2.cs
...Extensions/Compiler/Core/Formatting/FormattingOptions2.cs
+1
-1
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Options/EditorConfig/EditorConfigStorageLocation`1.cs
...ore/Options/EditorConfig/EditorConfigStorageLocation`1.cs
+0
-2
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Options/Option2`1.cs
...UtilitiesAndExtensions/Compiler/Core/Options/Option2`1.cs
+0
-7
未找到文件。
src/Analyzers/CSharp/Tests/AddBraces/AddBracesTests.cs
浏览文件 @
4985a18e
...
@@ -659,7 +659,7 @@ static void Main()
...
@@ -659,7 +659,7 @@ static void Main()
/// <summary>
/// <summary>
/// Verifies that the use of braces in a construct nested within the true portion of an <c>if</c> statement does
/// Verifies that the use of braces in a construct nested within the true portion of an <c>if</c> statement does
/// not trigger the multiline behavior the <c>else</c> clause of a containing stetemnet for
/// not trigger the multiline behavior the <c>else</c> clause of a containing stetemnet for
///
"PreferBracesPreference.WhenMultiline"
. The <c>else</c> clause would only need braces if the true
///
<see cref="PreferBracesPreference.WhenMultiline"/>
. The <c>else</c> clause would only need braces if the true
/// portion also used braces (which would be required if the true portion was considered multiline.
/// portion also used braces (which would be required if the true portion was considered multiline.
/// </summary>
/// </summary>
[
Theory
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsAddBraces
)]
[
Theory
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsAddBraces
)]
...
@@ -668,6 +668,8 @@ static void Main()
...
@@ -668,6 +668,8 @@ static void Main()
[
InlineData
((
int
)
PreferBracesPreference
.
Always
,
true
)]
[
InlineData
((
int
)
PreferBracesPreference
.
Always
,
true
)]
public
async
Task
FireForIfNestedInElseWithoutBracesWithMultilineContext5
(
int
bracesPreference
,
bool
expectDiagnostic
)
public
async
Task
FireForIfNestedInElseWithoutBracesWithMultilineContext5
(
int
bracesPreference
,
bool
expectDiagnostic
)
{
{
var
x
=
PreferBracesPreference
.
WhenMultiline
;
await
TestAsync
(
await
TestAsync
(
@"
@"
class Program
class Program
...
...
src/Analyzers/VisualBasic/Analyzers/AddAccessibilityModifiers/VisualBasicAddAccessibilityModifiersDiagnosticAnalyzer.vb
浏览文件 @
4985a18e
...
@@ -100,19 +100,19 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.AddAccessibilityModifiers
...
@@ -100,19 +100,19 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.AddAccessibilityModifiers
If
member
.
IsParentKind
(
SyntaxKind
.
CompilationUnit
)
OrElse
If
member
.
IsParentKind
(
SyntaxKind
.
CompilationUnit
)
OrElse
member
.
IsParentKind
(
SyntaxKind
.
NamespaceBlock
)
Then
member
.
IsParentKind
(
SyntaxKind
.
NamespaceBlock
)
Then
' default is Friend
' default is Friend
Return
accessibility
=
a
ccessibility
.
Friend
Return
accessibility
=
A
ccessibility
.
Friend
End
If
End
If
' default for const and field in a class is private
' default for const and field in a class is private
If
member
.
IsParentKind
(
SyntaxKind
.
ClassBlock
)
OrElse
If
member
.
IsParentKind
(
SyntaxKind
.
ClassBlock
)
OrElse
member
.
IsParentKind
(
SyntaxKind
.
ModuleBlock
)
Then
member
.
IsParentKind
(
SyntaxKind
.
ModuleBlock
)
Then
If
member
.
IsKind
(
SyntaxKind
.
FieldDeclaration
)
Then
If
member
.
IsKind
(
SyntaxKind
.
FieldDeclaration
)
Then
Return
accessibility
=
a
ccessibility
.
Private
Return
accessibility
=
A
ccessibility
.
Private
End
If
End
If
End
If
End
If
' Everything else has a default of public
' Everything else has a default of public
Return
accessibility
=
a
ccessibility
.
Public
Return
accessibility
=
A
ccessibility
.
Public
End
Function
End
Function
End
Class
End
Class
End
Namespace
End
Namespace
src/CodeStyle/Directory.Build.targets
浏览文件 @
4985a18e
<Project>
<Project>
<Import Project="..\..\Directory.Build.targets"/>
<Import Project="..\..\Directory.Build.targets"/>
<ItemGroup
Condition="'$(IsShipping)' == 'true'"
>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\BannedSymbols.txt" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\BannedSymbols.txt" />
</ItemGroup>
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
src/EditorFeatures/CSharpTest/Diagnostics/AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest.cs
浏览文件 @
4985a18e
...
@@ -19,45 +19,44 @@ public abstract class AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest :
...
@@ -19,45 +19,44 @@ public abstract class AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest :
protected
override
TestWorkspace
CreateWorkspaceFromFile
(
string
initialMarkup
,
TestParameters
parameters
)
protected
override
TestWorkspace
CreateWorkspaceFromFile
(
string
initialMarkup
,
TestParameters
parameters
)
=>
TestWorkspace
.
CreateCSharp
(
initialMarkup
,
parameters
.
parseOptions
,
parameters
.
compilationOptions
);
=>
TestWorkspace
.
CreateCSharp
(
initialMarkup
,
parameters
.
parseOptions
,
parameters
.
compilationOptions
);
#pragma warning disable CS0108 // Member hides inherited member; missing new keyword
#if CODE_STYLE
#if CODE_STYLE
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option2
<
T
>
option
,
T
enabled
)
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option2
<
T
>
option
,
T
enabled
)
=>
(
new
OptionKey2
(
option
),
enabled
);
=>
(
new
OptionKey2
(
option
),
enabled
);
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
T
>
option
,
T
value
)
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
T
>
option
,
T
value
)
=>
(
new
OptionKey2
(
option
,
this
.
GetLanguage
()),
value
);
=>
(
new
OptionKey2
(
option
,
this
.
GetLanguage
()),
value
);
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
=>
SingleOption
(
option
,
new
CodeStyleOption2
<
T
>(
enabled
,
notification
));
=>
SingleOption
(
option
,
new
CodeStyleOption2
<
T
>(
enabled
,
notification
));
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
=>
(
new
OptionKey2
(
option
),
codeStyle
);
=>
(
new
OptionKey2
(
option
),
codeStyle
);
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
=>
SingleOption
(
option
,
new
CodeStyleOption2
<
T
>(
enabled
,
notification
));
=>
SingleOption
(
option
,
new
CodeStyleOption2
<
T
>(
enabled
,
notification
));
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
=>
SingleOption
(
option
,
codeStyle
,
language
:
GetLanguage
());
=>
SingleOption
(
option
,
codeStyle
,
language
:
GetLanguage
());
private
protected
static
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
,
string
language
)
internal
static
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
,
string
language
)
=>
(
new
OptionKey2
(
option
,
language
),
codeStyle
);
=>
(
new
OptionKey2
(
option
,
language
),
codeStyle
);
private
protected
IOptionsCollection
Option
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
internal
IOptionsCollection
Option
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
=>
OptionsSet
(
SingleOption
(
option
,
enabled
,
notification
));
=>
OptionsSet
(
SingleOption
(
option
,
enabled
,
notification
));
private
protected
IOptionsCollection
Option
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
internal
IOptionsCollection
Option
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
=>
OptionsSet
(
SingleOption
(
option
,
codeStyle
));
=>
OptionsSet
(
SingleOption
(
option
,
codeStyle
));
private
protected
IOptionsCollection
Option
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
internal
IOptionsCollection
Option
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
=>
OptionsSet
(
SingleOption
(
option
,
enabled
,
notification
));
=>
OptionsSet
(
SingleOption
(
option
,
enabled
,
notification
));
private
protected
IOptionsCollection
Option
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
internal
IOptionsCollection
Option
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
=>
OptionsSet
(
SingleOption
(
option
,
codeStyle
));
=>
OptionsSet
(
SingleOption
(
option
,
codeStyle
));
private
protected
IOptionsCollection
Option
<
T
>(
Option2
<
T
>
option
,
T
value
)
internal
IOptionsCollection
Option
<
T
>(
Option2
<
T
>
option
,
T
value
)
=>
OptionsSet
(
SingleOption
(
option
,
value
));
=>
OptionsSet
(
SingleOption
(
option
,
value
));
private
protected
IOptionsCollection
Option
<
T
>(
PerLanguageOption2
<
T
>
option
,
T
value
)
internal
IOptionsCollection
Option
<
T
>(
PerLanguageOption2
<
T
>
option
,
T
value
)
=>
OptionsSet
(
SingleOption
(
option
,
value
));
=>
OptionsSet
(
SingleOption
(
option
,
value
));
internal
static
IOptionsCollection
OptionsSet
(
params
(
OptionKey2
key
,
object
value
)[]
options
)
internal
static
IOptionsCollection
OptionsSet
(
params
(
OptionKey2
key
,
object
value
)[]
options
)
...
...
src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
浏览文件 @
4985a18e
...
@@ -688,82 +688,43 @@ protected static ImmutableArray<CodeAction> GetNestedActions(ImmutableArray<Code
...
@@ -688,82 +688,43 @@ protected static ImmutableArray<CodeAction> GetNestedActions(ImmutableArray<Code
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option2
<
T
>
option
,
T
enabled
)
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option2
<
T
>
option
,
T
enabled
)
=>
(
new
OptionKey2
(
option
),
enabled
);
=>
(
new
OptionKey2
(
option
),
enabled
);
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option
<
T
>
option
,
T
enabled
)
=>
(
new
OptionKey2
(
option
),
enabled
);
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
T
>
option
,
T
value
)
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
T
>
option
,
T
value
)
=>
(
new
OptionKey2
(
option
,
this
.
GetLanguage
()),
value
);
=>
(
new
OptionKey2
(
option
,
this
.
GetLanguage
()),
value
);
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption
<
T
>
option
,
T
value
)
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
=>
(
new
OptionKey2
(
option
,
this
.
GetLanguage
()),
value
);
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
=>
(
new
OptionKey2
(
option
),
new
CodeStyleOption2
<
T
>(
enabled
,
notification
));
=>
(
new
OptionKey2
(
option
),
new
CodeStyleOption2
<
T
>(
enabled
,
notification
));
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option
<
CodeStyleOption
<
T
>>
option
,
T
enabled
,
NotificationOption
notification
)
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
=>
(
new
OptionKey2
(
option
),
new
CodeStyleOption2
<
T
>(
enabled
,
(
NotificationOption2
)
notification
));
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
=>
(
new
OptionKey2
(
option
),
codeStyle
);
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
Option
<
CodeStyleOption
<
T
>>
option
,
CodeStyleOption
<
T
>
codeStyle
)
=>
(
new
OptionKey2
(
option
),
codeStyle
);
=>
(
new
OptionKey2
(
option
),
codeStyle
);
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
=>
(
new
OptionKey2
(
option
,
this
.
GetLanguage
()),
new
CodeStyleOption2
<
T
>(
enabled
,
notification
));
=>
(
new
OptionKey2
(
option
,
this
.
GetLanguage
()),
new
CodeStyleOption2
<
T
>(
enabled
,
notification
));
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption
<
CodeStyleOption
<
T
>>
option
,
T
enabled
,
NotificationOption
notification
)
internal
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
=>
(
new
OptionKey2
(
option
,
this
.
GetLanguage
()),
new
CodeStyleOption2
<
T
>(
enabled
,
(
NotificationOption2
)
notification
));
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
=>
(
new
OptionKey2
(
option
,
this
.
GetLanguage
()),
codeStyle
);
private
protected
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption
<
CodeStyleOption
<
T
>>
option
,
CodeStyleOption
<
T
>
codeStyle
)
=>
(
new
OptionKey2
(
option
,
this
.
GetLanguage
()),
codeStyle
);
=>
(
new
OptionKey2
(
option
,
this
.
GetLanguage
()),
codeStyle
);
private
protected
static
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
,
string
language
)
internal
static
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
,
string
language
)
=>
(
new
OptionKey2
(
option
,
language
),
codeStyle
);
private
protected
static
(
OptionKey2
,
object
)
SingleOption
<
T
>(
PerLanguageOption
<
CodeStyleOption
<
T
>>
option
,
CodeStyleOption
<
T
>
codeStyle
,
string
language
)
=>
(
new
OptionKey2
(
option
,
language
),
codeStyle
);
=>
(
new
OptionKey2
(
option
,
language
),
codeStyle
);
private
protected
IOptionsCollection
Option
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
internal
IOptionsCollection
Option
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
=>
OptionsSet
(
SingleOption
(
option
,
enabled
,
notification
));
=>
OptionsSet
(
SingleOption
(
option
,
enabled
,
notification
));
private
protected
IOptionsCollection
Option
<
T
>(
Option
<
CodeStyleOption
<
T
>>
option
,
T
enabled
,
NotificationOption
notification
)
internal
IOptionsCollection
Option
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
=>
OptionsSet
(
SingleOption
(
option
,
enabled
,
notification
));
private
protected
IOptionsCollection
Option
<
T
>(
Option2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
=>
OptionsSet
(
SingleOption
(
option
,
codeStyle
));
private
protected
IOptionsCollection
Option
<
T
>(
Option
<
CodeStyleOption
<
T
>>
option
,
CodeStyleOption
<
T
>
codeStyle
)
=>
OptionsSet
(
SingleOption
(
option
,
codeStyle
));
=>
OptionsSet
(
SingleOption
(
option
,
codeStyle
));
private
protected
IOptionsCollection
Option
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
internal
IOptionsCollection
Option
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
T
enabled
,
NotificationOption2
notification
)
=>
OptionsSet
(
SingleOption
(
option
,
enabled
,
notification
));
private
protected
IOptionsCollection
Option
<
T
>(
PerLanguageOption
<
CodeStyleOption
<
T
>>
option
,
T
enabled
,
NotificationOption
notification
)
=>
OptionsSet
(
SingleOption
(
option
,
enabled
,
notification
));
=>
OptionsSet
(
SingleOption
(
option
,
enabled
,
notification
));
private
protected
IOptionsCollection
Option
<
T
>(
Option2
<
T
>
option
,
T
value
)
internal
IOptionsCollection
Option
<
T
>(
Option2
<
T
>
option
,
T
value
)
=>
OptionsSet
(
SingleOption
(
option
,
value
));
=>
OptionsSet
(
SingleOption
(
option
,
value
));
private
protected
IOptionsCollection
Option
<
T
>(
Option
<
T
>
option
,
T
value
)
internal
IOptionsCollection
Option
<
T
>(
PerLanguageOption2
<
T
>
option
,
T
value
)
=>
OptionsSet
(
SingleOption
(
option
,
value
));
=>
OptionsSet
(
SingleOption
(
option
,
value
));
private
protected
IOptionsCollection
Option
<
T
>(
PerLanguageOption2
<
T
>
option
,
T
value
)
internal
IOptionsCollection
Option
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
=>
OptionsSet
(
SingleOption
(
option
,
value
));
private
protected
IOptionsCollection
Option
<
T
>(
PerLanguageOption
<
T
>
option
,
T
value
)
=>
OptionsSet
(
SingleOption
(
option
,
value
));
private
protected
IOptionsCollection
Option
<
T
>(
PerLanguageOption2
<
CodeStyleOption2
<
T
>>
option
,
CodeStyleOption2
<
T
>
codeStyle
)
=>
OptionsSet
(
SingleOption
(
option
,
codeStyle
));
private
protected
IOptionsCollection
Option
<
T
>(
PerLanguageOption
<
CodeStyleOption
<
T
>>
option
,
CodeStyleOption
<
T
>
codeStyle
)
=>
OptionsSet
(
SingleOption
(
option
,
codeStyle
));
=>
OptionsSet
(
SingleOption
(
option
,
codeStyle
));
private
protected
IOptionsCollection
OptionsSet
(
OptionKey2
option
,
object
value
)
internal
IOptionsCollection
OptionsSet
(
OptionKey2
option
,
object
value
)
=>
OptionsSet
((
option
,
value
));
=>
OptionsSet
((
option
,
value
));
#if CODE_STYLE
#if CODE_STYLE
...
...
src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/CSharpCodeFixVerifier`2+Test.cs
浏览文件 @
4985a18e
...
@@ -37,10 +37,10 @@ public Test()
...
@@ -37,10 +37,10 @@ public Test()
SolutionTransforms
.
Add
((
solution
,
projectId
)
=>
SolutionTransforms
.
Add
((
solution
,
projectId
)
=>
{
{
var
parseOptions
=
(
CSharpParseOptions
)
solution
.
GetProject
(
projectId
)
?
.
ParseOptions
!;
var
parseOptions
=
(
CSharpParseOptions
)
solution
.
GetProject
(
projectId
)
!
.
ParseOptions
!;
solution
=
solution
.
WithProjectParseOptions
(
projectId
,
parseOptions
.
WithLanguageVersion
(
LanguageVersion
));
solution
=
solution
.
WithProjectParseOptions
(
projectId
,
parseOptions
.
WithLanguageVersion
(
LanguageVersion
));
var
compilationOptions
=
solution
.
GetProject
(
projectId
)
?
.
CompilationOptions
!;
var
compilationOptions
=
solution
.
GetProject
(
projectId
)
!
.
CompilationOptions
!;
compilationOptions
=
compilationOptions
.
WithSpecificDiagnosticOptions
(
compilationOptions
.
SpecificDiagnosticOptions
.
SetItems
(
s_nullableWarnings
));
compilationOptions
=
compilationOptions
.
WithSpecificDiagnosticOptions
(
compilationOptions
.
SpecificDiagnosticOptions
.
SetItems
(
s_nullableWarnings
));
solution
=
solution
.
WithProjectCompilationOptions
(
projectId
,
compilationOptions
);
solution
=
solution
.
WithProjectCompilationOptions
(
projectId
,
compilationOptions
);
...
...
src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/VisualBasicCodeFixVerifier`2+Test.cs
浏览文件 @
4985a18e
...
@@ -27,7 +27,7 @@ public Test()
...
@@ -27,7 +27,7 @@ public Test()
SolutionTransforms
.
Add
((
solution
,
projectId
)
=>
SolutionTransforms
.
Add
((
solution
,
projectId
)
=>
{
{
var
parseOptions
=
(
VisualBasicParseOptions
)
solution
.
GetProject
(
projectId
)
?
.
ParseOptions
!;
var
parseOptions
=
(
VisualBasicParseOptions
)
solution
.
GetProject
(
projectId
)
!
.
ParseOptions
!;
solution
=
solution
.
WithProjectParseOptions
(
projectId
,
parseOptions
.
WithLanguageVersion
(
LanguageVersion
));
solution
=
solution
.
WithProjectParseOptions
(
projectId
,
parseOptions
.
WithLanguageVersion
(
LanguageVersion
));
var
(
analyzerConfigSource
,
remainingOptions
)
=
CodeFixVerifierHelper
.
ConvertOptionsToAnalyzerConfig
(
DefaultFileExt
,
EditorConfig
,
Options
);
var
(
analyzerConfigSource
,
remainingOptions
)
=
CodeFixVerifierHelper
.
ConvertOptionsToAnalyzerConfig
(
DefaultFileExt
,
EditorConfig
,
Options
);
...
...
src/EditorFeatures/VisualBasicTest/Diagnostics/AbstractVisualBasicDiagnosticProviderBasedUserDiagnosticTest.vb
浏览文件 @
4985a18e
...
@@ -50,61 +50,60 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Diagnostics
...
@@ -50,61 +50,60 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Diagnostics
Return
LanguageNames
.
VisualBasic
Return
LanguageNames
.
VisualBasic
End
Function
End
Function
#
Disable
Warning
BC40003
' Member shadows an overloadable member declared in the base type
#If CODE_STYLE Then
#If CODE_STYLE Then
Friend
Function
SingleOption
(
Of
T
)(
optionParam
As
Option2
(
Of
T
),
enabled
As
T
)
As
(
OptionKey2
,
Object
)
Friend
Shadows
Function
SingleOption
(
Of
T
)(
optionParam
As
Option2
(
Of
T
),
enabled
As
T
)
As
(
OptionKey2
,
Object
)
Return
(
New
OptionKey2
(
optionParam
),
enabled
)
Return
(
New
OptionKey2
(
optionParam
),
enabled
)
End
Function
End
Function
Private
Protected
Function
SingleOption
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
T
),
value
As
T
)
As
(
OptionKey2
,
Object
)
Friend
Shadows
Function
SingleOption
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
T
),
value
As
T
)
As
(
OptionKey2
,
Object
)
Return
(
New
OptionKey2
(
optionParam
,
Me
.
GetLanguage
()),
value
)
Return
(
New
OptionKey2
(
optionParam
,
Me
.
GetLanguage
()),
value
)
End
Function
End
Function
Private
Protected
Function
SingleOption
(
Of
T
)(
optionParam
As
Option2
(
Of
CodeStyleOption2
(
Of
T
)),
enabled
As
T
,
notification
As
NotificationOption2
)
As
(
OptionKey2
,
Object
)
Friend
Shadows
Function
SingleOption
(
Of
T
)(
optionParam
As
Option2
(
Of
CodeStyleOption2
(
Of
T
)),
enabled
As
T
,
notification
As
NotificationOption2
)
As
(
OptionKey2
,
Object
)
Return
SingleOption
(
optionParam
,
New
CodeStyleOption2
(
Of
T
)(
enabled
,
notification
))
Return
SingleOption
(
optionParam
,
New
CodeStyleOption2
(
Of
T
)(
enabled
,
notification
))
End
Function
End
Function
Private
Protected
Function
SingleOption
(
Of
T
)(
optionParam
As
Option2
(
Of
CodeStyleOption2
(
Of
T
)),
codeStyle
As
CodeStyleOption2
(
Of
T
))
As
(
OptionKey2
,
Object
)
Friend
Shadows
Function
SingleOption
(
Of
T
)(
optionParam
As
Option2
(
Of
CodeStyleOption2
(
Of
T
)),
codeStyle
As
CodeStyleOption2
(
Of
T
))
As
(
OptionKey2
,
Object
)
Return
(
New
OptionKey2
(
optionParam
),
codeStyle
)
Return
(
New
OptionKey2
(
optionParam
),
codeStyle
)
End
Function
End
Function
Private
Protected
Function
SingleOption
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
CodeStyleOption2
(
Of
T
)),
enabled
As
T
,
notification
As
NotificationOption2
)
As
(
OptionKey2
,
Object
)
Friend
Shadows
Function
SingleOption
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
CodeStyleOption2
(
Of
T
)),
enabled
As
T
,
notification
As
NotificationOption2
)
As
(
OptionKey2
,
Object
)
Return
SingleOption
(
optionParam
,
New
CodeStyleOption2
(
Of
T
)(
enabled
,
notification
))
Return
SingleOption
(
optionParam
,
New
CodeStyleOption2
(
Of
T
)(
enabled
,
notification
))
End
Function
End
Function
Private
Protected
Function
SingleOption
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
CodeStyleOption2
(
Of
T
)),
codeStyle
As
CodeStyleOption2
(
Of
T
))
As
(
OptionKey2
,
Object
)
Friend
Shadows
Function
SingleOption
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
CodeStyleOption2
(
Of
T
)),
codeStyle
As
CodeStyleOption2
(
Of
T
))
As
(
OptionKey2
,
Object
)
Return
SingleOption
(
optionParam
,
codeStyle
,
language
:
=
GetLanguage
())
Return
SingleOption
(
optionParam
,
codeStyle
,
language
:
=
GetLanguage
())
End
Function
End
Function
Private
Protected
Shared
Function
SingleOption
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
CodeStyleOption2
(
Of
T
)),
codeStyle
As
CodeStyleOption2
(
Of
T
),
language
As
String
)
As
(
OptionKey2
,
Object
)
Friend
Shadows
Function
SingleOption
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
CodeStyleOption2
(
Of
T
)),
codeStyle
As
CodeStyleOption2
(
Of
T
),
language
As
String
)
As
(
OptionKey2
,
Object
)
Return
(
New
OptionKey2
(
optionParam
,
language
),
codeStyle
)
Return
(
New
OptionKey2
(
optionParam
,
language
),
codeStyle
)
End
Function
End
Function
Private
Protected
Function
[
Option
]
(
Of
T
)(
optionParam
As
Option2
(
Of
CodeStyleOption2
(
Of
T
)),
enabled
As
T
,
notification
As
NotificationOption2
)
As
IOptionsCollection
Friend
Shadows
Function
[
Option
]
(
Of
T
)(
optionParam
As
Option2
(
Of
CodeStyleOption2
(
Of
T
)),
enabled
As
T
,
notification
As
NotificationOption2
)
As
IOptionsCollection
Return
OptionsSet
(
SingleOption
(
optionParam
,
enabled
,
notification
))
Return
OptionsSet
(
SingleOption
(
optionParam
,
enabled
,
notification
))
End
Function
End
Function
Private
Protected
Function
[
Option
]
(
Of
T
)(
optionParam
As
Option2
(
Of
CodeStyleOption2
(
Of
T
)),
codeStyle
As
CodeStyleOption2
(
Of
T
))
As
IOptionsCollection
Friend
Shadows
Function
[
Option
]
(
Of
T
)(
optionParam
As
Option2
(
Of
CodeStyleOption2
(
Of
T
)),
codeStyle
As
CodeStyleOption2
(
Of
T
))
As
IOptionsCollection
Return
OptionsSet
(
SingleOption
(
optionParam
,
codeStyle
))
Return
OptionsSet
(
SingleOption
(
optionParam
,
codeStyle
))
End
Function
End
Function
Private
Protected
Function
[
Option
]
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
CodeStyleOption2
(
Of
T
)),
enabled
As
T
,
notification
As
NotificationOption2
)
As
IOptionsCollection
Friend
Shadows
Function
[
Option
]
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
CodeStyleOption2
(
Of
T
)),
enabled
As
T
,
notification
As
NotificationOption2
)
As
IOptionsCollection
Return
OptionsSet
(
SingleOption
(
optionParam
,
enabled
,
notification
))
Return
OptionsSet
(
SingleOption
(
optionParam
,
enabled
,
notification
))
End
Function
End
Function
Private
Protected
Function
[
Option
]
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
CodeStyleOption2
(
Of
T
)),
codeStyle
As
CodeStyleOption2
(
Of
T
))
As
IOptionsCollection
Friend
Shadows
Function
[
Option
]
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
CodeStyleOption2
(
Of
T
)),
codeStyle
As
CodeStyleOption2
(
Of
T
))
As
IOptionsCollection
Return
OptionsSet
(
SingleOption
(
optionParam
,
codeStyle
))
Return
OptionsSet
(
SingleOption
(
optionParam
,
codeStyle
))
End
Function
End
Function
Private
Protected
Function
[
Option
]
(
Of
T
)(
optionParam
As
Option2
(
Of
T
),
value
As
T
)
As
IOptionsCollection
Friend
Shadows
Function
[
Option
]
(
Of
T
)(
optionParam
As
Option2
(
Of
T
),
value
As
T
)
As
IOptionsCollection
Return
OptionsSet
(
SingleOption
(
optionParam
,
value
))
Return
OptionsSet
(
SingleOption
(
optionParam
,
value
))
End
Function
End
Function
Private
Protected
Function
[
Option
]
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
T
),
value
As
T
)
As
IOptionsCollection
Friend
Shadows
Function
[
Option
]
(
Of
T
)(
optionParam
As
PerLanguageOption2
(
Of
T
),
value
As
T
)
As
IOptionsCollection
Return
OptionsSet
(
SingleOption
(
optionParam
,
value
))
Return
OptionsSet
(
SingleOption
(
optionParam
,
value
))
End
Function
End
Function
Friend
Shared
Function
OptionsSet
(
ParamArray
options
As
(
OptionKey2
,
Object
)())
As
IOptionsCollection
Friend
Shared
Shadows
Function
OptionsSet
(
ParamArray
options
As
(
OptionKey2
,
Object
)())
As
IOptionsCollection
Return
New
OptionsCollection
(
LanguageNames
.
VisualBasic
,
options
)
Return
New
OptionsCollection
(
LanguageNames
.
VisualBasic
,
options
)
End
Function
End
Function
#End If
#End If
...
...
src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs
浏览文件 @
4985a18e
...
@@ -21,10 +21,6 @@
...
@@ -21,10 +21,6 @@
using
Microsoft.CodeAnalysis.Text
;
using
Microsoft.CodeAnalysis.Text
;
using
Roslyn.Utilities
;
using
Roslyn.Utilities
;
#if !CODE_STYLE
using
OptionSet
=
Microsoft
.
CodeAnalysis
.
Options
.
OptionSet
;
#endif
namespace
Microsoft.CodeAnalysis.Diagnostics
namespace
Microsoft.CodeAnalysis.Diagnostics
{
{
internal
static
partial
class
AnalyzerHelper
internal
static
partial
class
AnalyzerHelper
...
...
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.cs
浏览文件 @
4985a18e
...
@@ -95,7 +95,6 @@ public bool NeedsReanalysisOnOptionChanged(object sender, OptionChangedEventArgs
...
@@ -95,7 +95,6 @@ public bool NeedsReanalysisOnOptionChanged(object sender, OptionChangedEventArgs
{
{
return
e
.
Option
.
Feature
==
nameof
(
SimplificationOptions
)
||
return
e
.
Option
.
Feature
==
nameof
(
SimplificationOptions
)
||
e
.
Option
.
Feature
==
nameof
(
CodeStyleOptions
)
||
e
.
Option
.
Feature
==
nameof
(
CodeStyleOptions
)
||
e
.
Option
.
Feature
==
nameof
(
CodeStyleOptions2
)
||
e
.
Option
==
SolutionCrawlerOptions
.
BackgroundAnalysisScopeOption
||
e
.
Option
==
SolutionCrawlerOptions
.
BackgroundAnalysisScopeOption
||
#pragma warning disable CS0618 // Type or member is obsolete - TypeScript and F# are still on the older ClosedFileDiagnostic option.
#pragma warning disable CS0618 // Type or member is obsolete - TypeScript and F# are still on the older ClosedFileDiagnostic option.
e
.
Option
==
ServiceFeatureOnOffOptions
.
ClosedFileDiagnostic
;
e
.
Option
==
ServiceFeatureOnOffOptions
.
ClosedFileDiagnostic
;
...
...
src/Features/Core/Portable/PreferFrameworkType/PreferFrameworkTypeDiagnosticAnalyzerBase.cs
浏览文件 @
4985a18e
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Options
;
using
OptionSet
=
Microsoft
.
CodeAnalysis
.
Options
.
OptionSet
;
namespace
Microsoft.CodeAnalysis.PreferFrameworkType
namespace
Microsoft.CodeAnalysis.PreferFrameworkType
{
{
...
...
src/Features/Directory.Build.targets
浏览文件 @
4985a18e
<Project>
<Project>
<Import Project="
..\..\Directory.Build.targets"
/>
<Import Project="
$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))"
/>
<ItemGroup
Condition="'$(IsShipping)' == 'true'"
>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\BannedSymbols.txt" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\BannedSymbols.txt" />
</ItemGroup>
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
src/Workspaces/CSharp/Portable/Formatting/CSharpFormattingOptions.cs
浏览文件 @
4985a18e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
namespace
Microsoft.CodeAnalysis.CSharp.Formatting
namespace
Microsoft.CodeAnalysis.CSharp.Formatting
{
{
/// <inheritdoc cref="CSharpFormattingOptions"/>
/// <inheritdoc cref="CSharpFormattingOptions"/>
public
static
partial
class
CSharpFormattingOptions
public
static
class
CSharpFormattingOptions
{
{
/// <inheritdoc cref="CSharpFormattingOptions2.SpacingAfterMethodDeclarationName"/>
/// <inheritdoc cref="CSharpFormattingOptions2.SpacingAfterMethodDeclarationName"/>
public
static
Option
<
bool
>
SpacingAfterMethodDeclarationName
{
get
;
}
=
(
Option
<
bool
>)
CSharpFormattingOptions2
.
SpacingAfterMethodDeclarationName
;
public
static
Option
<
bool
>
SpacingAfterMethodDeclarationName
{
get
;
}
=
(
Option
<
bool
>)
CSharpFormattingOptions2
.
SpacingAfterMethodDeclarationName
;
...
...
src/Workspaces/Core/Portable/CodeStyle/CodeStyleOption.cs
浏览文件 @
4985a18e
...
@@ -19,8 +19,7 @@ internal CodeStyleOption(CodeStyleOption2<T> codeStyleOptionImpl)
...
@@ -19,8 +19,7 @@ internal CodeStyleOption(CodeStyleOption2<T> codeStyleOptionImpl)
}
}
public
CodeStyleOption
(
T
value
,
NotificationOption
notification
)
public
CodeStyleOption
(
T
value
,
NotificationOption
notification
)
:
this
(
new
CodeStyleOption2
<
T
>(
value
,
:
this
(
new
CodeStyleOption2
<
T
>(
value
,
(
NotificationOption2
)
notification
))
(
NotificationOption2
)(
notification
??
throw
new
ArgumentNullException
(
nameof
(
notification
)))))
{
{
}
}
...
...
src/Workspaces/Core/Portable/CodeStyle/NotificationOption2_operators.cs
浏览文件 @
4985a18e
...
@@ -4,11 +4,12 @@
...
@@ -4,11 +4,12 @@
#
nullable
enable
#
nullable
enable
using
System
;
using
Roslyn.Utilities
;
using
Roslyn.Utilities
;
namespace
Microsoft.CodeAnalysis.CodeStyle
namespace
Microsoft.CodeAnalysis.CodeStyle
{
{
internal
partial
class
NotificationOption2
internal
sealed
partial
class
NotificationOption2
:
IEquatable
<
NotificationOption2
?>
{
{
public
static
explicit
operator
NotificationOption2
?(
NotificationOption
?
notificationOption
)
public
static
explicit
operator
NotificationOption2
?(
NotificationOption
?
notificationOption
)
{
{
...
@@ -48,12 +49,7 @@ internal partial class NotificationOption2
...
@@ -48,12 +49,7 @@ internal partial class NotificationOption2
public
override
bool
Equals
(
object
?
obj
)
public
override
bool
Equals
(
object
?
obj
)
{
{
if
(
obj
is
NotificationOption2
notificationOption2
)
return
ReferenceEquals
(
this
,
obj
);
{
return
this
.
Equals
(
notificationOption2
);
}
return
false
;
}
}
public
bool
Equals
(
NotificationOption2
?
notificationOption2
)
public
bool
Equals
(
NotificationOption2
?
notificationOption2
)
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CodeStyle/CodeStyleOptions2.cs
浏览文件 @
4985a18e
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
namespace
Microsoft.CodeAnalysis.CodeStyle
namespace
Microsoft.CodeAnalysis.CodeStyle
{
{
internal
class
CodeStyleOptions2
internal
static
class
CodeStyleOptions2
{
{
private
static
readonly
ImmutableArray
<
IOption2
>.
Builder
s_allOptionsBuilder
=
ImmutableArray
.
CreateBuilder
<
IOption2
>();
private
static
readonly
ImmutableArray
<
IOption2
>.
Builder
s_allOptionsBuilder
=
ImmutableArray
.
CreateBuilder
<
IOption2
>();
...
@@ -20,7 +20,7 @@ internal class CodeStyleOptions2
...
@@ -20,7 +20,7 @@ internal class CodeStyleOptions2
private
static
PerLanguageOption2
<
T
>
CreateOption
<
T
>(
OptionGroup
group
,
string
name
,
T
defaultValue
,
params
OptionStorageLocation2
[]
storageLocations
)
private
static
PerLanguageOption2
<
T
>
CreateOption
<
T
>(
OptionGroup
group
,
string
name
,
T
defaultValue
,
params
OptionStorageLocation2
[]
storageLocations
)
{
{
var
option
=
new
PerLanguageOption2
<
T
>(
"CodeStyleOption"
,
group
,
name
,
defaultValue
,
storageLocations
);
var
option
=
new
PerLanguageOption2
<
T
>(
"CodeStyleOption
s
"
,
group
,
name
,
defaultValue
,
storageLocations
);
s_allOptionsBuilder
.
Add
(
option
);
s_allOptionsBuilder
.
Add
(
option
);
return
option
;
return
option
;
}
}
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CodeStyle/NotificationOption2.cs
浏览文件 @
4985a18e
...
@@ -18,7 +18,7 @@ namespace Microsoft.CodeAnalysis.CodeStyle
...
@@ -18,7 +18,7 @@ namespace Microsoft.CodeAnalysis.CodeStyle
/// This also supports various properties for databinding.
/// This also supports various properties for databinding.
/// </remarks>
/// </remarks>
/// <completionlist cref="NotificationOption2"/>
/// <completionlist cref="NotificationOption2"/>
internal
partial
class
NotificationOption2
internal
sealed
partial
class
NotificationOption2
{
{
/// <summary>
/// <summary>
/// Name for the notification option.
/// Name for the notification option.
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/AnalyzerConfigOptionsExtensions.cs
浏览文件 @
4985a18e
...
@@ -26,19 +26,19 @@ public static T GetOption<T>(this AnalyzerConfigOptions analyzerConfigOptions, P
...
@@ -26,19 +26,19 @@ public static T GetOption<T>(this AnalyzerConfigOptions analyzerConfigOptions, P
}
}
#else
#else
public
static
T
GetOption
<
T
>(
this
AnalyzerConfigOptions
analyzerConfigOptions
,
Options
.
Option
<
T
>
option
)
public
static
T
GetOption
<
T
>(
this
AnalyzerConfigOptions
analyzerConfigOptions
,
Options
.
Option
<
T
>
option
)
=>
analyzerConfigOptions
.
GetOptionWithAssertOnFailure
<
T
>(
option
);
=>
GetOptionWithAssertOnFailure
<
T
>(
analyzerConfigOptions
,
option
);
public
static
T
GetOption
<
T
>(
this
AnalyzerConfigOptions
analyzerConfigOptions
,
Options
.
PerLanguageOption
<
T
>
option
)
public
static
T
GetOption
<
T
>(
this
AnalyzerConfigOptions
analyzerConfigOptions
,
Options
.
PerLanguageOption
<
T
>
option
)
=>
analyzerConfigOptions
.
GetOptionWithAssertOnFailure
<
T
>(
option
);
=>
GetOptionWithAssertOnFailure
<
T
>(
analyzerConfigOptions
,
option
);
#endif
#endif
public
static
T
GetOption
<
T
>(
this
AnalyzerConfigOptions
analyzerConfigOptions
,
Option2
<
T
>
option
)
public
static
T
GetOption
<
T
>(
this
AnalyzerConfigOptions
analyzerConfigOptions
,
Option2
<
T
>
option
)
=>
analyzerConfigOptions
.
GetOptionWithAssertOnFailure
<
T
>(
option
);
=>
GetOptionWithAssertOnFailure
<
T
>(
analyzerConfigOptions
,
option
);
public
static
T
GetOption
<
T
>(
this
AnalyzerConfigOptions
analyzerConfigOptions
,
PerLanguageOption2
<
T
>
option
)
public
static
T
GetOption
<
T
>(
this
AnalyzerConfigOptions
analyzerConfigOptions
,
PerLanguageOption2
<
T
>
option
)
=>
analyzerConfigOptions
.
GetOptionWithAssertOnFailure
<
T
>(
option
);
=>
GetOptionWithAssertOnFailure
<
T
>(
analyzerConfigOptions
,
option
);
private
static
T
GetOptionWithAssertOnFailure
<
T
>(
this
AnalyzerConfigOptions
analyzerConfigOptions
,
TOption
option
)
private
static
T
GetOptionWithAssertOnFailure
<
T
>(
AnalyzerConfigOptions
analyzerConfigOptions
,
TOption
option
)
{
{
if
(!
TryGetEditorConfigOptionOrDefault
(
analyzerConfigOptions
,
option
,
out
T
value
))
if
(!
TryGetEditorConfigOptionOrDefault
(
analyzerConfigOptions
,
option
,
out
T
value
))
{
{
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/FormattingOptions2.cs
浏览文件 @
4985a18e
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
namespace
Microsoft.CodeAnalysis.Formatting
namespace
Microsoft.CodeAnalysis.Formatting
{
{
internal
static
partial
class
FormattingOptions2
internal
static
class
FormattingOptions2
{
{
private
static
readonly
ImmutableArray
<
IOption2
>.
Builder
s_allOptionsBuilder
=
ImmutableArray
.
CreateBuilder
<
IOption2
>();
private
static
readonly
ImmutableArray
<
IOption2
>.
Builder
s_allOptionsBuilder
=
ImmutableArray
.
CreateBuilder
<
IOption2
>();
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Options/EditorConfig/EditorConfigStorageLocation`1.cs
浏览文件 @
4985a18e
...
@@ -13,8 +13,6 @@
...
@@ -13,8 +13,6 @@
#if CODE_STYLE
#if CODE_STYLE
using
OptionSet
=
Microsoft
.
CodeAnalysis
.
Diagnostics
.
AnalyzerConfigOptions
;
using
OptionSet
=
Microsoft
.
CodeAnalysis
.
Diagnostics
.
AnalyzerConfigOptions
;
#else
using
OptionSet
=
Microsoft
.
CodeAnalysis
.
Options
.
OptionSet
;
#endif
#endif
namespace
Microsoft.CodeAnalysis.Options
namespace
Microsoft.CodeAnalysis.Options
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Options/Option2`1.cs
浏览文件 @
4985a18e
...
@@ -51,13 +51,6 @@ internal partial class Option2<T> : ILanguageSpecificOption<T>
...
@@ -51,13 +51,6 @@ internal partial class Option2<T> : ILanguageSpecificOption<T>
/// </summary>
/// </summary>
public
ImmutableArray
<
OptionStorageLocation2
>
StorageLocations
{
get
;
}
public
ImmutableArray
<
OptionStorageLocation2
>
StorageLocations
{
get
;
}
[
Obsolete
(
"Use a constructor that specifies an explicit default value."
)]
public
Option2
(
string
feature
,
string
name
)
:
this
(
feature
,
name
,
default
!)
{
// This constructor forwards to the next one; it exists to maintain source-level compatibility with older callers.
}
public
Option2
(
string
feature
,
string
name
,
T
defaultValue
)
public
Option2
(
string
feature
,
string
name
,
T
defaultValue
)
:
this
(
feature
,
name
,
defaultValue
,
storageLocations
:
Array
.
Empty
<
OptionStorageLocation2
>())
:
this
(
feature
,
name
,
defaultValue
,
storageLocations
:
Array
.
Empty
<
OptionStorageLocation2
>())
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录