Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
0d194fd0
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,发现更多精彩内容 >>
提交
0d194fd0
编写于
6月 15, 2017
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove options to allow users to control if they want fading or not.
上级
f3e63a6c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
170 addition
and
6 deletion
+170
-6
src/Features/Core/Portable/Diagnostics/Analyzers/RemoveUnnecessaryCastDiagnosticAnalyzerBase.cs
.../Analyzers/RemoveUnnecessaryCastDiagnosticAnalyzerBase.cs
+6
-6
src/Features/Core/Portable/Fading/FadingOptions.cs
src/Features/Core/Portable/Fading/FadingOptions.cs
+33
-0
src/Features/Core/Portable/Features.csproj
src/Features/Core/Portable/Features.csproj
+1
-0
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml
...Studio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml
+17
-0
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs
...dio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs
+8
-0
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs
...alStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs
+21
-0
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
+63
-0
src/VisualStudio/Core/Def/ServicesVSResources.resx
src/VisualStudio/Core/Def/ServicesVSResources.resx
+21
-0
未找到文件。
src/Features/Core/Portable/Diagnostics/Analyzers/RemoveUnnecessaryCastDiagnosticAnalyzerBase.cs
浏览文件 @
0d194fd0
...
...
@@ -14,12 +14,12 @@ internal abstract class RemoveUnnecessaryCastDiagnosticAnalyzerBase<TLanguageKin
private
static
readonly
LocalizableString
s_localizableMessage
=
new
LocalizableResourceString
(
nameof
(
WorkspacesResources
.
Cast_is_redundant
),
WorkspacesResources
.
ResourceManager
,
typeof
(
WorkspacesResources
));
private
static
readonly
DiagnosticDescriptor
s_descriptor
=
new
DiagnosticDescriptor
(
IDEDiagnosticIds
.
RemoveUnnecessaryCastDiagnosticId
,
s_localizableTitle
,
s_localizableMessage
,
DiagnosticCategory
.
Style
,
DiagnosticSeverity
.
Hidden
,
isEnabledByDefault
:
true
,
customTags
:
DiagnosticCustomTags
.
Unnecessary
);
s_localizableTitle
,
s_localizableMessage
,
DiagnosticCategory
.
Style
,
DiagnosticSeverity
.
Hidden
,
isEnabledByDefault
:
true
,
customTags
:
DiagnosticCustomTags
.
Unnecessary
);
#
region
Interface
methods
...
...
src/Features/Core/Portable/Fading/FadingOptions.cs
0 → 100644
浏览文件 @
0d194fd0
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using
Microsoft.CodeAnalysis.Options
;
namespace
Microsoft.CodeAnalysis.Fading
{
internal
static
class
FadingOptions
{
public
static
readonly
PerLanguageOption
<
bool
>
FadeOutUnusedImports
=
new
PerLanguageOption
<
bool
>(
nameof
(
FadingOptions
),
nameof
(
FadeOutUnusedImports
),
defaultValue
:
true
,
storageLocations
:
new
RoamingProfileStorageLocation
(
$"TextEditor.%LANGUAGE%.Specific.
{
nameof
(
FadeOutUnusedImports
)}
"
));
public
static
readonly
PerLanguageOption
<
bool
>
FadeOutUnnecessaryCasts
=
new
PerLanguageOption
<
bool
>(
nameof
(
FadingOptions
),
nameof
(
FadeOutUnnecessaryCasts
),
defaultValue
:
true
,
storageLocations
:
new
RoamingProfileStorageLocation
(
$"TextEditor.%LANGUAGE%.Specific.
{
nameof
(
FadeOutUnnecessaryCasts
)}
"
));
public
static
readonly
PerLanguageOption
<
bool
>
FadeOutUnreachableCode
=
new
PerLanguageOption
<
bool
>(
nameof
(
FadingOptions
),
nameof
(
FadeOutUnreachableCode
),
defaultValue
:
true
,
storageLocations
:
new
RoamingProfileStorageLocation
(
$"TextEditor.%LANGUAGE%.Specific.
{
nameof
(
FadeOutUnreachableCode
)}
"
));
public
static
readonly
PerLanguageOption
<
bool
>
FadeOutNullChecksThatCanBeSimplified
=
new
PerLanguageOption
<
bool
>(
nameof
(
FadingOptions
),
nameof
(
FadeOutNullChecksThatCanBeSimplified
),
defaultValue
:
true
,
storageLocations
:
new
RoamingProfileStorageLocation
(
$"TextEditor.%LANGUAGE%.Specific.
{
nameof
(
FadeOutNullChecksThatCanBeSimplified
)}
"
));
public
static
readonly
PerLanguageOption
<
bool
>
FadeOutInitializersThatCanBeSimplified
=
new
PerLanguageOption
<
bool
>(
nameof
(
FadingOptions
),
nameof
(
FadeOutInitializersThatCanBeSimplified
),
defaultValue
:
true
,
storageLocations
:
new
RoamingProfileStorageLocation
(
$"TextEditor.%LANGUAGE%.Specific.
{
nameof
(
FadeOutInitializersThatCanBeSimplified
)}
"
));
public
static
readonly
PerLanguageOption
<
bool
>
FadeOutDefaultExpressionsThatCanBeSimplified
=
new
PerLanguageOption
<
bool
>(
nameof
(
FadingOptions
),
nameof
(
FadeOutDefaultExpressionsThatCanBeSimplified
),
defaultValue
:
true
,
storageLocations
:
new
RoamingProfileStorageLocation
(
$"TextEditor.%LANGUAGE%.Specific.
{
nameof
(
FadeOutDefaultExpressionsThatCanBeSimplified
)}
"
));
}
}
\ No newline at end of file
src/Features/Core/Portable/Features.csproj
浏览文件 @
0d194fd0
...
...
@@ -149,6 +149,7 @@
<Compile
Include=
"CodeFixes\FixAllOccurrences\FixSomeCodeAction.cs"
/>
<Compile
Include=
"AddPackage\InstallPackageDirectlyCodeAction.cs"
/>
<Compile
Include=
"AddConstructorParametersFromMembers\State.cs"
/>
<Compile
Include=
"Fading\FadingOptions.cs"
/>
<Compile
Include=
"FeaturesResources.Designer.cs"
>
<AutoGen>
True
</AutoGen>
<DesignTime>
True
</DesignTime>
...
...
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml
浏览文件 @
0d194fd0
...
...
@@ -61,6 +61,23 @@
Content="{x:Static local:AdvancedOptionPageStrings.Option_Collapse_regions_when_collapsing_to_definitions}" />
</StackPanel>
</GroupBox>
<GroupBox x:Uid="FadingGroupBox"
Header="{x:Static local:AdvancedOptionPageStrings.Option_Fading}">
<StackPanel>
<CheckBox x:Name="Fade_out_unused_usings"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Fade_out_unused_usings}" />
<CheckBox x:Name="Fade_out_unnecessary_casts"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Fade_out_unnecessary_casts}" />
<CheckBox x:Name="Fade_out_unreachable_code"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Fade_out_unreachable_code}" />
<CheckBox x:Name="Fade_out_null_checks_that_can_be_simplified"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Fade_out_null_checks_that_can_be_simplified}" />
<CheckBox x:Name="Fade_out_initializers_that_can_be_simplified"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Fade_out_initializers_that_can_be_simplified}" />
<CheckBox x:Name="Fade_out_default_expressions_that_can_be_simplified"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Fade_out_default_expressions_that_can_be_simplified}" />
</StackPanel>
</GroupBox>
<GroupBox x:Uid="BlockStructureGuidesGroupBox"
Header="{x:Static local:AdvancedOptionPageStrings.Option_Block_Structure_Guides}">
<StackPanel>
...
...
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs
浏览文件 @
0d194fd0
...
...
@@ -6,6 +6,7 @@
using
Microsoft.CodeAnalysis.Editor.CSharp.SplitStringLiteral
;
using
Microsoft.CodeAnalysis.Editor.Shared.Options
;
using
Microsoft.CodeAnalysis.ExtractMethod
;
using
Microsoft.CodeAnalysis.Fading
;
using
Microsoft.CodeAnalysis.ImplementType
;
using
Microsoft.CodeAnalysis.Remote
;
using
Microsoft.CodeAnalysis.Structure
;
...
...
@@ -34,6 +35,13 @@ public AdvancedOptionPageControl(IServiceProvider serviceProvider) : base(servic
BindToOption
(
Show_outlining_for_comments_and_preprocessor_regions
,
BlockStructureOptions
.
ShowOutliningForCommentsAndPreprocessorRegions
,
LanguageNames
.
CSharp
);
BindToOption
(
Collapse_regions_when_collapsing_to_definitions
,
BlockStructureOptions
.
CollapseRegionsWhenCollapsingToDefinitions
,
LanguageNames
.
CSharp
);
BindToOption
(
Fade_out_unused_usings
,
FadingOptions
.
FadeOutUnusedImports
,
LanguageNames
.
CSharp
);
BindToOption
(
Fade_out_unnecessary_casts
,
FadingOptions
.
FadeOutUnnecessaryCasts
,
LanguageNames
.
CSharp
);
BindToOption
(
Fade_out_unreachable_code
,
FadingOptions
.
FadeOutUnreachableCode
,
LanguageNames
.
CSharp
);
BindToOption
(
Fade_out_null_checks_that_can_be_simplified
,
FadingOptions
.
FadeOutNullChecksThatCanBeSimplified
,
LanguageNames
.
CSharp
);
BindToOption
(
Fade_out_initializers_that_can_be_simplified
,
FadingOptions
.
FadeOutInitializersThatCanBeSimplified
,
LanguageNames
.
CSharp
);
BindToOption
(
Fade_out_default_expressions_that_can_be_simplified
,
FadingOptions
.
FadeOutDefaultExpressionsThatCanBeSimplified
,
LanguageNames
.
CSharp
);
BindToOption
(
Show_guides_for_declaration_level_constructs
,
BlockStructureOptions
.
ShowBlockStructureGuidesForDeclarationLevelConstructs
,
LanguageNames
.
CSharp
);
BindToOption
(
Show_guides_for_code_level_constructs
,
BlockStructureOptions
.
ShowBlockStructureGuidesForCodeLevelConstructs
,
LanguageNames
.
CSharp
);
...
...
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs
浏览文件 @
0d194fd0
...
...
@@ -134,6 +134,27 @@ public static string Option_Show_guides_for_declaration_level_constructs
public
static
string
Option_Show_guides_for_code_level_constructs
=>
ServicesVSResources
.
Show_guides_for_code_level_constructs
;
public
static
string
Option_Fading
=>
ServicesVSResources
.
Fading
;
public
static
string
Option_Fade_out_unused_usings
=>
ServicesVSResources
.
Fade_out_unused_usings
;
public
static
string
Option_Fade_out_unnecessary_casts
=>
ServicesVSResources
.
Fade_out_unnecessary_casts
;
public
static
string
Option_Fade_out_unreachable_code
=>
ServicesVSResources
.
Fade_out_unreachable_code
;
public
static
string
Option_Fade_out_null_checks_that_can_be_simplified
=>
ServicesVSResources
.
Fade_out_null_checks_that_can_be_simplified
;
public
static
string
Option_Fade_out_initializers_that_can_be_simplified
=>
ServicesVSResources
.
Fade_out_initializers_that_can_be_simplified
;
public
static
string
Option_Fade_out_default_expressions_that_can_be_simplified
=>
ServicesVSResources
.
Fade_out_default_expressions_that_can_be_simplified
;
public
static
string
Option_Performance
{
get
{
return
CSharpVSResources
.
Performance
;
}
...
...
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
浏览文件 @
0d194fd0
...
...
@@ -777,6 +777,69 @@ internal class ServicesVSResources {
}
}
/// <summary>
/// Looks up a localized string similar to Fade out 'defualt' expressions that can be simplified.
/// </summary>
internal
static
string
Fade_out_default_expressions_that_can_be_simplified
{
get
{
return
ResourceManager
.
GetString
(
"Fade_out_default_expressions_that_can_be_simplified"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Fade out initializers that can be simplified.
/// </summary>
internal
static
string
Fade_out_initializers_that_can_be_simplified
{
get
{
return
ResourceManager
.
GetString
(
"Fade_out_initializers_that_can_be_simplified"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Fade out null checks that can be simplified.
/// </summary>
internal
static
string
Fade_out_null_checks_that_can_be_simplified
{
get
{
return
ResourceManager
.
GetString
(
"Fade_out_null_checks_that_can_be_simplified"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Fade out unnecessary casts.
/// </summary>
internal
static
string
Fade_out_unnecessary_casts
{
get
{
return
ResourceManager
.
GetString
(
"Fade_out_unnecessary_casts"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Fade out unreachable code.
/// </summary>
internal
static
string
Fade_out_unreachable_code
{
get
{
return
ResourceManager
.
GetString
(
"Fade_out_unreachable_code"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Fade out unused usings.
/// </summary>
internal
static
string
Fade_out_unused_usings
{
get
{
return
ResourceManager
.
GetString
(
"Fade_out_unused_usings"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Fading.
/// </summary>
internal
static
string
Fading
{
get
{
return
ResourceManager
.
GetString
(
"Fading"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Failed to create document in miscellaneous files project..
/// </summary>
...
...
src/VisualStudio/Core/Def/ServicesVSResources.resx
浏览文件 @
0d194fd0
...
...
@@ -933,4 +933,25 @@ Additional information: {1}</value>
<data
name=
"Perform_editor_feature_analysis_in_external_process"
xml:space=
"preserve"
>
<value>
Perform editor _feature analysis in external process (experimental)
</value>
</data>
<data
name=
"Fade_out_default_expressions_that_can_be_simplified"
xml:space=
"preserve"
>
<value>
Fade out 'defualt' expressions that can be simplified
</value>
</data>
<data
name=
"Fade_out_initializers_that_can_be_simplified"
xml:space=
"preserve"
>
<value>
Fade out initializers that can be simplified
</value>
</data>
<data
name=
"Fade_out_null_checks_that_can_be_simplified"
xml:space=
"preserve"
>
<value>
Fade out null checks that can be simplified
</value>
</data>
<data
name=
"Fade_out_unnecessary_casts"
xml:space=
"preserve"
>
<value>
Fade out unnecessary casts
</value>
</data>
<data
name=
"Fade_out_unreachable_code"
xml:space=
"preserve"
>
<value>
Fade out unreachable code
</value>
</data>
<data
name=
"Fade_out_unused_usings"
xml:space=
"preserve"
>
<value>
Fade out unused usings
</value>
</data>
<data
name=
"Fading"
xml:space=
"preserve"
>
<value>
Fading
</value>
</data>
</root>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录