Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
3c477bf6
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,发现更多精彩内容 >>
提交
3c477bf6
编写于
3月 13, 2020
作者:
M
Manish Vasani
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move UseExpressionBody analyzer/fixer/tests to shared layer
上级
a4867b9f
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
192 addition
and
54 deletion
+192
-54
src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
+11
-0
src/Analyzers/CSharp/Analyzers/UseExpressionBody/Helpers/UseExpressionBodyForAccessorsHelper.cs
...essionBody/Helpers/UseExpressionBodyForAccessorsHelper.cs
+8
-3
src/Analyzers/CSharp/Analyzers/UseExpressionBody/Helpers/UseExpressionBodyForConstructorsHelper.cs
...ionBody/Helpers/UseExpressionBodyForConstructorsHelper.cs
+8
-3
src/Analyzers/CSharp/Analyzers/UseExpressionBody/Helpers/UseExpressionBodyForConversionOperatorsHelper.cs
.../Helpers/UseExpressionBodyForConversionOperatorsHelper.cs
+8
-3
src/Analyzers/CSharp/Analyzers/UseExpressionBody/Helpers/UseExpressionBodyForIndexersHelper.cs
...ressionBody/Helpers/UseExpressionBodyForIndexersHelper.cs
+10
-4
src/Analyzers/CSharp/Analyzers/UseExpressionBody/Helpers/UseExpressionBodyForLocalFunctionHelper.cs
...onBody/Helpers/UseExpressionBodyForLocalFunctionHelper.cs
+8
-3
src/Analyzers/CSharp/Analyzers/UseExpressionBody/Helpers/UseExpressionBodyForMethodsHelper.cs
...pressionBody/Helpers/UseExpressionBodyForMethodsHelper.cs
+8
-3
src/Analyzers/CSharp/Analyzers/UseExpressionBody/Helpers/UseExpressionBodyForOperatorsHelper.cs
...essionBody/Helpers/UseExpressionBodyForOperatorsHelper.cs
+8
-3
src/Analyzers/CSharp/Analyzers/UseExpressionBody/Helpers/UseExpressionBodyForPropertiesHelper.cs
...ssionBody/Helpers/UseExpressionBodyForPropertiesHelper.cs
+10
-4
src/Analyzers/CSharp/Analyzers/UseExpressionBody/Helpers/UseExpressionBodyHelper.cs
...zers/UseExpressionBody/Helpers/UseExpressionBodyHelper.cs
+7
-1
src/Analyzers/CSharp/Analyzers/UseExpressionBody/Helpers/UseExpressionBodyHelper`1.cs
...rs/UseExpressionBody/Helpers/UseExpressionBodyHelper`1.cs
+9
-3
src/Analyzers/CSharp/Analyzers/UseExpressionBody/UseExpressionBodyDiagnosticAnalyzer.cs
.../UseExpressionBody/UseExpressionBodyDiagnosticAnalyzer.cs
+7
-3
src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
+1
-0
src/Analyzers/CSharp/CodeFixes/UseExpressionBody/UseExpressionBodyCodeFixProvider.cs
...xes/UseExpressionBody/UseExpressionBodyCodeFixProvider.cs
+15
-2
src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems
...nalyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems
+8
-0
src/Analyzers/CSharp/Tests/UseExpressionBody/UseExpressionBodyForAccessorsAnalyzerTests.cs
...ressionBody/UseExpressionBodyForAccessorsAnalyzerTests.cs
+9
-3
src/Analyzers/CSharp/Tests/UseExpressionBody/UseExpressionBodyForConstructorsAnalyzerTests.cs
...sionBody/UseExpressionBodyForConstructorsAnalyzerTests.cs
+8
-2
src/Analyzers/CSharp/Tests/UseExpressionBody/UseExpressionBodyForConversionOperatorsAnalyzerTests.cs
...y/UseExpressionBodyForConversionOperatorsAnalyzerTests.cs
+8
-2
src/Analyzers/CSharp/Tests/UseExpressionBody/UseExpressionBodyForIndexersAnalyzerTests.cs
...pressionBody/UseExpressionBodyForIndexersAnalyzerTests.cs
+8
-2
src/Analyzers/CSharp/Tests/UseExpressionBody/UseExpressionBodyForLocalFunctionsAnalyzerTests.cs
...onBody/UseExpressionBodyForLocalFunctionsAnalyzerTests.cs
+8
-3
src/Analyzers/CSharp/Tests/UseExpressionBody/UseExpressionBodyForMethodsAnalyzerTests.cs
...xpressionBody/UseExpressionBodyForMethodsAnalyzerTests.cs
+9
-3
src/Analyzers/CSharp/Tests/UseExpressionBody/UseExpressionBodyForOperatorsAnalyzerTests.cs
...ressionBody/UseExpressionBodyForOperatorsAnalyzerTests.cs
+8
-2
src/Analyzers/CSharp/Tests/UseExpressionBody/UseExpressionBodyForPropertiesAnalyzerTests.cs
...essionBody/UseExpressionBodyForPropertiesAnalyzerTests.cs
+8
-2
未找到文件。
src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
浏览文件 @
3c477bf6
...
@@ -22,6 +22,17 @@
...
@@ -22,6 +22,17 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)NamingStyle\CSharpNamingStyleDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)NamingStyle\CSharpNamingStyleDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)PopulateSwitch\CSharpPopulateSwitchExpressionDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)PopulateSwitch\CSharpPopulateSwitchExpressionDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)PopulateSwitch\CSharpPopulateSwitchStatementDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)PopulateSwitch\CSharpPopulateSwitchStatementDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\Helpers\UseExpressionBodyForAccessorsHelper.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\Helpers\UseExpressionBodyForConstructorsHelper.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\Helpers\UseExpressionBodyForConversionOperatorsHelper.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\Helpers\UseExpressionBodyForIndexersHelper.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\Helpers\UseExpressionBodyForMethodsHelper.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\Helpers\UseExpressionBodyForOperatorsHelper.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\Helpers\UseExpressionBodyHelper.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs"
/>
...
...
src/
Features/CSharp/Portable
/UseExpressionBody/Helpers/UseExpressionBodyForAccessorsHelper.cs
→
src/
Analyzers/CSharp/Analyzers
/UseExpressionBody/Helpers/UseExpressionBodyForAccessorsHelper.cs
浏览文件 @
3c477bf6
...
@@ -3,10 +3,15 @@
...
@@ -3,10 +3,15 @@
// See the LICENSE file in the project root for more information.
// See the LICENSE file in the project root for more information.
using
System.Collections.Immutable
;
using
System.Collections.Immutable
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
#else
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
#endif
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
{
{
internal
class
UseExpressionBodyForAccessorsHelper
:
internal
class
UseExpressionBodyForAccessorsHelper
:
...
@@ -16,8 +21,8 @@ internal class UseExpressionBodyForAccessorsHelper :
...
@@ -16,8 +21,8 @@ internal class UseExpressionBodyForAccessorsHelper :
private
UseExpressionBodyForAccessorsHelper
()
private
UseExpressionBodyForAccessorsHelper
()
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForAccessorsDiagnosticId
,
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForAccessorsDiagnosticId
,
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_expression_body_for_accessors
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_expression_body_for_accessors
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_block_body_for_accessors
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_block_body_for_accessors
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
CSharpCodeStyleOptions
.
PreferExpressionBodiedAccessors
,
ImmutableArray
.
Create
(
SyntaxKind
.
GetAccessorDeclaration
,
SyntaxKind
.
SetAccessorDeclaration
))
ImmutableArray
.
Create
(
SyntaxKind
.
GetAccessorDeclaration
,
SyntaxKind
.
SetAccessorDeclaration
))
{
{
...
...
src/
Features/CSharp/Portable
/UseExpressionBody/Helpers/UseExpressionBodyForConstructorsHelper.cs
→
src/
Analyzers/CSharp/Analyzers
/UseExpressionBody/Helpers/UseExpressionBodyForConstructorsHelper.cs
浏览文件 @
3c477bf6
...
@@ -3,10 +3,15 @@
...
@@ -3,10 +3,15 @@
// See the LICENSE file in the project root for more information.
// See the LICENSE file in the project root for more information.
using
System.Collections.Immutable
;
using
System.Collections.Immutable
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
#else
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
#endif
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
{
{
internal
class
UseExpressionBodyForConstructorsHelper
:
internal
class
UseExpressionBodyForConstructorsHelper
:
...
@@ -16,8 +21,8 @@ internal class UseExpressionBodyForConstructorsHelper :
...
@@ -16,8 +21,8 @@ internal class UseExpressionBodyForConstructorsHelper :
private
UseExpressionBodyForConstructorsHelper
()
private
UseExpressionBodyForConstructorsHelper
()
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForConstructorsDiagnosticId
,
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForConstructorsDiagnosticId
,
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_expression_body_for_constructors
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_expression_body_for_constructors
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_block_body_for_constructors
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_block_body_for_constructors
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
CSharpCodeStyleOptions
.
PreferExpressionBodiedConstructors
,
ImmutableArray
.
Create
(
SyntaxKind
.
ConstructorDeclaration
))
ImmutableArray
.
Create
(
SyntaxKind
.
ConstructorDeclaration
))
{
{
...
...
src/
Features/CSharp/Portable
/UseExpressionBody/Helpers/UseExpressionBodyForConversionOperatorsHelper.cs
→
src/
Analyzers/CSharp/Analyzers
/UseExpressionBody/Helpers/UseExpressionBodyForConversionOperatorsHelper.cs
浏览文件 @
3c477bf6
...
@@ -3,10 +3,15 @@
...
@@ -3,10 +3,15 @@
// See the LICENSE file in the project root for more information.
// See the LICENSE file in the project root for more information.
using
System.Collections.Immutable
;
using
System.Collections.Immutable
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
#else
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
#endif
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
{
{
internal
class
UseExpressionBodyForConversionOperatorsHelper
:
internal
class
UseExpressionBodyForConversionOperatorsHelper
:
...
@@ -16,8 +21,8 @@ internal class UseExpressionBodyForConversionOperatorsHelper :
...
@@ -16,8 +21,8 @@ internal class UseExpressionBodyForConversionOperatorsHelper :
private
UseExpressionBodyForConversionOperatorsHelper
()
private
UseExpressionBodyForConversionOperatorsHelper
()
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForConversionOperatorsDiagnosticId
,
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForConversionOperatorsDiagnosticId
,
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_expression_body_for_operators
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_expression_body_for_operators
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_block_body_for_operators
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_block_body_for_operators
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
ImmutableArray
.
Create
(
SyntaxKind
.
ConversionOperatorDeclaration
))
ImmutableArray
.
Create
(
SyntaxKind
.
ConversionOperatorDeclaration
))
{
{
...
...
src/
Features/CSharp/Portable
/UseExpressionBody/Helpers/UseExpressionBodyForIndexersHelper.cs
→
src/
Analyzers/CSharp/Analyzers
/UseExpressionBody/Helpers/UseExpressionBodyForIndexersHelper.cs
浏览文件 @
3c477bf6
...
@@ -4,11 +4,17 @@
...
@@ -4,11 +4,17 @@
using
System
;
using
System
;
using
System.Collections.Immutable
;
using
System.Collections.Immutable
;
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
#endif
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
{
{
internal
class
UseExpressionBodyForIndexersHelper
:
internal
class
UseExpressionBodyForIndexersHelper
:
...
@@ -18,8 +24,8 @@ internal class UseExpressionBodyForIndexersHelper :
...
@@ -18,8 +24,8 @@ internal class UseExpressionBodyForIndexersHelper :
private
UseExpressionBodyForIndexersHelper
()
private
UseExpressionBodyForIndexersHelper
()
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForIndexersDiagnosticId
,
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForIndexersDiagnosticId
,
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_expression_body_for_indexers
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_expression_body_for_indexers
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_block_body_for_indexers
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_block_body_for_indexers
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
CSharpCodeStyleOptions
.
PreferExpressionBodiedIndexers
,
ImmutableArray
.
Create
(
SyntaxKind
.
IndexerDeclaration
))
ImmutableArray
.
Create
(
SyntaxKind
.
IndexerDeclaration
))
{
{
...
...
src/
Features/CSharp/Portable
/UseExpressionBody/Helpers/UseExpressionBodyForLocalFunctionHelper.cs
→
src/
Analyzers/CSharp/Analyzers
/UseExpressionBody/Helpers/UseExpressionBodyForLocalFunctionHelper.cs
浏览文件 @
3c477bf6
...
@@ -3,11 +3,16 @@
...
@@ -3,11 +3,16 @@
// See the LICENSE file in the project root for more information.
// See the LICENSE file in the project root for more information.
using
System.Collections.Immutable
;
using
System.Collections.Immutable
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.Extensions
;
using
Microsoft.CodeAnalysis.CSharp.Extensions
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
#else
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
#endif
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
{
{
internal
class
UseExpressionBodyForLocalFunctionHelper
:
internal
class
UseExpressionBodyForLocalFunctionHelper
:
...
@@ -17,8 +22,8 @@ internal class UseExpressionBodyForLocalFunctionHelper :
...
@@ -17,8 +22,8 @@ internal class UseExpressionBodyForLocalFunctionHelper :
private
UseExpressionBodyForLocalFunctionHelper
()
private
UseExpressionBodyForLocalFunctionHelper
()
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForLocalFunctionsDiagnosticId
,
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForLocalFunctionsDiagnosticId
,
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_expression_body_for_local_functions
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_expression_body_for_local_functions
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_block_body_for_local_functions
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_block_body_for_local_functions
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
CSharpCodeStyleOptions
.
PreferExpressionBodiedLocalFunctions
,
CSharpCodeStyleOptions
.
PreferExpressionBodiedLocalFunctions
,
ImmutableArray
.
Create
(
SyntaxKind
.
LocalFunctionStatement
))
ImmutableArray
.
Create
(
SyntaxKind
.
LocalFunctionStatement
))
{
{
...
...
src/
Features/CSharp/Portable
/UseExpressionBody/Helpers/UseExpressionBodyForMethodsHelper.cs
→
src/
Analyzers/CSharp/Analyzers
/UseExpressionBody/Helpers/UseExpressionBodyForMethodsHelper.cs
浏览文件 @
3c477bf6
...
@@ -3,11 +3,16 @@
...
@@ -3,11 +3,16 @@
// See the LICENSE file in the project root for more information.
// See the LICENSE file in the project root for more information.
using
System.Collections.Immutable
;
using
System.Collections.Immutable
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.Extensions
;
using
Microsoft.CodeAnalysis.CSharp.Extensions
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
#else
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
#endif
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
{
{
internal
class
UseExpressionBodyForMethodsHelper
:
internal
class
UseExpressionBodyForMethodsHelper
:
...
@@ -17,8 +22,8 @@ internal class UseExpressionBodyForMethodsHelper :
...
@@ -17,8 +22,8 @@ internal class UseExpressionBodyForMethodsHelper :
private
UseExpressionBodyForMethodsHelper
()
private
UseExpressionBodyForMethodsHelper
()
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForMethodsDiagnosticId
,
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForMethodsDiagnosticId
,
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_expression_body_for_methods
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_expression_body_for_methods
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_block_body_for_methods
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_block_body_for_methods
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
CSharpCodeStyleOptions
.
PreferExpressionBodiedMethods
,
ImmutableArray
.
Create
(
SyntaxKind
.
MethodDeclaration
))
ImmutableArray
.
Create
(
SyntaxKind
.
MethodDeclaration
))
{
{
...
...
src/
Features/CSharp/Portable
/UseExpressionBody/Helpers/UseExpressionBodyForOperatorsHelper.cs
→
src/
Analyzers/CSharp/Analyzers
/UseExpressionBody/Helpers/UseExpressionBodyForOperatorsHelper.cs
浏览文件 @
3c477bf6
...
@@ -3,10 +3,15 @@
...
@@ -3,10 +3,15 @@
// See the LICENSE file in the project root for more information.
// See the LICENSE file in the project root for more information.
using
System.Collections.Immutable
;
using
System.Collections.Immutable
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
#else
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
#endif
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
{
{
internal
class
UseExpressionBodyForOperatorsHelper
:
internal
class
UseExpressionBodyForOperatorsHelper
:
...
@@ -16,8 +21,8 @@ internal class UseExpressionBodyForOperatorsHelper :
...
@@ -16,8 +21,8 @@ internal class UseExpressionBodyForOperatorsHelper :
private
UseExpressionBodyForOperatorsHelper
()
private
UseExpressionBodyForOperatorsHelper
()
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForOperatorsDiagnosticId
,
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForOperatorsDiagnosticId
,
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_expression_body_for_operators
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_expression_body_for_operators
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_block_body_for_operators
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_block_body_for_operators
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
CSharpCodeStyleOptions
.
PreferExpressionBodiedOperators
,
ImmutableArray
.
Create
(
SyntaxKind
.
OperatorDeclaration
))
ImmutableArray
.
Create
(
SyntaxKind
.
OperatorDeclaration
))
{
{
...
...
src/
Features/CSharp/Portable
/UseExpressionBody/Helpers/UseExpressionBodyForPropertiesHelper.cs
→
src/
Analyzers/CSharp/Analyzers
/UseExpressionBody/Helpers/UseExpressionBodyForPropertiesHelper.cs
浏览文件 @
3c477bf6
...
@@ -4,11 +4,17 @@
...
@@ -4,11 +4,17 @@
using
System
;
using
System
;
using
System.Collections.Immutable
;
using
System.Collections.Immutable
;
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
#endif
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
{
{
internal
class
UseExpressionBodyForPropertiesHelper
:
internal
class
UseExpressionBodyForPropertiesHelper
:
...
@@ -18,8 +24,8 @@ internal class UseExpressionBodyForPropertiesHelper :
...
@@ -18,8 +24,8 @@ internal class UseExpressionBodyForPropertiesHelper :
private
UseExpressionBodyForPropertiesHelper
()
private
UseExpressionBodyForPropertiesHelper
()
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForPropertiesDiagnosticId
,
:
base
(
IDEDiagnosticIds
.
UseExpressionBodyForPropertiesDiagnosticId
,
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_expression_body_for_properties
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_expression_body_for_properties
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Use_block_body_for_properties
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
CSharpAnalyzersResources
.
Use_block_body_for_properties
),
CSharpAnalyzersResources
.
ResourceManager
,
typeof
(
CSharpAnalyzer
sResources
)),
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
CSharpCodeStyleOptions
.
PreferExpressionBodiedProperties
,
ImmutableArray
.
Create
(
SyntaxKind
.
PropertyDeclaration
))
ImmutableArray
.
Create
(
SyntaxKind
.
PropertyDeclaration
))
{
{
...
...
src/
Features/CSharp/Portable
/UseExpressionBody/Helpers/UseExpressionBodyHelper.cs
→
src/
Analyzers/CSharp/Analyzers
/UseExpressionBody/Helpers/UseExpressionBodyHelper.cs
浏览文件 @
3c477bf6
...
@@ -3,9 +3,15 @@
...
@@ -3,9 +3,15 @@
// See the LICENSE file in the project root for more information.
// See the LICENSE file in the project root for more information.
using
System.Collections.Immutable
;
using
System.Collections.Immutable
;
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
#if CODE_STYLE
using
OptionSet
=
Microsoft
.
CodeAnalysis
.
Diagnostics
.
AnalyzerConfigOptions
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Options
;
#endif
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
{
{
...
...
src/
Features/CSharp/Portable
/UseExpressionBody/Helpers/UseExpressionBodyHelper`1.cs
→
src/
Analyzers/CSharp/Analyzers
/UseExpressionBody/Helpers/UseExpressionBodyHelper`1.cs
浏览文件 @
3c477bf6
...
@@ -5,19 +5,25 @@
...
@@ -5,19 +5,25 @@
using
System
;
using
System
;
using
System.Collections.Immutable
;
using
System.Collections.Immutable
;
using
System.Linq
;
using
System.Linq
;
using
Microsoft.CodeAnalysis.CodeRefactorings
;
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.Extensions
;
using
Microsoft.CodeAnalysis.CSharp.Extensions
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.CSharp.Syntax
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
#if CODE_STYLE
using
OptionSet
=
Microsoft
.
CodeAnalysis
.
Diagnostics
.
AnalyzerConfigOptions
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Options
;
#endif
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
{
{
/// <summary>
/// <summary>
/// Helper class that allows us to share lots of logic between the diagnostic analyzer and the
/// Helper class that allows us to share lots of logic between the diagnostic analyzer and the
/// code refactoring provider. Those can't share a common base class due to their own inheritance
/// code refactoring provider. Those can't share a common base class due to their own inheritance
/// requirements with <see cref="DiagnosticAnalyzer"/> and
<see cref="CodeRefactoringProvider"/>
.
/// requirements with <see cref="DiagnosticAnalyzer"/> and
"CodeRefactoringProvider"
.
/// </summary>
/// </summary>
internal
abstract
class
UseExpressionBodyHelper
<
TDeclaration
>
:
UseExpressionBodyHelper
internal
abstract
class
UseExpressionBodyHelper
<
TDeclaration
>
:
UseExpressionBodyHelper
where
TDeclaration
:
SyntaxNode
where
TDeclaration
:
SyntaxNode
...
...
src/
Features/CSharp/Portable
/UseExpressionBody/UseExpressionBodyDiagnosticAnalyzer.cs
→
src/
Analyzers/CSharp/Analyzers
/UseExpressionBody/UseExpressionBodyDiagnosticAnalyzer.cs
浏览文件 @
3c477bf6
...
@@ -2,13 +2,17 @@
...
@@ -2,13 +2,17 @@
// The .NET Foundation licenses this file to you under the MIT license.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// See the LICENSE file in the project root for more information.
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Immutable
;
using
System.Collections.Immutable
;
using
System.Linq
;
using
System.Linq
;
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
#if CODE_STYLE
using
OptionSet
=
Microsoft
.
CodeAnalysis
.
Diagnostics
.
AnalyzerConfigOptions
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Options
;
#endif
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
namespace
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
{
{
...
@@ -50,7 +54,7 @@ private void AnalyzeSyntax(SyntaxNodeAnalysisContext context)
...
@@ -50,7 +54,7 @@ private void AnalyzeSyntax(SyntaxNodeAnalysisContext context)
var
options
=
context
.
Options
;
var
options
=
context
.
Options
;
var
syntaxTree
=
context
.
Node
.
SyntaxTree
;
var
syntaxTree
=
context
.
Node
.
SyntaxTree
;
var
cancellationToken
=
context
.
CancellationToken
;
var
cancellationToken
=
context
.
CancellationToken
;
var
optionSet
=
options
.
GetAnalyzerOptionSet
Async
(
syntaxTree
,
cancellationToken
).
GetAwaiter
().
GetResult
(
);
var
optionSet
=
options
.
GetAnalyzerOptionSet
(
syntaxTree
,
cancellationToken
);
var
nodeKind
=
context
.
Node
.
Kind
();
var
nodeKind
=
context
.
Node
.
Kind
();
...
...
src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
浏览文件 @
3c477bf6
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsCodeFixProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsCodeFixProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedMembers\CSharpRemoveUnusedMembersCodeFixProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedMembers\CSharpRemoveUnusedMembersCodeFixProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\UseExpressionBodyCodeFixProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs"
/>
</ItemGroup>
</ItemGroup>
...
...
src/
Features/CSharp/Portable
/UseExpressionBody/UseExpressionBodyCodeFixProvider.cs
→
src/
Analyzers/CSharp/CodeFixes
/UseExpressionBody/UseExpressionBodyCodeFixProvider.cs
浏览文件 @
3c477bf6
...
@@ -44,12 +44,18 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
...
@@ -44,12 +44,18 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
var
diagnostic
=
context
.
Diagnostics
.
First
();
var
diagnostic
=
context
.
Diagnostics
.
First
();
var
documentOptionSet
=
await
context
.
Document
.
GetOptionsAsync
(
context
.
CancellationToken
).
ConfigureAwait
(
false
);
var
documentOptionSet
=
await
context
.
Document
.
GetOptionsAsync
(
context
.
CancellationToken
).
ConfigureAwait
(
false
);
#if CODE_STYLE // 'CodeActionPriority' is not a public API, hence not supported in CodeStyle layer.
var
codeAction
=
new
MyCodeAction
(
diagnostic
.
GetMessage
(),
c
=>
FixAsync
(
context
.
Document
,
diagnostic
,
c
));
#else
var
priority
=
diagnostic
.
Severity
==
DiagnosticSeverity
.
Hidden
var
priority
=
diagnostic
.
Severity
==
DiagnosticSeverity
.
Hidden
?
CodeActionPriority
.
Low
?
CodeActionPriority
.
Low
:
CodeActionPriority
.
Medium
;
:
CodeActionPriority
.
Medium
;
var
codeAction
=
new
MyCodeAction
(
diagnostic
.
GetMessage
(),
priority
,
c
=>
FixAsync
(
context
.
Document
,
diagnostic
,
c
));
#endif
context
.
RegisterCodeFix
(
context
.
RegisterCodeFix
(
new
MyCodeAction
(
diagnostic
.
GetMessage
(),
priority
,
c
=>
FixAsync
(
context
.
Document
,
diagnostic
,
c
))
,
codeAction
,
diagnostic
);
diagnostic
);
}
}
...
@@ -96,8 +102,14 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
...
@@ -96,8 +102,14 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
}
}
}
}
private
class
MyCodeAction
:
C
odeAction
.
DocumentChangeAction
private
class
MyCodeAction
:
C
ustomCodeActions
.
DocumentChangeAction
{
{
#if CODE_STYLE // 'CodeActionPriority' is not a public API, hence not supported in CodeStyle layer.
public
MyCodeAction
(
string
title
,
Func
<
CancellationToken
,
Task
<
Document
>>
createChangedDocument
)
:
base
(
title
,
createChangedDocument
)
{
}
#else
internal
override
CodeActionPriority
Priority
{
get
;
}
internal
override
CodeActionPriority
Priority
{
get
;
}
public
MyCodeAction
(
string
title
,
CodeActionPriority
priority
,
Func
<
CancellationToken
,
Task
<
Document
>>
createChangedDocument
)
public
MyCodeAction
(
string
title
,
CodeActionPriority
priority
,
Func
<
CancellationToken
,
Task
<
Document
>>
createChangedDocument
)
...
@@ -105,6 +117,7 @@ public MyCodeAction(string title, CodeActionPriority priority, Func<Cancellation
...
@@ -105,6 +117,7 @@ public MyCodeAction(string title, CodeActionPriority priority, Func<Cancellation
{
{
this
.
Priority
=
priority
;
this
.
Priority
=
priority
;
}
}
#endif
}
}
}
}
}
}
src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems
浏览文件 @
3c477bf6
...
@@ -11,6 +11,14 @@
...
@@ -11,6 +11,14 @@
<ItemGroup>
<ItemGroup>
<Compile
Include=
"$(MSBuildThisFileDirectory)AddBraces\AddBracesFixAllTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)AddBraces\AddBracesFixAllTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)AddBraces\AddBracesTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)AddBraces\AddBracesTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\UseExpressionBodyForAccessorsAnalyzerTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\UseExpressionBodyForConstructorsAnalyzerTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\UseExpressionBodyForConversionOperatorsAnalyzerTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\UseExpressionBodyForIndexersAnalyzerTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\UseExpressionBodyForLocalFunctionsAnalyzerTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\UseExpressionBodyForMethodsAnalyzerTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\UseExpressionBodyForOperatorsAnalyzerTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseExpressionBody\UseExpressionBodyForPropertiesAnalyzerTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionFixAllTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionFixAllTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)FileHeaders\FileHeaderTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)FileHeaders\FileHeaderTests.cs"
/>
...
...
src/
EditorFeatures/CSharpTest/UseExpressionBody/Analyzer
/UseExpressionBodyForAccessorsAnalyzerTests.cs
→
src/
Analyzers/CSharp/Tests/UseExpressionBody
/UseExpressionBodyForAccessorsAnalyzerTests.cs
浏览文件 @
3c477bf6
...
@@ -5,17 +5,23 @@
...
@@ -5,17 +5,23 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp
;
using
Microsoft.CodeAnalysis.CSharp
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Roslyn.Test.Utilities
;
using
Roslyn.Test.Utilities
;
using
Xunit
;
using
Xunit
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.Options
;
#endif
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
{
{
public
class
UseExpressionBodyForAccessorsTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
public
class
UseExpressionBodyForAccessorsTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
...
...
src/
EditorFeatures/CSharpTest/UseExpressionBody/Analyzer
/UseExpressionBodyForConstructorsAnalyzerTests.cs
→
src/
Analyzers/CSharp/Tests/UseExpressionBody
/UseExpressionBodyForConstructorsAnalyzerTests.cs
浏览文件 @
3c477bf6
...
@@ -6,15 +6,21 @@
...
@@ -6,15 +6,21 @@
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CSharp
;
using
Microsoft.CodeAnalysis.CSharp
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Roslyn.Test.Utilities
;
using
Roslyn.Test.Utilities
;
using
Xunit
;
using
Xunit
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.Options
;
#endif
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
{
{
public
class
UseExpressionBodyForConstructorsAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
public
class
UseExpressionBodyForConstructorsAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
...
...
src/
EditorFeatures/CSharpTest/UseExpressionBody/Analyzer
/UseExpressionBodyForConversionOperatorsAnalyzerTests.cs
→
src/
Analyzers/CSharp/Tests/UseExpressionBody
/UseExpressionBodyForConversionOperatorsAnalyzerTests.cs
浏览文件 @
3c477bf6
...
@@ -5,14 +5,20 @@
...
@@ -5,14 +5,20 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Xunit
;
using
Xunit
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.Options
;
#endif
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
{
{
public
class
UseExpressionBodyForConversionOperatorsAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
public
class
UseExpressionBodyForConversionOperatorsAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
...
...
src/
EditorFeatures/CSharpTest/UseExpressionBody/Analyzer
/UseExpressionBodyForIndexersAnalyzerTests.cs
→
src/
Analyzers/CSharp/Tests/UseExpressionBody
/UseExpressionBodyForIndexersAnalyzerTests.cs
浏览文件 @
3c477bf6
...
@@ -5,15 +5,21 @@
...
@@ -5,15 +5,21 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Roslyn.Test.Utilities
;
using
Roslyn.Test.Utilities
;
using
Xunit
;
using
Xunit
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.Options
;
#endif
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
{
{
public
class
UseExpressionBodyForIndexersAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
public
class
UseExpressionBodyForIndexersAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
...
...
src/
EditorFeatures/CSharpTest/UseExpressionBody/Analyzer
/UseExpressionBodyForLocalFunctionsAnalyzerTests.cs
→
src/
Analyzers/CSharp/Tests/UseExpressionBody
/UseExpressionBodyForLocalFunctionsAnalyzerTests.cs
浏览文件 @
3c477bf6
...
@@ -5,15 +5,20 @@
...
@@ -5,15 +5,20 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Roslyn.Test.Utilities
;
using
Xunit
;
using
Xunit
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.Options
;
#endif
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
{
{
public
class
UseExpressionBodyForLocalFunctionsAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
public
class
UseExpressionBodyForLocalFunctionsAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
...
...
src/
EditorFeatures/CSharpTest/UseExpressionBody/Analyzer
/UseExpressionBodyForMethodsAnalyzerTests.cs
→
src/
Analyzers/CSharp/Tests/UseExpressionBody
/UseExpressionBodyForMethodsAnalyzerTests.cs
浏览文件 @
3c477bf6
...
@@ -5,17 +5,23 @@
...
@@ -5,17 +5,23 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp
;
using
Microsoft.CodeAnalysis.CSharp
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Roslyn.Test.Utilities
;
using
Roslyn.Test.Utilities
;
using
Xunit
;
using
Xunit
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.Options
;
#endif
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
{
{
public
class
UseExpressionBodyForMethodsAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
public
class
UseExpressionBodyForMethodsAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
...
...
src/
EditorFeatures/CSharpTest/UseExpressionBody/Analyzer
/UseExpressionBodyForOperatorsAnalyzerTests.cs
→
src/
Analyzers/CSharp/Tests/UseExpressionBody
/UseExpressionBodyForOperatorsAnalyzerTests.cs
浏览文件 @
3c477bf6
...
@@ -5,14 +5,20 @@
...
@@ -5,14 +5,20 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Xunit
;
using
Xunit
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.Options
;
#endif
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
{
{
public
class
UseExpressionBodyForOperatorsAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
public
class
UseExpressionBodyForOperatorsAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
...
...
src/
EditorFeatures/CSharpTest/UseExpressionBody/Analyzer
/UseExpressionBodyForPropertiesAnalyzerTests.cs
→
src/
Analyzers/CSharp/Tests/UseExpressionBody
/UseExpressionBodyForPropertiesAnalyzerTests.cs
浏览文件 @
3c477bf6
...
@@ -6,15 +6,21 @@
...
@@ -6,15 +6,21 @@
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CSharp
;
using
Microsoft.CodeAnalysis.CSharp
;
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.CSharp.UseExpressionBody
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.Options
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Microsoft.CodeAnalysis.Test.Utilities
;
using
Roslyn.Test.Utilities
;
using
Roslyn.Test.Utilities
;
using
Xunit
;
using
Xunit
;
#if CODE_STYLE
using
Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle
;
using
Microsoft.CodeAnalysis.Internal.Options
;
#else
using
Microsoft.CodeAnalysis.CSharp.CodeStyle
;
using
Microsoft.CodeAnalysis.Options
;
#endif
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
namespace
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseExpressionBody
{
{
public
class
UseExpressionBodyForPropertiesAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
public
class
UseExpressionBodyForPropertiesAnalyzerTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录