Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
41cea56d
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,发现更多精彩内容 >>
提交
41cea56d
编写于
10月 16, 2018
作者:
Š
Šimon Koníček
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adding a resource string
上级
439c9132
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
89 addition
and
3 deletion
+89
-3
src/Features/CSharp/Portable/SplitIntoNestedIfStatements/CSharpSplitIntoNestedIfStatementsCodeRefactoringProvider.cs
...harpSplitIntoNestedIfStatementsCodeRefactoringProvider.cs
+2
-0
src/Features/Core/Portable/FeaturesResources.Designer.cs
src/Features/Core/Portable/FeaturesResources.Designer.cs
+9
-0
src/Features/Core/Portable/FeaturesResources.resx
src/Features/Core/Portable/FeaturesResources.resx
+3
-0
src/Features/Core/Portable/SplitIntoNestedIfStatements/AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider.cs
...ractSplitIntoNestedIfStatementsCodeRefactoringProvider.cs
+8
-3
src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
+5
-0
src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
+5
-0
src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
+5
-0
src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
+5
-0
src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
+5
-0
src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
+5
-0
src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
+5
-0
src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
+5
-0
src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
+5
-0
src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
+5
-0
src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
+5
-0
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
+5
-0
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
+5
-0
src/Features/VisualBasic/Portable/SplitIntoNestedIfStatements/VisualbasicSplitIntoNestedIfStatementsCodeRefactoringProvider.vb
...asicSplitIntoNestedIfStatementsCodeRefactoringProvider.vb
+2
-0
未找到文件。
src/Features/CSharp/Portable/SplitIntoNestedIfStatements/CSharpSplitIntoNestedIfStatementsCodeRefactoringProvider.cs
浏览文件 @
41cea56d
...
...
@@ -12,6 +12,8 @@ namespace Microsoft.CodeAnalysis.CSharp.SplitIntoNestedIfStatements
internal
sealed
class
CSharpSplitIntoNestedIfStatementsCodeRefactoringProvider
:
AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider
<
IfStatementSyntax
,
ExpressionSyntax
>
{
protected
override
string
IfKeywordText
=>
SyntaxFacts
.
GetText
(
SyntaxKind
.
IfKeyword
);
protected
override
int
LogicalAndSyntaxKind
=>
(
int
)
SyntaxKind
.
LogicalAndExpression
;
protected
override
bool
IsConditionOfIfStatement
(
SyntaxNode
expression
,
out
IfStatementSyntax
ifStatement
)
...
...
src/Features/Core/Portable/FeaturesResources.Designer.cs
浏览文件 @
41cea56d
...
...
@@ -3235,6 +3235,15 @@ internal class FeaturesResources {
}
}
/// <summary>
/// Looks up a localized string similar to Split into nested '{0}' statements.
/// </summary>
internal
static
string
Split_into_nested_0_statements
{
get
{
return
ResourceManager
.
GetString
(
"Split_into_nested_0_statements"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Structures.
/// </summary>
...
...
src/Features/Core/Portable/FeaturesResources.resx
浏览文件 @
41cea56d
...
...
@@ -1469,4 +1469,7 @@ This version used in: {2}</value>
<data
name=
"Fix_formatting"
xml:space=
"preserve"
>
<value>
Fix formatting
</value>
</data>
<data
name=
"Split_into_nested_0_statements"
xml:space=
"preserve"
>
<value>
Split into nested '{0}' statements
</value>
</data>
</root>
\ No newline at end of file
src/Features/Core/Portable/SplitIntoNestedIfStatements/AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider.cs
浏览文件 @
41cea56d
...
...
@@ -18,6 +18,8 @@ internal abstract class AbstractSplitIntoNestedIfStatementsCodeRefactoringProvid
where
TIfStatementSyntax
:
SyntaxNode
where
TExpressionSyntax
:
SyntaxNode
{
protected
abstract
string
IfKeywordText
{
get
;
}
protected
abstract
int
LogicalAndSyntaxKind
{
get
;
}
protected
abstract
bool
IsConditionOfIfStatement
(
SyntaxNode
expression
,
out
TIfStatementSyntax
ifStatement
);
...
...
@@ -39,7 +41,10 @@ public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContex
if
(
IsPartOfBinaryExpressionChain
(
token
,
LogicalAndSyntaxKind
,
out
var
rootExpression
)
&&
IsConditionOfIfStatement
(
rootExpression
,
out
_
))
{
context
.
RegisterRefactoring
(
new
MyCodeAction
(
c
=>
FixAsync
(
context
.
Document
,
context
.
Span
,
c
)));
context
.
RegisterRefactoring
(
new
MyCodeAction
(
c
=>
FixAsync
(
context
.
Document
,
context
.
Span
,
c
),
IfKeywordText
));
}
}
...
...
@@ -86,8 +91,8 @@ private static bool IsPartOfBinaryExpressionChain(SyntaxToken token, int syntaxK
private
sealed
class
MyCodeAction
:
CodeAction
.
DocumentChangeAction
{
public
MyCodeAction
(
Func
<
CancellationToken
,
Task
<
Document
>>
createChangedDocument
)
:
base
(
"Split into nested 'if' statements"
,
createChangedDocument
)
public
MyCodeAction
(
Func
<
CancellationToken
,
Task
<
Document
>>
createChangedDocument
,
string
ifKeywordText
)
:
base
(
string
.
Format
(
FeaturesResources
.
Split_into_nested_0_statements
,
ifKeywordText
)
,
createChangedDocument
)
{
}
}
...
...
src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
浏览文件 @
41cea56d
...
...
@@ -152,6 +152,11 @@
<target
state=
"new"
>
Replace '{0}' with '{1}'
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Split_into_nested_0_statements"
>
<source>
Split into nested '{0}' statements
</source>
<target
state=
"new"
>
Split into nested '{0}' statements
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Use_block_body_for_lambda_expressions"
>
<source>
Use block body for lambda expressions
</source>
<target
state=
"new"
>
Use block body for lambda expressions
</target>
...
...
src/Features/VisualBasic/Portable/SplitIntoNestedIfStatements/VisualbasicSplitIntoNestedIfStatementsCodeRefactoringProvider.vb
浏览文件 @
41cea56d
...
...
@@ -11,6 +11,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.SplitIntoNestedIfStatements
Friend
NotInheritable
Class
VisualBasicSplitIntoNestedIfStatementsCodeRefactoringProvider
Inherits
AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider
(
Of
MultiLineIfBlockSyntax
,
ExpressionSyntax
)
Protected
Overrides
ReadOnly
Property
IfKeywordText
As
String
=
SyntaxFacts
.
GetText
(
SyntaxKind
.
IfKeyword
)
Protected
Overrides
ReadOnly
Property
LogicalAndSyntaxKind
As
Integer
=
SyntaxKind
.
AndAlsoExpression
Protected
Overrides
Function
IsConditionOfIfStatement
(
expression
As
SyntaxNode
,
ByRef
ifStatement
As
MultiLineIfBlockSyntax
)
As
Boolean
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录