Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
eece9b92
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,发现更多精彩内容 >>
未验证
提交
eece9b92
编写于
4月 06, 2020
作者:
M
Manish Vasani
提交者:
GitHub
4月 06, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into PortSimplifyInterpolation
上级
c0a9025e
a5f87d42
变更
50
隐藏空白更改
内联
并排
Showing
50 changed file
with
269 addition
and
209 deletion
+269
-209
src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
+1
-0
src/Analyzers/CSharp/Analyzers/UseAutoProperty/CSharpUseAutoPropertyAnalyzer.cs
...nalyzers/UseAutoProperty/CSharpUseAutoPropertyAnalyzer.cs
+0
-0
src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems
...nalyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems
+1
-0
src/Analyzers/CSharp/Tests/UseAutoProperty/UseAutoPropertyTests.cs
...zers/CSharp/Tests/UseAutoProperty/UseAutoPropertyTests.cs
+1
-1
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/UseAutoProperty/AbstractUseAutoPropertyAnalyzer.cs
...lyzers/UseAutoProperty/AbstractUseAutoPropertyAnalyzer.cs
+2
-2
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.cs.xlf
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.cs.xlf
+5
-0
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.de.xlf
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.de.xlf
+5
-0
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.es.xlf
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.es.xlf
+5
-0
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.fr.xlf
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.fr.xlf
+5
-0
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.it.xlf
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.it.xlf
+5
-0
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ja.xlf
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ja.xlf
+5
-0
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ko.xlf
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ko.xlf
+5
-0
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pl.xlf
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pl.xlf
+5
-0
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pt-BR.xlf
...Analyzers/Core/Analyzers/xlf/AnalyzersResources.pt-BR.xlf
+5
-0
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ru.xlf
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ru.xlf
+5
-0
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.tr.xlf
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.tr.xlf
+5
-0
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.zh-Hans.xlf
...alyzers/Core/Analyzers/xlf/AnalyzersResources.zh-Hans.xlf
+5
-0
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.zh-Hant.xlf
...alyzers/Core/Analyzers/xlf/AnalyzersResources.zh-Hant.xlf
+5
-0
src/Analyzers/VisualBasic/Analyzers/UseAutoProperty/Utilities.vb
...lyzers/VisualBasic/Analyzers/UseAutoProperty/Utilities.vb
+0
-0
src/Analyzers/VisualBasic/Analyzers/UseAutoProperty/VisualBasicUseAutoPropertyAnalyzer.vb
...ers/UseAutoProperty/VisualBasicUseAutoPropertyAnalyzer.vb
+1
-1
src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems
...zers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems
+2
-0
src/Analyzers/VisualBasic/Tests/UseAutoProperty/UseAutoPropertyTests.vb
...VisualBasic/Tests/UseAutoProperty/UseAutoPropertyTests.vb
+1
-1
src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems
...isualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems
+1
-0
src/Compilers/Core/Portable/CommandLine/CommonCompiler.SuppressionDiagnostic.cs
...table/CommandLine/CommonCompiler.SuppressionDiagnostic.cs
+5
-5
src/Compilers/Core/Portable/Diagnostic/Diagnostic.DiagnosticWithProgrammaticSuppression.cs
...ostic/Diagnostic.DiagnosticWithProgrammaticSuppression.cs
+5
-5
src/Compilers/Core/Portable/Diagnostic/DiagnosticDescriptor.cs
...ompilers/Core/Portable/Diagnostic/DiagnosticDescriptor.cs
+5
-0
src/Compilers/Core/Portable/Diagnostic/DiagnosticWithInfo.cs
src/Compilers/Core/Portable/Diagnostic/DiagnosticWithInfo.cs
+1
-1
src/Compilers/Core/Portable/Diagnostic/Diagnostic_SimpleDiagnostic.cs
...s/Core/Portable/Diagnostic/Diagnostic_SimpleDiagnostic.cs
+5
-0
src/Compilers/Core/Portable/DiagnosticAnalyzer/Suppression.cs
...Compilers/Core/Portable/DiagnosticAnalyzer/Suppression.cs
+32
-1
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
+5
-0
src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractDiagnosticProviderBasedUserDiagnosticTest.cs
...tics/AbstractDiagnosticProviderBasedUserDiagnosticTest.cs
+8
-0
src/Features/Core/Portable/FeaturesResources.resx
src/Features/Core/Portable/FeaturesResources.resx
+0
-3
src/Features/Core/Portable/UseAutoProperty/AbstractUseAutoPropertyCodeFixProvider.cs
...UseAutoProperty/AbstractUseAutoPropertyCodeFixProvider.cs
+2
-2
src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
+0
-5
src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
+0
-5
src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
+0
-5
src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
+0
-5
src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
+0
-5
src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
+0
-5
src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
+0
-5
src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
+0
-5
src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
+0
-5
src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
+0
-5
src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
+0
-5
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
+0
-5
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
+0
-5
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Extensions/ExpressionSyntaxExtensions.vb
...iler/VisualBasic/Extensions/ExpressionSyntaxExtensions.vb
+122
-0
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/Extensions/ExpressionSyntaxExtensions.vb
...pace/VisualBasic/Extensions/ExpressionSyntaxExtensions.vb
+0
-122
未找到文件。
src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
浏览文件 @
eece9b92
...
...
@@ -36,6 +36,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnreachableCode\RemoveUnreachableCodeHelpers.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)SimplifyInterpolation\CSharpSimplifyInterpolationDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCoalesceExpression\CSharpUseCoalesceExpressionDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCoalesceExpression\CSharpUseCoalesceExpressionForNullableDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCompoundAssignment\CSharpUseCompoundAssignmentDiagnosticAnalyzer.cs"
/>
...
...
src/
Features/CSharp/Portable
/UseAutoProperty/CSharpUseAutoPropertyAnalyzer.cs
→
src/
Analyzers/CSharp/Analyzers
/UseAutoProperty/CSharpUseAutoPropertyAnalyzer.cs
浏览文件 @
eece9b92
文件已移动
src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems
浏览文件 @
eece9b92
...
...
@@ -22,6 +22,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)OrderModifiers\OrderModifiersTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnreachableCode\RemoveUnreachableCodeTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)SimplifyInterpolation\SimplifyInterpolationTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseAutoProperty\UseAutoPropertyTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCoalesceExpression\UseCoalesceExpressionForNullableTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCoalesceExpression\UseCoalesceExpressionTests.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCompoundAssignment\UseCompoundAssignmentTests.cs"
/>
...
...
src/
EditorFeatures/CSharpTest
/UseAutoProperty/UseAutoPropertyTests.cs
→
src/
Analyzers/CSharp/Tests
/UseAutoProperty/UseAutoPropertyTests.cs
浏览文件 @
eece9b92
...
...
@@ -18,7 +18,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseAutoProperty
public
class
UseAutoPropertyTests
:
AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
{
internal
override
(
DiagnosticAnalyzer
,
CodeFixProvider
)
CreateDiagnosticProviderAndFixer
(
Workspace
workspace
)
=>
(
new
CSharpUseAutoPropertyAnalyzer
(),
new
CSharpUseAutoPropertyCodeFixProvider
());
=>
(
new
CSharpUseAutoPropertyAnalyzer
(),
Get
CSharpUseAutoPropertyCodeFixProvider
());
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsUseAutoProperty
)]
public
async
Task
TestSingleGetterFromField
()
...
...
src/Analyzers/Core/Analyzers/Analyzers.projitems
浏览文件 @
eece9b92
...
...
@@ -49,6 +49,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)SimplifyInterpolation\Helpers.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCoalesceExpression\AbstractUseCoalesceExpressionDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableDiagnosticAnalyzer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs"
/>
...
...
src/Analyzers/Core/Analyzers/AnalyzersResources.resx
浏览文件 @
eece9b92
...
...
@@ -283,6 +283,9 @@
<data
name=
"Simplify_interpolation"
xml:space=
"preserve"
>
<value>
Simplify interpolation
</value>
</data>
<data
name=
"Use_auto_property"
xml:space=
"preserve"
>
<value>
Use auto property
</value>
</data>
<data
name=
"Format_string_contains_invalid_placeholder"
xml:space=
"preserve"
>
<value>
Format string contains invalid placeholder
</value>
</data>
...
...
src/
Features/Core/Portable
/UseAutoProperty/AbstractUseAutoPropertyAnalyzer.cs
→
src/
Analyzers/Core/Analyzers
/UseAutoProperty/AbstractUseAutoPropertyAnalyzer.cs
浏览文件 @
eece9b92
...
...
@@ -20,8 +20,8 @@ internal abstract class AbstractUseAutoPropertyAnalyzer<
where
TExpression
:
SyntaxNode
{
private
static
readonly
LocalizableString
s_title
=
new
LocalizableResourceString
(
nameof
(
Feature
sResources
.
Use_auto_property
),
FeaturesResources
.
ResourceManager
,
typeof
(
Feature
sResources
));
new
LocalizableResourceString
(
nameof
(
Analyzer
sResources
.
Use_auto_property
),
AnalyzersResources
.
ResourceManager
,
typeof
(
Analyzer
sResources
));
protected
AbstractUseAutoPropertyAnalyzer
()
:
base
(
IDEDiagnosticIds
.
UseAutoPropertyDiagnosticId
,
CodeStyleOptions2
.
PreferAutoProperties
,
s_title
,
s_title
)
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.cs.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.de.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.es.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.fr.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.it.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ja.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ko.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pl.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pt-BR.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ru.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.tr.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.zh-Hans.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.zh-Hant.xlf
浏览文件 @
eece9b92
...
...
@@ -267,6 +267,11 @@
<target
state=
"new"
>
Use 'System.HashCode'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"new"
>
Use auto property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_coalesce_expression"
>
<source>
Use coalesce expression
</source>
<target
state=
"new"
>
Use coalesce expression
</target>
...
...
src/
Features/VisualBasic/Portable
/UseAutoProperty/Utilities.vb
→
src/
Analyzers/VisualBasic/Analyzers
/UseAutoProperty/Utilities.vb
浏览文件 @
eece9b92
文件已移动
src/
Features/VisualBasic/Portable
/UseAutoProperty/VisualBasicUseAutoPropertyAnalyzer.vb
→
src/
Analyzers/VisualBasic/Analyzers
/UseAutoProperty/VisualBasicUseAutoPropertyAnalyzer.vb
浏览文件 @
eece9b92
...
...
@@ -203,7 +203,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UseAutoProperty
If
node
.
Kind
()
=
SyntaxKind
.
IdentifierName
Then
Dim
symbolInfo
=
semanticModel
.
GetSymbolInfo
(
node
)
If
field
.
Equals
(
symbolInfo
.
Symbol
)
Then
If
VisualBasicSemanticFactsService
.
Instance
.
IsWrittenTo
(
semanticModel
,
node
,
cancellationToken
)
Then
If
DirectCast
(
node
,
ExpressionSyntax
).
IsWrittenTo
(
semanticModel
,
cancellationToken
)
Then
Return
True
End
If
End
If
...
...
src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems
浏览文件 @
eece9b92
...
...
@@ -29,6 +29,8 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)SimplifyInterpolation\VisualBasicSimplifyInterpolationDiagnosticAnalyzer.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseAutoProperty\Utilities.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseAutoProperty\VisualBasicUseAutoPropertyAnalyzer.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCoalesceExpression\VisualBasicUseCoalesceExpressionDiagnosticAnalyzer.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCoalesceExpression\VisualBasicUseCoalesceExpressionForNullableDiagnosticAnalyzer.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCollectionInitializer\VisualBasicUseCollectionInitializerDiagnosticAnalyzer.vb"
/>
...
...
src/
EditorFeatures/VisualBasicTest
/UseAutoProperty/UseAutoPropertyTests.vb
→
src/
Analyzers/VisualBasic/Tests
/UseAutoProperty/UseAutoPropertyTests.vb
浏览文件 @
eece9b92
...
...
@@ -13,7 +13,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.UseAutoProperty
Inherits
AbstractVisualBasicDiagnosticProviderBasedUserDiagnosticTest
Friend
Overrides
Function
CreateDiagnosticProviderAndFixer
(
workspace
As
Workspace
)
As
(
DiagnosticAnalyzer
,
CodeFixProvider
)
Return
(
New
VisualBasicUseAutoPropertyAnalyzer
(),
New
VisualBasicUseAutoPropertyCodeFixProvider
())
Return
(
New
VisualBasicUseAutoPropertyAnalyzer
(),
Get
VisualBasicUseAutoPropertyCodeFixProvider
())
End
Function
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsUseAutoProperty
)
>
...
...
src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems
浏览文件 @
eece9b92
...
...
@@ -31,6 +31,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedParametersAndValues\RemoveUnusedValueExpressionStatementTests.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)RemoveUnusedParametersAndValues\RemoveUnusedValuesTestsBase.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)SimplifyInterpolation\SimplifyInterpolationTests.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseAutoProperty\UseAutoPropertyTests.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCoalesceExpression\UseCoalesceExpressionForNullableTests.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCoalesceExpression\UseCoalesceExpressionTests.vb"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)UseCollectionInitializer\UseCollectionInitializerTests.vb"
/>
...
...
src/Compilers/Core/Portable/CommandLine/CommonCompiler.SuppressionDiagnostic.cs
浏览文件 @
eece9b92
...
...
@@ -69,15 +69,15 @@ public override string GetMessage(IFormatProvider formatProvider = null)
public
override
bool
Equals
(
Diagnostic
obj
)
{
var
other
=
obj
as
SuppressionDiagnostic
;
if
(
other
==
null
)
if
(
ReferenceEquals
(
this
,
obj
))
{
return
fals
e
;
return
tru
e
;
}
if
(
ReferenceEquals
(
this
,
other
))
var
other
=
obj
as
SuppressionDiagnostic
;
if
(
other
==
null
)
{
return
tru
e
;
return
fals
e
;
}
return
Equals
(
_originalDiagnostic
,
other
.
_originalDiagnostic
)
&&
...
...
src/Compilers/Core/Portable/Diagnostic/Diagnostic.DiagnosticWithProgrammaticSuppression.cs
浏览文件 @
eece9b92
...
...
@@ -87,15 +87,15 @@ public override IReadOnlyList<Location> AdditionalLocations
public
override
bool
Equals
(
Diagnostic
?
obj
)
{
var
other
=
obj
as
DiagnosticWithProgrammaticSuppression
;
if
(
other
==
null
)
if
(
ReferenceEquals
(
this
,
obj
))
{
return
fals
e
;
return
tru
e
;
}
if
(
ReferenceEquals
(
this
,
other
))
var
other
=
obj
as
DiagnosticWithProgrammaticSuppression
;
if
(
other
==
null
)
{
return
tru
e
;
return
fals
e
;
}
return
Equals
(
_originalUnsuppressedDiagnostic
,
other
.
_originalUnsuppressedDiagnostic
)
&&
...
...
src/Compilers/Core/Portable/Diagnostic/DiagnosticDescriptor.cs
浏览文件 @
eece9b92
...
...
@@ -173,6 +173,11 @@ public sealed class DiagnosticDescriptor : IEquatable<DiagnosticDescriptor?>
public
bool
Equals
(
DiagnosticDescriptor
?
other
)
{
if
(
ReferenceEquals
(
this
,
other
))
{
return
true
;
}
return
other
!=
null
&&
this
.
Category
==
other
.
Category
&&
...
...
src/Compilers/Core/Portable/Diagnostic/DiagnosticWithInfo.cs
浏览文件 @
eece9b92
...
...
@@ -150,7 +150,7 @@ public override bool Equals(object? obj)
public
override
bool
Equals
(
Diagnostic
?
obj
)
{
if
(
this
==
obj
)
if
(
ReferenceEquals
(
this
,
obj
)
)
{
return
true
;
}
...
...
src/Compilers/Core/Portable/Diagnostic/Diagnostic_SimpleDiagnostic.cs
浏览文件 @
eece9b92
...
...
@@ -146,6 +146,11 @@ public override IReadOnlyList<Location> AdditionalLocations
public
override
bool
Equals
(
Diagnostic
?
obj
)
{
if
(
ReferenceEquals
(
this
,
obj
))
{
return
true
;
}
var
other
=
obj
as
SimpleDiagnostic
;
if
(
other
==
null
)
{
...
...
src/Compilers/Core/Portable/DiagnosticAnalyzer/Suppression.cs
浏览文件 @
eece9b92
...
...
@@ -3,14 +3,16 @@
// See the LICENSE file in the project root for more information.
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
Roslyn.Utilities
;
namespace
Microsoft.CodeAnalysis.Diagnostics
{
/// <summary>
/// Programmatic suppression of a <see cref="Diagnostic"/> by a <see cref="DiagnosticSuppressor"/>.
/// </summary>
public
struct
Suppression
public
struct
Suppression
:
IEquatable
<
Suppression
>
{
private
Suppression
(
SuppressionDescriptor
descriptor
,
Diagnostic
suppressedDiagnostic
)
{
...
...
@@ -48,5 +50,34 @@ public static Suppression Create(SuppressionDescriptor descriptor, Diagnostic su
/// Diagnostic suppressed by this suppression.
/// </summary>
public
Diagnostic
SuppressedDiagnostic
{
get
;
}
public
static
bool
operator
==(
Suppression
left
,
Suppression
right
)
{
return
left
.
Equals
(
right
);
}
public
static
bool
operator
!=(
Suppression
left
,
Suppression
right
)
{
return
!(
left
==
right
);
}
public
override
bool
Equals
(
object
obj
)
{
return
obj
is
Suppression
suppression
&&
Equals
(
suppression
);
}
public
bool
Equals
(
Suppression
other
)
{
return
EqualityComparer
<
SuppressionDescriptor
>.
Default
.
Equals
(
Descriptor
,
other
.
Descriptor
)
&&
EqualityComparer
<
Diagnostic
>.
Default
.
Equals
(
SuppressedDiagnostic
,
other
.
SuppressedDiagnostic
);
}
public
override
int
GetHashCode
()
{
return
Hash
.
Combine
(
EqualityComparer
<
SuppressionDescriptor
>.
Default
.
GetHashCode
(
Descriptor
),
EqualityComparer
<
Diagnostic
>.
Default
.
GetHashCode
(
SuppressedDiagnostic
));
}
}
}
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
浏览文件 @
eece9b92
Microsoft.CodeAnalysis.CommandLineSourceFile.CommandLineSourceFile(string path, bool isScript, bool isInputRedirected) -> void
Microsoft.CodeAnalysis.CommandLineSourceFile.IsInputRedirected.get -> bool
Microsoft.CodeAnalysis.Diagnostics.Suppression.Equals(Microsoft.CodeAnalysis.Diagnostics.Suppression other) -> bool
Microsoft.CodeAnalysis.GeneratorAttribute
Microsoft.CodeAnalysis.GeneratorAttribute.GeneratorAttribute() -> void
Microsoft.CodeAnalysis.GeneratorDriver
...
...
@@ -26,5 +27,9 @@ Microsoft.CodeAnalysis.SourceGeneratorContext.SyntaxReceiver.get -> Microsoft.Co
Microsoft.CodeAnalysis.SyntaxNode.FirstAncestorOrSelf<TNode, TArg>(System.Func<TNode, TArg, bool> predicate, TArg argument, bool ascendOutOfTrivia = true) -> TNode
Microsoft.CodeAnalysis.SyntaxReceiverCreator
override Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.GetGenerators() -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISourceGenerator>
override Microsoft.CodeAnalysis.Diagnostics.Suppression.Equals(object obj) -> bool
override Microsoft.CodeAnalysis.Diagnostics.Suppression.GetHashCode() -> int
static Microsoft.CodeAnalysis.Diagnostics.Suppression.operator !=(Microsoft.CodeAnalysis.Diagnostics.Suppression left, Microsoft.CodeAnalysis.Diagnostics.Suppression right) -> bool
static Microsoft.CodeAnalysis.Diagnostics.Suppression.operator ==(Microsoft.CodeAnalysis.Diagnostics.Suppression left, Microsoft.CodeAnalysis.Diagnostics.Suppression right) -> bool
virtual Microsoft.CodeAnalysis.Diagnostics.AnalyzerReference.GetGenerators() -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISourceGenerator>
const Microsoft.CodeAnalysis.WellKnownDiagnosticTags.CustomObsolete = "CustomObsolete" -> string
src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractDiagnosticProviderBasedUserDiagnosticTest.cs
浏览文件 @
eece9b92
...
...
@@ -10,11 +10,13 @@
using
Microsoft.CodeAnalysis.CodeActions
;
using
Microsoft.CodeAnalysis.CodeFixes
;
using
Microsoft.CodeAnalysis.CSharp.MakeLocalFunctionStatic
;
using
Microsoft.CodeAnalysis.CSharp.UseAutoProperty
;
using
Microsoft.CodeAnalysis.Diagnostics
;
using
Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions
;
using
Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces
;
using
Microsoft.CodeAnalysis.Text
;
using
Microsoft.CodeAnalysis.UnitTests.Diagnostics
;
using
Microsoft.CodeAnalysis.VisualBasic.UseAutoProperty
;
using
Roslyn.Test.Utilities
;
using
Roslyn.Utilities
;
using
Xunit
;
...
...
@@ -238,6 +240,12 @@ private void AssertNoAnalyzerExceptionDiagnostics(IEnumerable<Diagnostic> diagno
// https://github.com/dotnet/roslyn/issues/43056 blocks porting the fixer to CodeStyle layer.
protected
static
CodeFixProvider
GetMakeLocalFunctionStaticCodeFixProvider
()
=>
new
MakeLocalFunctionStaticCodeFixProvider
();
// https://github.com/dotnet/roslyn/issues/43091 blocks porting the fixer to CodeStyle layer.
protected
static
CodeFixProvider
GetCSharpUseAutoPropertyCodeFixProvider
()
=>
new
CSharpUseAutoPropertyCodeFixProvider
();
// https://github.com/dotnet/roslyn/issues/43091 blocks porting the fixer to CodeStyle layer.
protected
static
CodeFixProvider
GetVisualBasicUseAutoPropertyCodeFixProvider
()
=>
new
VisualBasicUseAutoPropertyCodeFixProvider
();
#
endregion
}
}
src/Features/Core/Portable/FeaturesResources.resx
浏览文件 @
eece9b92
...
...
@@ -816,9 +816,6 @@ Do you want to continue?</value>
<data
name=
"attribute"
xml:space=
"preserve"
>
<value>
attribute
</value>
</data>
<data
name=
"Use_auto_property"
xml:space=
"preserve"
>
<value>
Use auto property
</value>
</data>
<data
name=
"Replace_0_and_1_with_property"
xml:space=
"preserve"
>
<value>
Replace '{0}' and '{1}' with property
</value>
</data>
...
...
src/Features/Core/Portable/UseAutoProperty/AbstractUseAutoPropertyCodeFixProvider.cs
浏览文件 @
eece9b92
...
...
@@ -55,7 +55,7 @@ public sealed override Task RegisterCodeFixesAsync(CodeFixContext context)
context
.
RegisterCodeFix
(
new
UseAutoPropertyCodeAction
(
Feature
sResources
.
Use_auto_property
,
Analyzer
sResources
.
Use_auto_property
,
c
=>
ProcessResultAsync
(
context
,
diagnostic
,
c
),
priority
),
diagnostic
);
...
...
@@ -334,7 +334,7 @@ private async Task<SyntaxNode> FormatAsync(SyntaxNode newRoot, Document document
return
true
;
}
private
class
UseAutoPropertyCodeAction
:
C
odeAction
.
SolutionChangeAction
private
class
UseAutoPropertyCodeAction
:
C
ustomCodeActions
.
SolutionChangeAction
{
public
UseAutoPropertyCodeAction
(
string
title
,
Func
<
CancellationToken
,
Task
<
Solution
>>
createChangedSolution
,
CodeActionPriority
priority
)
:
base
(
title
,
createChangedSolution
,
title
)
...
...
src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Chcete pokračovat?</target>
<target
state=
"translated"
>
atribut
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
Použít automatickou vlastnost
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
Nahradit {0} a {1} vlastností
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Möchten Sie fortfahren?</target>
<target
state=
"translated"
>
Attribut
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
Automatisch generierte Eigenschaft verwenden
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
"{0}" und "{1}" durch Eigenschaft ersetzen
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Do you want to continue?</source>
<target
state=
"translated"
>
atributo
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
Usar propiedad automática
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
Reemplazar '{0}' y '{1}' por la propiedad
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Voulez-vous continuer ?</target>
<target
state=
"translated"
>
attribut
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
Utiliser auto-property
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
Remplacer '{0}' et '{1}' par une propriété
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Continuare?</target>
<target
state=
"translated"
>
attributo
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
Usa la proprietà automatica
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
Sostituisci '{0}' e '{1}' con la proprietà
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Do you want to continue?</source>
<target
state=
"translated"
>
属性
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
自動プロパティを使用する
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
{0}' および '{1}' をプロパティと置換する
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Do you want to continue?</source>
<target
state=
"translated"
>
특성
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
auto 속성 사용
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
속성으로 '{0}' 및 '{1}' 바꾸기
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Czy chcesz kontynuować?</target>
<target
state=
"translated"
>
atrybut
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
Użyj właściwości automatycznej
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
Zastąp elementy „{0}” i „{1}” właściwością
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Deseja continuar?</target>
<target
state=
"translated"
>
atributo
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
Usar a propriedade auto
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
Substituir "{0}" e "{1}" por propriedades
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Do you want to continue?</source>
<target
state=
"translated"
>
атрибут
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
Использовать свойство auto
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
Заменить "{0}" и "{1}" свойством
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Devam etmek istiyor musunuz?</target>
<target
state=
"translated"
>
öznitelik
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
Otomatik özellik kullan
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
{0}' ve '{1}' öğesini özellikle değiştir
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Do you want to continue?</source>
<target
state=
"translated"
>
属性
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
使用自动属性
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
使用属性替代“{0}”和“{1}”
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
浏览文件 @
eece9b92
...
...
@@ -1673,11 +1673,6 @@ Do you want to continue?</source>
<target
state=
"translated"
>
屬性
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_auto_property"
>
<source>
Use auto property
</source>
<target
state=
"translated"
>
使用 Auto 屬性
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Replace_0_and_1_with_property"
>
<source>
Replace '{0}' and '{1}' with property
</source>
<target
state=
"translated"
>
以屬性取代 '{0}' 和 '{1}'
</target>
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Extensions/ExpressionSyntaxExtensions.vb
浏览文件 @
eece9b92
...
...
@@ -219,5 +219,127 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions
Return
OperatorPrecedence
.
PrecedenceNone
End
Select
End
Function
<
Extension
()
>
Public
Function
IsInOutContext
(
expression
As
ExpressionSyntax
)
As
Boolean
' NOTE(cyrusn): VB has no concept of an out context. Even when a parameter has an
' '<Out>' attribute on it, it's still treated as ref by VB. So we always return false
' here.
Return
False
End
Function
<
Extension
()
>
Public
Function
IsInRefContext
(
expression
As
ExpressionSyntax
,
semanticModel
As
SemanticModel
,
cancellationToken
As
CancellationToken
)
As
Boolean
Dim
simpleArgument
=
TryCast
(
expression
?
.
Parent
,
SimpleArgumentSyntax
)
If
simpleArgument
Is
Nothing
Then
Return
False
ElseIf
simpleArgument
.
IsNamed
Then
Dim
info
=
semanticModel
.
GetSymbolInfo
(
simpleArgument
.
NameColonEquals
.
Name
,
cancellationToken
)
Dim
parameter
=
TryCast
(
info
.
GetAnySymbol
(),
IParameterSymbol
)
Return
parameter
IsNot
Nothing
AndAlso
parameter
.
RefKind
<>
RefKind
.
None
Else
Dim
argumentList
=
TryCast
(
simpleArgument
.
Parent
,
ArgumentListSyntax
)
If
argumentList
IsNot
Nothing
Then
Dim
parent
=
argumentList
.
Parent
Dim
index
=
argumentList
.
Arguments
.
IndexOf
(
simpleArgument
)
Dim
info
=
semanticModel
.
GetSymbolInfo
(
parent
,
cancellationToken
)
Dim
symbol
=
info
.
GetAnySymbol
()
If
TypeOf
symbol
Is
IMethodSymbol
Then
Dim
method
=
DirectCast
(
symbol
,
IMethodSymbol
)
If
index
<
method
.
Parameters
.
Length
Then
Return
method
.
Parameters
(
index
).
RefKind
<>
RefKind
.
None
End
If
ElseIf
TypeOf
symbol
Is
IPropertySymbol
Then
Dim
prop
=
DirectCast
(
symbol
,
IPropertySymbol
)
If
index
<
prop
.
Parameters
.
Length
Then
Return
prop
.
Parameters
(
index
).
RefKind
<>
RefKind
.
None
End
If
End
If
End
If
End
If
Return
False
End
Function
<
Extension
()
>
Public
Function
IsInInContext
(
expression
As
ExpressionSyntax
)
As
Boolean
' NOTE: VB does not support in parameters. Always return False here.
Return
False
End
Function
<
Extension
()
>
Public
Function
IsOnlyWrittenTo
(
expression
As
ExpressionSyntax
)
As
Boolean
If
expression
.
IsRightSideOfDot
()
Then
expression
=
TryCast
(
expression
.
Parent
,
ExpressionSyntax
)
End
If
If
expression
IsNot
Nothing
Then
If
expression
.
IsInOutContext
()
Then
Return
True
End
If
If
expression
.
IsParentKind
(
SyntaxKind
.
SimpleAssignmentStatement
)
Then
Dim
assignmentStatement
=
DirectCast
(
expression
.
Parent
,
AssignmentStatementSyntax
)
If
expression
Is
assignmentStatement
.
Left
Then
Return
True
End
If
End
If
If
expression
.
IsParentKind
(
SyntaxKind
.
NameColonEquals
)
AndAlso
expression
.
Parent
.
IsParentKind
(
SyntaxKind
.
SimpleArgument
)
Then
' <C(Prop:=1)>
' this is only a write to Prop
Return
True
End
If
If
expression
.
IsChildNode
(
Of
NamedFieldInitializerSyntax
)(
Function
(
n
)
n
.
Name
)
Then
Return
True
End
If
Return
False
End
If
Return
False
End
Function
<
Extension
()
>
Public
Function
IsWrittenTo
(
expression
As
ExpressionSyntax
,
semanticModel
As
SemanticModel
,
cancellationToken
As
CancellationToken
)
As
Boolean
If
IsOnlyWrittenTo
(
expression
)
Then
Return
True
End
If
If
expression
.
IsRightSideOfDot
()
Then
expression
=
TryCast
(
expression
.
Parent
,
ExpressionSyntax
)
End
If
If
expression
IsNot
Nothing
Then
If
expression
.
IsInRefContext
(
semanticModel
,
cancellationToken
)
Then
Return
True
End
If
If
TypeOf
expression
.
Parent
Is
AssignmentStatementSyntax
Then
Dim
assignmentStatement
=
DirectCast
(
expression
.
Parent
,
AssignmentStatementSyntax
)
If
expression
Is
assignmentStatement
.
Left
Then
Return
True
End
If
End
If
If
expression
.
IsChildNode
(
Of
NamedFieldInitializerSyntax
)(
Function
(
n
)
n
.
Name
)
Then
Return
True
End
If
Return
False
End
If
Return
False
End
Function
End
Module
End
Namespace
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/Extensions/ExpressionSyntaxExtensions.vb
浏览文件 @
eece9b92
...
...
@@ -213,128 +213,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions
DirectCast
(
expression
,
ObjectCreationExpressionSyntax
).
ArgumentList
Is
Nothing
End
Function
<
Extension
()
>
Public
Function
IsInOutContext
(
expression
As
ExpressionSyntax
)
As
Boolean
' NOTE(cyrusn): VB has no concept of an out context. Even when a parameter has an
' '<Out>' attribute on it, it's still treated as ref by VB. So we always return false
' here.
Return
False
End
Function
<
Extension
()
>
Public
Function
IsInRefContext
(
expression
As
ExpressionSyntax
,
semanticModel
As
SemanticModel
,
cancellationToken
As
CancellationToken
)
As
Boolean
Dim
simpleArgument
=
TryCast
(
expression
?
.
Parent
,
SimpleArgumentSyntax
)
If
simpleArgument
Is
Nothing
Then
Return
False
ElseIf
simpleArgument
.
IsNamed
Then
Dim
info
=
semanticModel
.
GetSymbolInfo
(
simpleArgument
.
NameColonEquals
.
Name
,
cancellationToken
)
Dim
parameter
=
TryCast
(
info
.
GetAnySymbol
(),
IParameterSymbol
)
Return
parameter
IsNot
Nothing
AndAlso
parameter
.
RefKind
<>
RefKind
.
None
Else
Dim
argumentList
=
TryCast
(
simpleArgument
.
Parent
,
ArgumentListSyntax
)
If
argumentList
IsNot
Nothing
Then
Dim
parent
=
argumentList
.
Parent
Dim
index
=
argumentList
.
Arguments
.
IndexOf
(
simpleArgument
)
Dim
info
=
semanticModel
.
GetSymbolInfo
(
parent
,
cancellationToken
)
Dim
symbol
=
info
.
GetAnySymbol
()
If
TypeOf
symbol
Is
IMethodSymbol
Then
Dim
method
=
DirectCast
(
symbol
,
IMethodSymbol
)
If
index
<
method
.
Parameters
.
Length
Then
Return
method
.
Parameters
(
index
).
RefKind
<>
RefKind
.
None
End
If
ElseIf
TypeOf
symbol
Is
IPropertySymbol
Then
Dim
prop
=
DirectCast
(
symbol
,
IPropertySymbol
)
If
index
<
prop
.
Parameters
.
Length
Then
Return
prop
.
Parameters
(
index
).
RefKind
<>
RefKind
.
None
End
If
End
If
End
If
End
If
Return
False
End
Function
<
Extension
()
>
Public
Function
IsInInContext
(
expression
As
ExpressionSyntax
)
As
Boolean
' NOTE: VB does not support in parameters. Always return False here.
Return
False
End
Function
<
Extension
()
>
Public
Function
IsOnlyWrittenTo
(
expression
As
ExpressionSyntax
)
As
Boolean
If
expression
.
IsRightSideOfDot
()
Then
expression
=
TryCast
(
expression
.
Parent
,
ExpressionSyntax
)
End
If
If
expression
IsNot
Nothing
Then
If
expression
.
IsInOutContext
()
Then
Return
True
End
If
If
expression
.
IsParentKind
(
SyntaxKind
.
SimpleAssignmentStatement
)
Then
Dim
assignmentStatement
=
DirectCast
(
expression
.
Parent
,
AssignmentStatementSyntax
)
If
expression
Is
assignmentStatement
.
Left
Then
Return
True
End
If
End
If
If
expression
.
IsParentKind
(
SyntaxKind
.
NameColonEquals
)
AndAlso
expression
.
Parent
.
IsParentKind
(
SyntaxKind
.
SimpleArgument
)
Then
' <C(Prop:=1)>
' this is only a write to Prop
Return
True
End
If
If
expression
.
IsChildNode
(
Of
NamedFieldInitializerSyntax
)(
Function
(
n
)
n
.
Name
)
Then
Return
True
End
If
Return
False
End
If
Return
False
End
Function
<
Extension
()
>
Public
Function
IsWrittenTo
(
expression
As
ExpressionSyntax
,
semanticModel
As
SemanticModel
,
cancellationToken
As
CancellationToken
)
As
Boolean
If
IsOnlyWrittenTo
(
expression
)
Then
Return
True
End
If
If
expression
.
IsRightSideOfDot
()
Then
expression
=
TryCast
(
expression
.
Parent
,
ExpressionSyntax
)
End
If
If
expression
IsNot
Nothing
Then
If
expression
.
IsInRefContext
(
semanticModel
,
cancellationToken
)
Then
Return
True
End
If
If
TypeOf
expression
.
Parent
Is
AssignmentStatementSyntax
Then
Dim
assignmentStatement
=
DirectCast
(
expression
.
Parent
,
AssignmentStatementSyntax
)
If
expression
Is
assignmentStatement
.
Left
Then
Return
True
End
If
End
If
If
expression
.
IsChildNode
(
Of
NamedFieldInitializerSyntax
)(
Function
(
n
)
n
.
Name
)
Then
Return
True
End
If
Return
False
End
If
Return
False
End
Function
<
Extension
()
>
Public
Function
IsMeMyBaseOrMyClass
(
expression
As
ExpressionSyntax
)
As
Boolean
If
expression
Is
Nothing
Then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录