Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
e33a19e9
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,发现更多精彩内容 >>
提交
e33a19e9
编写于
11月 02, 2016
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Hookup options.
上级
c51f4329
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
43 addition
and
18 deletion
+43
-18
src/EditorFeatures/Core/Implementation/Structure/AbstractStructureTaggerProvider.cs
...plementation/Structure/AbstractStructureTaggerProvider.cs
+2
-1
src/EditorFeatures/Core/Implementation/Structure/RoslynOutliningRegionTag.cs
...Core/Implementation/Structure/RoslynOutliningRegionTag.cs
+6
-4
src/EditorFeatures/Next/Structure/VisualStudio15StructureTaggerProvider.cs
...s/Next/Structure/VisualStudio15StructureTaggerProvider.cs
+11
-12
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml
...Studio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml
+2
-0
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs
...dio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs
+1
-0
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs
...alStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs
+3
-0
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
+9
-0
src/VisualStudio/Core/Def/ServicesVSResources.resx
src/VisualStudio/Core/Def/ServicesVSResources.resx
+3
-0
src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml
...o/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml
+2
-0
src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml.vb
...isualBasic/Impl/Options/AdvancedOptionPageControl.xaml.vb
+1
-1
src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageStrings.vb
...dio/VisualBasic/Impl/Options/AdvancedOptionPageStrings.vb
+3
-0
未找到文件。
src/EditorFeatures/Core/Implementation/Structure/AbstractStructureTaggerProvider.cs
浏览文件 @
e33a19e9
...
...
@@ -75,7 +75,8 @@ protected sealed override ITaggerEventSource CreateEventSource(ITextView textVie
TaggerEventSources
.
OnOptionChanged
(
subjectBuffer
,
BlockStructureOptions
.
ShowBlockStructureGuidesForCommentsAndPreprocessorRegions
,
TaggerDelay
.
NearImmediate
),
TaggerEventSources
.
OnOptionChanged
(
subjectBuffer
,
BlockStructureOptions
.
ShowOutliningForCodeLevelConstructs
,
TaggerDelay
.
NearImmediate
),
TaggerEventSources
.
OnOptionChanged
(
subjectBuffer
,
BlockStructureOptions
.
ShowOutliningForDeclarationLevelConstructs
,
TaggerDelay
.
NearImmediate
),
TaggerEventSources
.
OnOptionChanged
(
subjectBuffer
,
BlockStructureOptions
.
ShowOutliningForCommentsAndPreprocessorRegions
,
TaggerDelay
.
NearImmediate
));
TaggerEventSources
.
OnOptionChanged
(
subjectBuffer
,
BlockStructureOptions
.
ShowOutliningForCommentsAndPreprocessorRegions
,
TaggerDelay
.
NearImmediate
),
TaggerEventSources
.
OnOptionChanged
(
subjectBuffer
,
BlockStructureOptions
.
CollapseRegionsWhenCollapsingToDefinitions
,
TaggerDelay
.
NearImmediate
));
}
/// <summary>
...
...
src/EditorFeatures/Core/Implementation/Structure/RoslynOutliningRegionTag.cs
浏览文件 @
e33a19e9
...
...
@@ -10,6 +10,7 @@
using
Microsoft.VisualStudio.Text.Editor
;
using
Microsoft.VisualStudio.Text.Projection
;
using
Microsoft.VisualStudio.Text.Tagging
;
using
Roslyn.Utilities
;
namespace
Microsoft.CodeAnalysis.Editor.Implementation.Structure
{
...
...
@@ -55,13 +56,14 @@ internal class RoslynOutliningRegionTag : IOutliningRegionTag
public
override
bool
Equals
(
object
obj
)
=>
Equals
(
obj
as
RoslynOutliningRegionTag
);
// This is only called if the spans for the tags were the same. In that case, we
// consider ourselves the same unless the CollapsedForm properties are different.
public
bool
Equals
(
RoslynOutliningRegionTag
tag
)
=>
tag
!=
null
&&
Equals
(
this
.
CollapsedForm
,
tag
.
CollapsedForm
);
=>
tag
!=
null
&&
IsImplementation
==
tag
.
IsImplementation
&&
Equals
(
this
.
CollapsedForm
,
tag
.
CollapsedForm
);
public
override
int
GetHashCode
()
=>
EqualityComparer
<
object
>.
Default
.
GetHashCode
(
this
.
CollapsedForm
);
=>
Hash
.
Combine
(
IsImplementation
,
EqualityComparer
<
object
>.
Default
.
GetHashCode
(
this
.
CollapsedForm
));
public
object
CollapsedHintForm
=>
new
ViewHostingControl
(
CreateElisionBufferView
,
CreateElisionBuffer
);
...
...
src/EditorFeatures/Next/Structure/VisualStudio15StructureTaggerProvider.cs
浏览文件 @
e33a19e9
...
...
@@ -63,9 +63,9 @@ private class RoslynBlockTag : RoslynOutliningRegionTag, IBlockTag
ITextSnapshot
snapshot
,
BlockSpan
blockSpan
)
:
base
(
textEditorFactoryService
,
projectionBufferFactoryService
,
editorOptionsFactoryService
,
snapshot
,
blockSpan
)
projectionBufferFactoryService
,
editorOptionsFactoryService
,
snapshot
,
blockSpan
)
{
Parent
=
parent
;
Level
=
parent
==
null
?
0
:
parent
.
Level
+
1
;
...
...
@@ -87,21 +87,20 @@ public override bool Equals(object obj)
/// </summary>
public
bool
Equals
(
RoslynBlockTag
tag
)
{
return
tag
!=
null
&&
this
.
IsCollapsible
==
tag
.
IsCollapsible
&&
this
.
Level
==
tag
.
Level
&&
this
.
Type
==
tag
.
Type
&&
EqualityComparer
<
object
>.
Default
.
Equals
(
this
.
CollapsedForm
,
tag
.
CollapsedForm
)
&&
this
.
StatementSpan
==
tag
.
StatementSpan
&&
this
.
Span
==
tag
.
Span
;
return
base
.
Equals
(
tag
)
&&
IsCollapsible
==
tag
.
IsCollapsible
&&
Level
==
tag
.
Level
&&
Type
==
tag
.
Type
&&
StatementSpan
==
tag
.
StatementSpan
&&
Span
==
tag
.
Span
;
}
public
override
int
GetHashCode
()
{
return
Hash
.
Combine
(
this
.
IsCollapsible
,
return
Hash
.
Combine
(
base
.
GetHashCode
(),
Hash
.
Combine
(
this
.
IsCollapsible
,
Hash
.
Combine
(
this
.
Level
,
Hash
.
Combine
(
this
.
Type
,
Hash
.
Combine
(
this
.
CollapsedForm
,
Hash
.
Combine
(
this
.
StatementSpan
.
GetHashCode
(),
this
.
Span
.
GetHashCode
())))));
}
}
...
...
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml
浏览文件 @
e33a19e9
...
...
@@ -47,6 +47,8 @@
Content="{x:Static local:AdvancedOptionPageStrings.Option_Show_outlining_for_code_level_constructs}" />
<CheckBox x:Name="Show_outlining_for_comments_and_preprocessor_regions"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Show_outlining_for_comments_and_preprocessor_regions}" />
<CheckBox x:Name="Collapse_regions_when_collapsing_to_definitions"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Collapse_regions_when_collapsing_to_definitions}" />
</StackPanel>
</GroupBox>
<GroupBox x:Uid="BlockStructureGuidesGroupBox"
...
...
src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs
浏览文件 @
e33a19e9
...
...
@@ -29,6 +29,7 @@ public AdvancedOptionPageControl(IServiceProvider serviceProvider) : base(servic
BindToOption
(
Show_outlining_for_declaration_level_constructs
,
BlockStructureOptions
.
ShowOutliningForDeclarationLevelConstructs
,
LanguageNames
.
CSharp
);
BindToOption
(
Show_outlining_for_code_level_constructs
,
BlockStructureOptions
.
ShowOutliningForCodeLevelConstructs
,
LanguageNames
.
CSharp
);
BindToOption
(
Show_outlining_for_comments_and_preprocessor_regions
,
BlockStructureOptions
.
ShowOutliningForCommentsAndPreprocessorRegions
,
LanguageNames
.
CSharp
);
BindToOption
(
Collapse_regions_when_collapsing_to_definitions
,
BlockStructureOptions
.
CollapseRegionsWhenCollapsingToDefinitions
,
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
浏览文件 @
e33a19e9
...
...
@@ -99,6 +99,9 @@ public static string Option_Show_outlining_for_code_level_constructs
public
static
string
Option_Show_outlining_for_comments_and_preprocessor_regions
=>
ServicesVSResources
.
Show_outlining_for_comments_and_preprocessor_regions
;
public
static
string
Option_Collapse_regions_when_collapsing_to_definitions
=>
ServicesVSResources
.
Collapse_regions_when_collapsing_to_definitions
;
public
static
string
Option_Block_Structure_Guides
=>
ServicesVSResources
.
Block_Structure_Guides
;
...
...
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
浏览文件 @
e33a19e9
...
...
@@ -370,6 +370,15 @@ internal class ServicesVSResources {
}
}
/// <summary>
/// Looks up a localized string similar to Collapse #regions when collapsing to definitions.
/// </summary>
internal
static
string
Collapse_regions_when_collapsing_to_definitions
{
get
{
return
ResourceManager
.
GetString
(
"Collapse_regions_when_collapsing_to_definitions"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Computing remove suppressions fix....
/// </summary>
...
...
src/VisualStudio/Core/Def/ServicesVSResources.resx
浏览文件 @
e33a19e9
...
...
@@ -807,4 +807,7 @@ Additional information: {1}</value>
<data
name=
"Prefer_coalesce_expression"
xml:space=
"preserve"
>
<value>
Prefer coalesce expression
</value>
</data>
<data
name=
"Collapse_regions_when_collapsing_to_definitions"
xml:space=
"preserve"
>
<value>
Collapse #regions when collapsing to definitions
</value>
</data>
</root>
\ No newline at end of file
src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml
浏览文件 @
e33a19e9
...
...
@@ -48,6 +48,8 @@
Content="{x:Static local:AdvancedOptionPageStrings.Option_Show_outlining_for_code_level_constructs}" />
<CheckBox x:Name="Show_outlining_for_comments_and_preprocessor_regions"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Show_outlining_for_comments_and_preprocessor_regions}" />
<CheckBox x:Name="Collapse_regions_when_collapsing_to_definitions"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Collapse_regions_when_collapsing_to_definitions}" />
</StackPanel>
</GroupBox>
<GroupBox x:Uid="BlockStructureGuidesGroupBox"
...
...
src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml.vb
浏览文件 @
e33a19e9
...
...
@@ -4,7 +4,6 @@ Imports Microsoft.CodeAnalysis
Imports
Microsoft.CodeAnalysis.Editing
Imports
Microsoft.CodeAnalysis.Editor.Shared.Options
Imports
Microsoft.CodeAnalysis.ExtractMethod
Imports
Microsoft.CodeAnalysis.Shared.Options
Imports
Microsoft.CodeAnalysis.Structure
Imports
Microsoft.CodeAnalysis.SymbolSearch
Imports
Microsoft.VisualStudio.LanguageServices.Implementation
...
...
@@ -24,6 +23,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Options
BindToOption
(
Show_outlining_for_declaration_level_constructs
,
BlockStructureOptions
.
ShowOutliningForDeclarationLevelConstructs
,
LanguageNames
.
VisualBasic
)
BindToOption
(
Show_outlining_for_code_level_constructs
,
BlockStructureOptions
.
ShowOutliningForCodeLevelConstructs
,
LanguageNames
.
VisualBasic
)
BindToOption
(
Show_outlining_for_comments_and_preprocessor_regions
,
BlockStructureOptions
.
ShowOutliningForCommentsAndPreprocessorRegions
,
LanguageNames
.
VisualBasic
)
BindToOption
(
Collapse_regions_when_collapsing_to_definitions
,
BlockStructureOptions
.
CollapseRegionsWhenCollapsingToDefinitions
,
LanguageNames
.
VisualBasic
)
BindToOption
(
Show_guides_for_declaration_level_constructs
,
BlockStructureOptions
.
ShowBlockStructureGuidesForDeclarationLevelConstructs
,
LanguageNames
.
VisualBasic
)
BindToOption
(
Show_guides_for_code_level_constructs
,
BlockStructureOptions
.
ShowBlockStructureGuidesForCodeLevelConstructs
,
LanguageNames
.
VisualBasic
)
...
...
src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageStrings.vb
浏览文件 @
e33a19e9
...
...
@@ -134,6 +134,9 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Options
Public
ReadOnly
Property
Option_Show_outlining_for_comments_and_preprocessor_regions
As
String
=
ServicesVSResources
.
Show_outlining_for_comments_and_preprocessor_regions
Public
ReadOnly
Property
Option_Collapse_regions_when_collapsing_to_definitions
As
String
=
ServicesVSResources
.
Collapse_regions_when_collapsing_to_definitions
Public
ReadOnly
Property
Option_Block_Structure_Guides
As
String
=
ServicesVSResources
.
Block_Structure_Guides
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录