Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
badf87ac
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,发现更多精彩内容 >>
提交
badf87ac
编写于
12月 19, 2018
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Simplify.
上级
c3b0e58d
变更
18
展开全部
显示空白变更内容
内联
并排
Showing
18 changed file
with
298 addition
and
99 deletion
+298
-99
src/EditorFeatures/CSharpTest/Wrapping/BinaryWrappingTests.cs
...EditorFeatures/CSharpTest/Wrapping/BinaryWrappingTests.cs
+38
-0
src/EditorFeatures/Core.Wpf/Microsoft.CodeAnalysis.EditorFeatures.Wpf_kjyhhyq3_wpftmp.csproj
...ft.CodeAnalysis.EditorFeatures.Wpf_kjyhhyq3_wpftmp.csproj
+254
-0
src/EditorFeatures/Core/Wrapping/BinaryExpression/BinaryExpressionCodeActionComputer.cs
...ng/BinaryExpression/BinaryExpressionCodeActionComputer.cs
+6
-19
src/Features/Core/Portable/FeaturesResources.Designer.cs
src/Features/Core/Portable/FeaturesResources.Designer.cs
+0
-9
src/Features/Core/Portable/FeaturesResources.resx
src/Features/Core/Portable/FeaturesResources.resx
+0
-6
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/EditorFeatures/CSharpTest/Wrapping/BinaryWrappingTests.cs
浏览文件 @
badf87ac
...
...
@@ -505,6 +505,44 @@ public async Task TestAdditionBeginning()
+ ""the""
+ ""time"";
}
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsWrapping
)]
public
async
Task
TestUnderscoreName_End
()
{
await
TestEndOfLine
(
@"class C {
void Bar() {
if ([||]i is var _ && _ != null) {
}
}
}"
,
@"class C {
void Bar() {
if (i is var _ &&
_ != null) {
}
}
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsWrapping
)]
public
async
Task
TestUnderscoreName_Beginning
()
{
await
TestBeginningOfLine
(
@"class C {
void Bar() {
if ([||]i is var _ && _ != null) {
}
}
}"
,
@"class C {
void Bar() {
if (i is var _
&& _ != null) {
}
}
}"
);
}
}
...
...
src/EditorFeatures/Core.Wpf/Microsoft.CodeAnalysis.EditorFeatures.Wpf_kjyhhyq3_wpftmp.csproj
0 → 100644
浏览文件 @
badf87ac
此差异已折叠。
点击以展开。
src/EditorFeatures/Core/Wrapping/BinaryExpression/BinaryExpressionCodeActionComputer.cs
浏览文件 @
badf87ac
...
...
@@ -48,33 +48,20 @@ private class BinaryExpressionCodeActionComputer :
protected
override
async
Task
<
ImmutableArray
<
WrappingGroup
>>
ComputeWrappingGroupsAsync
()
{
var
actions
=
ArrayBuilder
<
WrapItemsAction
>.
GetInstance
();
if
(
_preference
==
OperatorPlacementWhenWrappingPreference
.
EndOfLine
)
{
actions
.
Add
(
await
GetWrapCodeActionAsync
(
includeOperators
:
false
).
ConfigureAwait
(
false
));
}
else
{
actions
.
Add
(
await
GetWrapCodeActionAsync
(
includeOperators
:
true
).
ConfigureAwait
(
false
));
}
actions
.
Add
(
await
GetWrapCodeActionAsync
().
ConfigureAwait
(
false
));
actions
.
Add
(
await
GetUnwrapCodeActionAsync
().
ConfigureAwait
(
false
));
return
ImmutableArray
.
Create
(
new
WrappingGroup
(
isInlinable
:
true
,
actions
.
ToImmutableAndFree
()));
}
private
Task
<
WrapItemsAction
>
GetWrapCodeActionAsync
(
bool
includeOperators
)
private
Task
<
WrapItemsAction
>
GetWrapCodeActionAsync
()
=>
TryCreateCodeActionAsync
(
GetWrapEdits
(
includeOperators
),
GetWrapEdits
(),
FeaturesResources
.
Wrapping
,
includeOperators
?
FeaturesResources
.
Wrap_expression_including_operators
:
FeaturesResources
.
Wrap_expression
);
FeaturesResources
.
Wrap_expression
);
/// <param name="includeOperators">Whether or not the operator should be wrapped
/// to the next line as well, or if it should stay on the same line it started on.</param>
private
ImmutableArray
<
Edit
>
GetWrapEdits
(
bool
includeOperators
)
private
ImmutableArray
<
Edit
>
GetWrapEdits
()
{
var
result
=
ArrayBuilder
<
Edit
>.
GetInstance
();
...
...
@@ -84,7 +71,7 @@ private ImmutableArray<Edit> GetWrapEdits(bool includeOperators)
var
opToken
=
_exprsAndOperators
[
i
].
AsToken
();
var
right
=
_exprsAndOperators
[
i
+
1
].
AsNode
();
if
(
includeOperators
)
if
(
_preference
==
OperatorPlacementWhenWrappingPreference
.
BeginningOfLine
)
{
// convert:
// (a == b) && (c == d) to
...
...
src/Features/Core/Portable/FeaturesResources.Designer.cs
浏览文件 @
badf87ac
...
...
@@ -4475,15 +4475,6 @@ internal class FeaturesResources {
}
}
/// <summary>
/// Looks up a localized string similar to Wrap expression (including operators).
/// </summary>
internal
static
string
Wrap_expression_including_operators
{
get
{
return
ResourceManager
.
GetString
(
"Wrap_expression_including_operators"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Wrap long argument list.
/// </summary>
...
...
src/Features/Core/Portable/FeaturesResources.resx
浏览文件 @
badf87ac
...
...
@@ -1472,9 +1472,6 @@ This version used in: {2}</value>
<data
name=
"Replace_0_with_1"
xml:space=
"preserve"
>
<value>
Replace '{0}' with '{1}'
</value>
</data>
<!--
protected override string Unwrap_list => FeaturesResources.Unwrap_parameter_list;
-->
<data
name=
"Align_wrapped_parameters"
xml:space=
"preserve"
>
<value>
Align wrapped parameters
</value>
</data>
...
...
@@ -1583,9 +1580,6 @@ This version used in: {2}</value>
<data
name=
"Wrap_expression"
xml:space=
"preserve"
>
<value>
Wrap expression
</value>
</data>
<data
name=
"Wrap_expression_including_operators"
xml:space=
"preserve"
>
<value>
Wrap expression (including operators)
</value>
</data>
<data
name=
"Wrapping"
xml:space=
"preserve"
>
<value>
Wrapping
</value>
</data>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
浏览文件 @
badf87ac
...
...
@@ -357,11 +357,6 @@
<target
state=
"new"
>
Wrap expression
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_expression_including_operators"
>
<source>
Wrap expression (including operators)
</source>
<target
state=
"new"
>
Wrap expression (including operators)
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Wrap_long_argument_list"
>
<source>
Wrap long argument list
</source>
<target
state=
"new"
>
Wrap long argument list
</target>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录