Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
2eedf9a8
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,发现更多精彩内容 >>
提交
2eedf9a8
编写于
3月 08, 2020
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add optoins UI
上级
e9bc326e
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
122 addition
and
0 deletion
+122
-0
src/VisualStudio/CSharp/Impl/Options/Formatting/StyleViewModel.cs
...alStudio/CSharp/Impl/Options/Formatting/StyleViewModel.cs
+27
-0
src/VisualStudio/Core/Def/ServicesVSResources.resx
src/VisualStudio/Core/Def/ServicesVSResources.resx
+3
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf
+5
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf
+5
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf
+5
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf
+5
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf
+5
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf
+5
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf
+5
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf
+5
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf
+5
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf
+5
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf
src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf
+5
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf
...VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf
+5
-0
src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf
...VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf
+5
-0
src/VisualStudio/VisualBasic/Impl/Options/StyleViewModel.vb
src/VisualStudio/VisualBasic/Impl/Options/StyleViewModel.vb
+27
-0
未找到文件。
src/VisualStudio/CSharp/Impl/Options/Formatting/StyleViewModel.cs
浏览文件 @
2eedf9a8
...
...
@@ -560,6 +560,32 @@ class Customer2
void
DoWork
(
CancellationToken
cancellationToken
=
default
(
CancellationToken
))
{{
}}
//]
}}
"
;
private
static
readonly
string
s_preferSimplifiedConditionalExpressions
=
$@"
using System.Threading;
class Customer1
{{
bool
A
()
=>
true
;
bool
B
()
=>
true
;
void
M1
()
{{
//[
// {ServicesVSResources.Prefer_colon}
var
x
=
A
()
&&
B
();
//]
}}
void
M2
()
{{
//[
// {ServicesVSResources.Over_colon}
var
x
=
A
()
&&
B
()
?
true
:
false
//]
}}
}}
"
;
private
static
readonly
string
s_preferInferredTupleName
=
$@"
...
...
@@ -1658,6 +1684,7 @@ internal StyleViewModel(OptionStore optionStore, IServiceProvider serviceProvide
// Expression preferences
CodeStyleItems
.
Add
(
new
BooleanCodeStyleOptionViewModel
(
CodeStyleOptions
.
PreferObjectInitializer
,
ServicesVSResources
.
Prefer_object_initializer
,
s_preferObjectInitializer
,
s_preferObjectInitializer
,
this
,
optionStore
,
expressionPreferencesGroupTitle
));
CodeStyleItems
.
Add
(
new
BooleanCodeStyleOptionViewModel
(
CodeStyleOptions
.
PreferCollectionInitializer
,
ServicesVSResources
.
Prefer_collection_initializer
,
s_preferCollectionInitializer
,
s_preferCollectionInitializer
,
this
,
optionStore
,
expressionPreferencesGroupTitle
));
CodeStyleItems
.
Add
(
new
BooleanCodeStyleOptionViewModel
(
CodeStyleOptions
.
PreferSimplifiedConditionalExpression
,
ServicesVSResources
.
Prefer_simplified_conditional_expressions
,
s_preferSimplifiedConditionalExpressions
,
s_preferSimplifiedConditionalExpressions
,
this
,
optionStore
,
expressionPreferencesGroupTitle
));
CodeStyleItems
.
Add
(
new
BooleanCodeStyleOptionViewModel
(
CSharpCodeStyleOptions
.
PreferSwitchExpression
,
CSharpVSResources
.
Prefer_switch_expression
,
s_preferSwitchExpression
,
s_preferSwitchExpression
,
this
,
optionStore
,
expressionPreferencesGroupTitle
));
CodeStyleItems
.
Add
(
new
BooleanCodeStyleOptionViewModel
(
CSharpCodeStyleOptions
.
PreferPatternMatchingOverIsWithCastCheck
,
CSharpVSResources
.
Prefer_pattern_matching_over_is_with_cast_check
,
s_preferPatternMatchingOverIsWithCastCheck
,
s_preferPatternMatchingOverIsWithCastCheck
,
this
,
optionStore
,
expressionPreferencesGroupTitle
));
CodeStyleItems
.
Add
(
new
BooleanCodeStyleOptionViewModel
(
CSharpCodeStyleOptions
.
PreferPatternMatchingOverAsWithNullCheck
,
CSharpVSResources
.
Prefer_pattern_matching_over_as_with_null_check
,
s_preferPatternMatchingOverAsWithNullCheck
,
s_preferPatternMatchingOverAsWithNullCheck
,
this
,
optionStore
,
expressionPreferencesGroupTitle
));
...
...
src/VisualStudio/Core/Def/ServicesVSResources.resx
浏览文件 @
2eedf9a8
...
...
@@ -1372,4 +1372,7 @@ I agree to all of the foregoing:</value>
<data
name=
"Some_color_scheme_colors_are_being_overridden_by_changes_made_in_the_Environment_Fonts_and_Colors_options_page_Choose_Use_Defaults_in_the_Fonts_and_Colors_page_to_revert_all_customizations"
xml:space=
"preserve"
>
<value>
Some color scheme colors are being overridden by changes made in the Environment
>
Fonts and Colors options page. Choose `Use Defaults` in the Fonts and Colors page to revert all customizations.
</value>
</data>
<data
name=
"Prefer_simplified_conditional_expressions"
xml:space=
"preserve"
>
<value>
Prefer simplified conditional expressions
</value>
</data>
</root>
\ No newline at end of file
src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
Preferovat jednoduchý příkaz using
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
Preferovat statické místní funkce
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
Einfache using-Anweisung bevorzugen
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
Statische lokale Funktionen bevorzugen
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
Preferir la instrucción "using" sencilla
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
Preferir funciones locales estáticas
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
Préférer une instruction 'using' simple
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
Préférer les fonctions locales statiques
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
Preferisci l'istruzione 'using' semplice
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
Preferisci funzioni locali statiche
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
単純な 'using' ステートメントを優先する
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
静的ローカル関数を優先する
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
간단한 'using' 문 선호
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
정적 로컬 함수 선호
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
Preferuj prostą instrukcję „using”
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
Preferuj statyczne funkcje lokalne
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
Preferir a instrução 'using' simples
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
Preferir as funções locais estáticas
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
Предпочитать простой оператор using
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
Предпочитать статические локальные функции
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
Basit 'using' deyimini tercih et
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
Statik yerel işlevleri tercih et
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
首选简单的 "using" 语句
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
首选静态本地函数
</target>
...
...
src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf
浏览文件 @
2eedf9a8
...
...
@@ -427,6 +427,11 @@
<target
state=
"translated"
>
優先使用簡單的 'using' 陳述式
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_simplified_conditional_expressions"
>
<source>
Prefer simplified conditional expressions
</source>
<target
state=
"new"
>
Prefer simplified conditional expressions
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Prefer_static_local_functions"
>
<source>
Prefer static local functions
</source>
<target
state=
"translated"
>
優先使用靜態區域函式
</target>
...
...
src/VisualStudio/VisualBasic/Impl/Options/StyleViewModel.vb
浏览文件 @
2eedf9a8
...
...
@@ -196,6 +196,32 @@ Class Customer
End Sub
End Class"
Private
Shared
ReadOnly
s_preferSimplifiedConditionalExpressions
As
String
=
$
"
Class Customer
Sub M1()
//[
' {ServicesVSResources.Prefer_colon}
Dim x = A() AndAlso B()
//]
End Sub
Sub M2()
//[
' {ServicesVSResources.Over_colon}
Dim x = If(A() AndAlso B(), True, False)
//]
End Sub
Function A() As Boolean
Return True
End Function
Function B() As Boolean
Return True
End Function
End Class"
Private
Shared
ReadOnly
s_preferExplicitTupleName
As
String
=
$
"
Class Customer
Sub M1()
...
...
@@ -692,6 +718,7 @@ End Class
' expression preferences
Me
.
CodeStyleItems
.
Add
(
New
BooleanCodeStyleOptionViewModel
(
CodeStyleOptions
.
PreferObjectInitializer
,
ServicesVSResources
.
Prefer_object_initializer
,
s_preferObjectInitializer
,
s_preferObjectInitializer
,
Me
,
optionStore
,
expressionPreferencesGroupTitle
))
Me
.
CodeStyleItems
.
Add
(
New
BooleanCodeStyleOptionViewModel
(
CodeStyleOptions
.
PreferCollectionInitializer
,
ServicesVSResources
.
Prefer_collection_initializer
,
s_preferCollectionInitializer
,
s_preferCollectionInitializer
,
Me
,
optionStore
,
expressionPreferencesGroupTitle
))
Me
.
CodeStyleItems
.
Add
(
New
BooleanCodeStyleOptionViewModel
(
CodeStyleOptions
.
PreferSimplifiedConditionalExpression
,
ServicesVSResources
.
Prefer_simplified_conditional_expressions
,
s_preferSimplifiedConditionalExpressions
,
s_preferSimplifiedConditionalExpressions
,
Me
,
optionStore
,
expressionPreferencesGroupTitle
))
Me
.
CodeStyleItems
.
Add
(
New
BooleanCodeStyleOptionViewModel
(
CodeStyleOptions
.
PreferExplicitTupleNames
,
ServicesVSResources
.
Prefer_explicit_tuple_name
,
s_preferExplicitTupleName
,
s_preferExplicitTupleName
,
Me
,
optionStore
,
expressionPreferencesGroupTitle
))
Me
.
CodeStyleItems
.
Add
(
New
BooleanCodeStyleOptionViewModel
(
CodeStyleOptions
.
PreferInferredTupleNames
,
ServicesVSResources
.
Prefer_inferred_tuple_names
,
s_preferInferredTupleName
,
s_preferInferredTupleName
,
Me
,
optionStore
,
expressionPreferencesGroupTitle
))
Me
.
CodeStyleItems
.
Add
(
New
BooleanCodeStyleOptionViewModel
(
CodeStyleOptions
.
PreferInferredAnonymousTypeMemberNames
,
ServicesVSResources
.
Prefer_inferred_anonymous_type_member_names
,
s_preferInferredAnonymousTypeMemberName
,
s_preferInferredAnonymousTypeMemberName
,
Me
,
optionStore
,
expressionPreferencesGroupTitle
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录