Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
23df39c7
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,发现更多精彩内容 >>
提交
23df39c7
编写于
11月 07, 2016
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't include attributes in the indent guide tooltip for VB.
上级
fe08f95f
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
50 addition
and
27 deletion
+50
-27
src/Features/VisualBasic/Portable/Structure/Providers/AccessorDeclarationStructureProvider.vb
...ructure/Providers/AccessorDeclarationStructureProvider.vb
+2
-1
src/Features/VisualBasic/Portable/Structure/Providers/CompilationUnitStructureProvider.vb
...e/Structure/Providers/CompilationUnitStructureProvider.vb
+13
-4
src/Features/VisualBasic/Portable/Structure/Providers/DisabledTextTriviaStructureProvider.vb
...tructure/Providers/DisabledTextTriviaStructureProvider.vb
+2
-1
src/Features/VisualBasic/Portable/Structure/Providers/DocumentationCommentStructureProvider.vb
...ucture/Providers/DocumentationCommentStructureProvider.vb
+1
-1
src/Features/VisualBasic/Portable/Structure/Providers/MetadataAsSource/MetadataRegionDirectiveStructureProvider.vb
...adataAsSource/MetadataRegionDirectiveStructureProvider.vb
+2
-1
src/Features/VisualBasic/Portable/Structure/Providers/RegionDirectiveStructureProvider.vb
...e/Structure/Providers/RegionDirectiveStructureProvider.vb
+2
-1
src/Features/VisualBasic/Portable/Structure/Providers/XmlExpressionStructureProvider.vb
...ble/Structure/Providers/XmlExpressionStructureProvider.vb
+1
-1
src/Features/VisualBasic/Portable/Structure/VisualBasicStructureHelpers.vb
...alBasic/Portable/Structure/VisualBasicStructureHelpers.vb
+27
-17
未找到文件。
src/Features/VisualBasic/Portable/Structure/Providers/AccessorDeclarationStructureProvider.vb
浏览文件 @
23df39c7
...
...
@@ -19,7 +19,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure
If
Not
block
?
.
EndBlockStatement
.
IsMissing
Then
spans
.
AddIfNotNull
(
CreateBlockSpanFromBlock
(
block
,
bannerNode
:
=
accessorDeclaration
,
autoCollapse
:
=
True
,
type
:
=
BlockTypes
.
Member
,
isCollapsible
:
=
True
))
autoCollapse
:
=
True
,
type
:
=
BlockTypes
.
Member
,
isCollapsible
:
=
True
))
End
If
End
Sub
End
Class
...
...
src/Features/VisualBasic/Portable/Structure/Providers/CompilationUnitStructureProvider.vb
浏览文件 @
23df39c7
...
...
@@ -3,6 +3,7 @@
Imports
System.Threading
Imports
Microsoft.CodeAnalysis.Options
Imports
Microsoft.CodeAnalysis.Structure
Imports
Microsoft.CodeAnalysis.Text
Imports
Microsoft.CodeAnalysis.VisualBasic.Syntax
Namespace
Microsoft.CodeAnalysis.VisualBasic.Structure
...
...
@@ -14,10 +15,18 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure
options
As
OptionSet
,
cancellationToken
As
CancellationToken
)
CollectCommentsRegions
(
compilationUnit
,
spans
)
spans
.
AddIfNotNull
(
CreateBlockSpan
(
compilationUnit
.
Imports
,
bannerText
:
=
"Imports"
&
SpaceEllipsis
,
autoCollapse
:
=
True
,
type
:
=
BlockTypes
.
Imports
,
isCollapsible
:
=
True
))
CollectCommentsRegions
(
compilationUnit
.
EndOfFileToken
.
LeadingTrivia
,
spans
)
If
Not
compilationUnit
.
Imports
.
IsEmpty
Then
Dim
startPos
=
compilationUnit
.
Imports
.
First
().
SpanStart
Dim
endPos
=
compilationUnit
.
Imports
.
Last
().
Span
.
End
Dim
span
=
TextSpan
.
FromBounds
(
startPos
,
endPos
)
spans
.
AddIfNotNull
(
CreateBlockSpan
(
span
,
span
,
bannerText
:
=
"Imports"
&
SpaceEllipsis
,
autoCollapse
:
=
True
,
type
:
=
BlockTypes
.
Imports
,
isCollapsible
:
=
True
,
isDefaultCollapsed
:
=
False
))
CollectCommentsRegions
(
compilationUnit
.
EndOfFileToken
.
LeadingTrivia
,
spans
)
End
If
End
Sub
Protected
Overrides
Function
SupportedInWorkspaceKind
(
kind
As
String
)
As
Boolean
...
...
src/Features/VisualBasic/Portable/Structure/Providers/DisabledTextTriviaStructureProvider.vb
浏览文件 @
23df39c7
...
...
@@ -17,8 +17,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure
Dim
startPos
=
nodeSpan
.
Start
Dim
endPos
=
startPos
+
trivia
.
ToString
().
TrimEnd
().
Length
Dim
span
=
TextSpan
.
FromBounds
(
startPos
,
endPos
)
spans
.
AddIfNotNull
(
CreateBlockSpan
(
span
:
=
TextSpan
.
FromBounds
(
startPos
,
endPos
)
,
span
:
=
span
,
hintSpan
:
=
span
,
bannerText
:
=
Ellipsis
,
autoCollapse
:
=
True
,
type
:
=
BlockTypes
.
PreprocessorRegion
,
isCollapsible
:
=
True
,
isDefaultCollapsed
:
=
False
))
...
...
src/Features/VisualBasic/Portable/Structure/Providers/DocumentationCommentStructureProvider.vb
浏览文件 @
23df39c7
...
...
@@ -89,7 +89,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure
Dim
fullSpan
=
TextSpan
.
FromBounds
(
startPos
,
endPos
)
spans
.
AddIfNotNull
(
CreateBlockSpan
(
fullSpan
,
GetBannerText
(
documentationComment
,
cancellationToken
),
fullSpan
,
fullSpan
,
GetBannerText
(
documentationComment
,
cancellationToken
),
autoCollapse
:
=
True
,
type
:
=
BlockTypes
.
Comment
,
isCollapsible
:
=
True
,
isDefaultCollapsed
:
=
False
))
End
Sub
...
...
src/Features/VisualBasic/Portable/Structure/Providers/MetadataAsSource/MetadataRegionDirectiveStructureProvider.vb
浏览文件 @
23df39c7
...
...
@@ -26,8 +26,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure.MetadataAsSource
cancellationToken
As
CancellationToken
)
Dim
match
=
regionDirective
.
GetMatchingStartOrEndDirective
(
cancellationToken
)
If
match
IsNot
Nothing
Then
Dim
span
=
TextSpan
.
FromBounds
(
regionDirective
.
SpanStart
,
match
.
Span
.
End
)
spans
.
AddIfNotNull
(
CreateBlockSpan
(
TextSpan
.
FromBounds
(
regionDirective
.
SpanStart
,
match
.
Span
.
End
)
,
span
,
span
,
GetBannerText
(
regionDirective
),
autoCollapse
:
=
True
,
type
:
=
BlockTypes
.
PreprocessorRegion
,
isCollapsible
:
=
True
,
isDefaultCollapsed
:
=
False
))
...
...
src/Features/VisualBasic/Portable/Structure/Providers/RegionDirectiveStructureProvider.vb
浏览文件 @
23df39c7
...
...
@@ -29,8 +29,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure
Dim
autoCollapse
=
options
.
GetOption
(
BlockStructureOptions
.
CollapseRegionsWhenCollapsingToDefinitions
,
LanguageNames
.
VisualBasic
)
Dim
span
=
TextSpan
.
FromBounds
(
regionDirective
.
SpanStart
,
matchingDirective
.
Span
.
End
)
spans
.
AddIfNotNull
(
CreateBlockSpan
(
TextSpan
.
FromBounds
(
regionDirective
.
SpanStart
,
matchingDirective
.
Span
.
End
)
,
span
,
span
,
GetBannerText
(
regionDirective
),
autoCollapse
:
=
autoCollapse
,
isDefaultCollapsed
:
=
True
,
...
...
src/Features/VisualBasic/Portable/Structure/Providers/XmlExpressionStructureProvider.vb
浏览文件 @
23df39c7
...
...
@@ -25,7 +25,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure
Dim
bannerText
=
lineText
&
SpaceEllipsis
spans
.
AddIfNotNull
(
CreateBlockSpan
(
span
,
bannerText
,
autoCollapse
:
=
False
,
span
,
span
,
bannerText
,
autoCollapse
:
=
False
,
type
:
=
BlockTypes
.
Expression
,
isCollapsible
:
=
True
,
isDefaultCollapsed
:
=
False
))
End
Sub
...
...
src/Features/VisualBasic/Portable/Structure/VisualBasicStructureHelpers.vb
浏览文件 @
23df39c7
...
...
@@ -3,6 +3,7 @@
Imports
System.Collections.Immutable
Imports
Microsoft.CodeAnalysis.Structure
Imports
Microsoft.CodeAnalysis.Text
Imports
Microsoft.CodeAnalysis.VisualBasic.Syntax
Namespace
Microsoft.CodeAnalysis.VisualBasic.Structure
Friend
Module
VisualBasicOutliningHelpers
...
...
@@ -20,12 +21,14 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure
Private
Function
CreateCommentsRegion
(
startComment
As
SyntaxTrivia
,
endComment
As
SyntaxTrivia
)
As
BlockSpan
?
Dim
span
=
TextSpan
.
FromBounds
(
startComment
.
SpanStart
,
endComment
.
Span
.
End
)
Return
CreateBlockSpan
(
TextSpan
.
FromBounds
(
startComment
.
SpanStart
,
endComment
.
Span
.
End
)
,
span
,
span
,
GetCommentBannerText
(
startComment
),
autoCollapse
:
=
True
,
type
:
=
BlockTypes
.
Comment
,
isCollapsible
:
=
True
,
isDefaultCollapsed
:
=
False
)
isCollapsible
:
=
True
,
isDefaultCollapsed
:
=
False
)
End
Function
' For testing purposes
...
...
@@ -78,6 +81,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure
Friend
Function
CreateBlockSpan
(
span
As
TextSpan
,
hintSpan
As
TextSpan
,
bannerText
As
String
,
autoCollapse
As
Boolean
,
type
As
String
,
...
...
@@ -85,6 +89,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure
isDefaultCollapsed
As
Boolean
)
As
BlockSpan
?
Return
New
BlockSpan
(
textSpan
:
=
span
,
hintSpan
:
=
hintSpan
,
bannerText
:
=
bannerText
,
autoCollapse
:
=
autoCollapse
,
isDefaultCollapsed
:
=
isDefaultCollapsed
,
...
...
@@ -98,8 +103,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure
autoCollapse
As
Boolean
,
type
As
String
,
isCollapsible
As
Boolean
)
As
BlockSpan
?
Return
CreateBlockSpan
(
blockNode
.
Span
,
bannerText
,
autoCollapse
,
type
,
isCollapsible
,
isDefaultCollapsed
:
=
False
)
Return
CreateBlockSpan
(
blockNode
.
Span
,
GetHintSpan
(
blockNode
),
bannerText
,
autoCollapse
,
type
,
isCollapsible
,
isDefaultCollapsed
:
=
False
)
End
Function
Friend
Function
CreateBlockSpanFromBlock
(
...
...
@@ -109,24 +116,27 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure
type
As
String
,
isCollapsible
As
Boolean
)
As
BlockSpan
?
Return
CreateBlockSpan
(
blockNode
.
Span
,
GetNodeBannerText
(
bannerNode
),
blockNode
.
Span
,
GetHintSpan
(
blockNode
),
GetNodeBannerText
(
bannerNode
),
autoCollapse
,
type
,
isCollapsible
,
isDefaultCollapsed
:
=
False
)
End
Function
Friend
Function
CreateBlockSpan
(
syntaxList
As
IEnumerable
(
Of
SyntaxNode
),
bannerText
As
String
,
autoCollapse
As
Boolean
,
type
As
String
,
isCollapsible
As
Boolean
)
As
BlockSpan
?
If
syntaxList
.
IsEmpty
()
Then
Return
Nothing
Private
Function
GetHintSpan
(
blockNode
As
SyntaxNode
)
As
TextSpan
' Don't include attributes in the hint-span for a block. We don't want
' the attributes to show up when users hover over indent guide lines.
Dim
firstToken
=
blockNode
.
GetFirstToken
()
If
firstToken
.
Kind
()
=
SyntaxKind
.
LessThanToken
AndAlso
firstToken
.
Parent
.
IsKind
(
SyntaxKind
.
AttributeList
)
Then
Dim
attributeOwner
=
firstToken
.
Parent
.
Parent
For
Each
child
In
attributeOwner
.
ChildNodesAndTokens
If
child
.
Kind
()
<>
SyntaxKind
.
AttributeList
Then
Return
TextSpan
.
FromBounds
(
child
.
SpanStart
,
child
.
Span
.
End
)
End
If
Next
End
If
Dim
startPos
=
syntaxList
.
First
().
SpanStart
Dim
endPos
=
syntaxList
.
Last
().
Span
.
End
Return
CreateBlockSpan
(
TextSpan
.
FromBounds
(
startPos
,
endPos
),
bannerText
,
autoCollapse
,
type
,
isCollapsible
,
isDefaultCollapsed
:
=
False
)
Return
blockNode
.
Span
End
Function
End
Module
End
Namespace
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录