Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
b1d5b2bd
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,发现更多精彩内容 >>
提交
b1d5b2bd
编写于
3月 05, 2020
作者:
M
Manish Vasani
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move analyzer, code fixer and unit tests to shared layer
上级
e2c7e337
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
18 addition
and
12 deletion
+18
-12
src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
+1
-0
src/Analyzers/CSharp/Analyzers/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs
...saryCast/CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs
+0
-0
src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
+1
-0
src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastCodeFixProvider.cs
...cessaryCast/CSharpRemoveUnnecessaryCastCodeFixProvider.cs
+2
-2
src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems
...nalyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems
+2
-0
src/Analyzers/CSharp/Tests/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests.cs
...Tests/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests.cs
+0
-0
src/Analyzers/CSharp/Tests/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests_FixAllTests.cs
...UnnecessaryCast/RemoveUnnecessaryCastTests_FixAllTests.cs
+0
-0
src/Analyzers/Core/Analyzers/Analyzers.projitems
src/Analyzers/Core/Analyzers/Analyzers.projitems
+1
-0
src/Analyzers/Core/Analyzers/AnalyzersResources.resx
src/Analyzers/Core/Analyzers/AnalyzersResources.resx
+3
-0
src/Analyzers/Core/Analyzers/RemoveUnnecessaryCast/AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs
...ryCast/AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs
+2
-2
src/Analyzers/VisualBasic/Analyzers/RemoveUnnecessaryCast/VisualBasicRemoveUnnecessaryCastDiagnosticAnalyzer.vb
...ast/VisualBasicRemoveUnnecessaryCastDiagnosticAnalyzer.vb
+0
-0
src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems
...zers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems
+1
-0
src/Analyzers/VisualBasic/CodeFixes/RemoveUnnecessaryCast/VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb
...ryCast/VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb
+2
-2
src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems
...zers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems
+1
-0
src/Analyzers/VisualBasic/Tests/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests.vb
...Tests/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests.vb
+0
-0
src/Analyzers/VisualBasic/Tests/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests_FixAllTests.vb
...UnnecessaryCast/RemoveUnnecessaryCastTests_FixAllTests.vb
+0
-0
src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems
...isualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems
+2
-0
src/Features/Core/Portable/FeaturesResources.resx
src/Features/Core/Portable/FeaturesResources.resx
+0
-3
src/Workspaces/Core/Portable/WorkspacesResources.resx
src/Workspaces/Core/Portable/WorkspacesResources.resx
+0
-3
未找到文件。
src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
浏览文件 @
b1d5b2bd
...
...
@@ -16,6 +16,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionConstants.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedMembers\CSharpRemoveUnusedMembersDiagnosticAnalyzer.cs"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/
Features/CSharp/Portable
/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs
→
src/
Analyzers/CSharp/Analyzers
/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs
浏览文件 @
b1d5b2bd
文件已移动
src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
浏览文件 @
b1d5b2bd
...
...
@@ -15,6 +15,7 @@
<ItemGroup>
<Compile
Include=
"$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedMembers\CSharpRemoveUnusedMembersCodeFixProvider.cs"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/
Features/CSharp/Portable
/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastCodeFixProvider.cs
→
src/
Analyzers/CSharp/CodeFixes
/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastCodeFixProvider.cs
浏览文件 @
b1d5b2bd
...
...
@@ -40,7 +40,7 @@ public CSharpRemoveUnnecessaryCastCodeFixProvider()
public
sealed
override
Task
RegisterCodeFixesAsync
(
CodeFixContext
context
)
{
context
.
RegisterCodeFix
(
new
MyCodeAction
(
Feature
sResources
.
Remove_Unnecessary_Cast
,
Analyzer
sResources
.
Remove_Unnecessary_Cast
,
c
=>
FixAsync
(
context
.
Document
,
context
.
Diagnostics
.
First
(),
c
)),
context
.
Diagnostics
);
return
Task
.
CompletedTask
;
...
...
@@ -90,7 +90,7 @@ private ExpressionSyntax Recurse(ExpressionSyntax old)
}
}
private
class
MyCodeAction
:
C
odeAction
.
DocumentChangeAction
private
class
MyCodeAction
:
C
ustomCodeActions
.
DocumentChangeAction
{
public
MyCodeAction
(
string
title
,
Func
<
CancellationToken
,
Task
<
Document
>>
createChangedDocument
)
:
base
(
title
,
createChangedDocument
)
...
...
src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems
浏览文件 @
b1d5b2bd
...
...
@@ -11,6 +11,8 @@
<ItemGroup>
<Compile
Include=
"$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionFixAllTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryCast\RemoveUnnecessaryCastTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryCast\RemoveUnnecessaryCastTests_FixAllTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedMembers\RemoveUnusedMembersTests.cs"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/
EditorFeatures/CSharpTest
/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests.cs
→
src/
Analyzers/CSharp/Tests
/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests.cs
浏览文件 @
b1d5b2bd
文件已移动
src/
EditorFeatures/CSharpTest
/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests_FixAllTests.cs
→
src/
Analyzers/CSharp/Tests
/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests_FixAllTests.cs
浏览文件 @
b1d5b2bd
文件已移动
src/Analyzers/Core/Analyzers/Analyzers.projitems
浏览文件 @
b1d5b2bd
...
...
@@ -25,6 +25,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)IBuiltInAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)IDEDiagnosticIds.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)IDEDiagnosticIdToOptionMappingHelper.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/Analyzers/Core/Analyzers/AnalyzersResources.resx
浏览文件 @
b1d5b2bd
...
...
@@ -117,6 +117,9 @@
<resheader
name=
"writer"
>
<value>
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<data
name=
"Remove_Unnecessary_Cast"
xml:space=
"preserve"
>
<value>
Remove Unnecessary Cast
</value>
</data>
<data
name=
"Remove_unused_member"
xml:space=
"preserve"
>
<value>
Remove unused member
</value>
</data>
...
...
src/
Features/Core/Portable
/RemoveUnnecessaryCast/AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs
→
src/
Analyzers/Core/Analyzers
/RemoveUnnecessaryCast/AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs
浏览文件 @
b1d5b2bd
...
...
@@ -23,8 +23,8 @@ internal abstract class AbstractRemoveUnnecessaryCastDiagnosticAnalyzer<
protected
AbstractRemoveUnnecessaryCastDiagnosticAnalyzer
()
:
base
(
IDEDiagnosticIds
.
RemoveUnnecessaryCastDiagnosticId
,
option
:
null
,
new
LocalizableResourceString
(
nameof
(
FeaturesResources
.
Remove_Unnecessary_Cast
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
)),
new
LocalizableResourceString
(
nameof
(
WorkspacesResources
.
Cast_is_redundant
),
WorkspacesResources
.
ResourceManager
,
typeof
(
Workspace
sResources
)))
new
LocalizableResourceString
(
nameof
(
AnalyzersResources
.
Remove_Unnecessary_Cast
),
AnalyzersResources
.
ResourceManager
,
typeof
(
Analyzer
sResources
)),
new
LocalizableResourceString
(
nameof
(
CompilerExtensionsResources
.
Cast_is_redundant
),
CompilerExtensionsResources
.
ResourceManager
,
typeof
(
CompilerExtension
sResources
)))
{
}
...
...
src/
Features/VisualBasic/Portable
/RemoveUnnecessaryCast/VisualBasicRemoveUnnecessaryCastDiagnosticAnalyzer.vb
→
src/
Analyzers/VisualBasic/Analyzers
/RemoveUnnecessaryCast/VisualBasicRemoveUnnecessaryCastDiagnosticAnalyzer.vb
浏览文件 @
b1d5b2bd
文件已移动
src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems
浏览文件 @
b1d5b2bd
...
...
@@ -13,6 +13,7 @@
<None
Include=
"$(MSBuildThisFileDirectory)VisualBasicAnalyzersResources.resx"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastDiagnosticAnalyzer.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/
Features/VisualBasic/Portable
/RemoveUnnecessaryCast/VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb
→
src/
Analyzers/VisualBasic/CodeFixes
/RemoveUnnecessaryCast/VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb
浏览文件 @
b1d5b2bd
...
...
@@ -36,7 +36,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessaryCast
Public
Overrides
Function
RegisterCodeFixesAsync
(
context
As
CodeFixContext
)
As
Task
context
.
RegisterCodeFix
(
New
MyCodeAction
(
Feature
sResources
.
Remove_Unnecessary_Cast
,
Analyzer
sResources
.
Remove_Unnecessary_Cast
,
Function
(
c
)
FixAsync
(
context
.
Document
,
context
.
Diagnostics
.
First
(),
c
)),
context
.
Diagnostics
)
Return
Task
.
CompletedTask
...
...
@@ -169,7 +169,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessaryCast
End
Function
Private
Class
MyCodeAction
Inherits
C
odeAction
.
DocumentChangeAction
Inherits
C
ustomCodeActions
.
DocumentChangeAction
Public
Sub
New
(
title
As
String
,
createChangedDocument
As
Func
(
Of
CancellationToken
,
Task
(
Of
Document
)))
MyBase
.
New
(
title
,
createChangedDocument
)
...
...
src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems
浏览文件 @
b1d5b2bd
...
...
@@ -13,6 +13,7 @@
<None
Include=
"$(MSBuildThisFileDirectory)VisualBasicCodeFixesResources.resx"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedMembers\VisualBasicRemoveUnusedMembersCodeFixProvider.vb"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/
EditorFeatures/VisualBasicTest
/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests.vb
→
src/
Analyzers/VisualBasic/Tests
/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests.vb
浏览文件 @
b1d5b2bd
文件已移动
src/
EditorFeatures/VisualBasicTest
/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests_FixAllTests.vb
→
src/
Analyzers/VisualBasic/Tests
/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests_FixAllTests.vb
浏览文件 @
b1d5b2bd
文件已移动
src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems
浏览文件 @
b1d5b2bd
...
...
@@ -9,6 +9,8 @@
<Import_RootNamespace>
Microsoft.CodeAnalysis.VisualBasic.Analyzers.UnitTests
</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryCast\RemoveUnnecessaryCastTests.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnnecessaryCast\RemoveUnnecessaryCastTests_FixAllTests.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedMembers\RemoveUnusedMembersTests.vb"
/>
</ItemGroup>
</Project>
\ No newline at end of file
src/Features/Core/Portable/FeaturesResources.resx
浏览文件 @
b1d5b2bd
...
...
@@ -643,9 +643,6 @@ Do you want to continue?</value>
<value>
Analyzer '{0}' threw the following exception:
'{1}'.
</value>
</data>
<data
name=
"Remove_Unnecessary_Cast"
xml:space=
"preserve"
>
<value>
Remove Unnecessary Cast
</value>
</data>
<data
name=
"Simplify_Names"
xml:space=
"preserve"
>
<value>
Simplify Names
</value>
</data>
...
...
src/Workspaces/Core/Portable/WorkspacesResources.resx
浏览文件 @
b1d5b2bd
...
...
@@ -291,9 +291,6 @@
<data
name=
"Specified_path_must_be_absolute"
xml:space=
"preserve"
>
<value>
Specified path must be absolute.
</value>
</data>
<data
name=
"Cast_is_redundant"
xml:space=
"preserve"
>
<value>
Cast is redundant.
</value>
</data>
<data
name=
"Name_can_be_simplified"
xml:space=
"preserve"
>
<value>
Name can be simplified.
</value>
</data>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录