Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
7815502e
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,发现更多精彩内容 >>
提交
7815502e
编写于
4月 30, 2015
作者:
R
Ravi Chande
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2383 from rchande/CrefCompletion
Don't suggest type arguments in VB Crefs
上级
12a04c7d
d17920f3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
60 addition
and
8 deletion
+60
-8
src/EditorFeatures/VisualBasicTest/Completion/CompletionProviders/CrefCompletionProviderTests.vb
...letion/CompletionProviders/CrefCompletionProviderTests.vb
+34
-2
src/Features/VisualBasic/Completion/CompletionProviders/CrefCompletionProvider.vb
.../Completion/CompletionProviders/CrefCompletionProvider.vb
+26
-6
未找到文件。
src/EditorFeatures/VisualBasicTest/Completion/CompletionProviders/CrefCompletionProviderTests.vb
浏览文件 @
7815502e
...
@@ -84,7 +84,7 @@ End Module]]></File>.Value
...
@@ -84,7 +84,7 @@ End Module]]></File>.Value
End
Sub
End
Sub
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)
>
Public
Sub
InTypeParameterContext
()
Public
Sub
Not
InTypeParameterContext
()
Dim
text
=
<
File
><
!
[
CDATA
[
Dim
text
=
<
File
><
!
[
CDATA
[
Imports
System
Imports
System
...
@@ -96,7 +96,7 @@ Class Program(Of T)
...
@@ -96,7 +96,7 @@ Class Program(Of T)
End
Sub
End
Sub
End
Class
]]
></
File
>
.
Value
End
Class
]]
></
File
>
.
Value
VerifyItem
Exists
(
text
,
"Integer"
)
VerifyItem
IsAbsent
(
text
,
"Integer"
)
End
Sub
End
Sub
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)
>
...
@@ -368,5 +368,37 @@ End Class
...
@@ -368,5 +368,37 @@ End Class
VerifyProviderCommit
(
text
,
"List(Of T)"
,
expected
,
" "
c
,
"List(Of"
)
VerifyProviderCommit
(
text
,
"List(Of T)"
,
expected
,
" "
c
,
"List(Of"
)
End
Sub
End
Sub
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)
>
Public
Sub
OfAfterParen
()
Dim
text
=
<
File
><
!
[
CDATA
[
Imports
System
''' <summary>
''' <see cref="Foo($$
''' </summary>
Module
Program
Sub
Foo
()
End
Sub
End
Module
]]
></
File
>
.
Value
VerifyItemExists
(
text
,
"Of"
)
End
Sub
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)
>
Public
Sub
OfNotAfterComma
()
Dim
text
=
<
File
><
!
[
CDATA
[
Imports
System
''' <summary>
''' <see cref="Foo(a, $$
''' </summary>
Module
Program
Sub
Foo
()
End
Sub
End
Module
]]
></
File
>
.
Value
VerifyItemIsAbsent
(
text
,
"Of"
)
End
Sub
End
Class
End
Class
End
Namespace
End
Namespace
src/Features/VisualBasic/Completion/CompletionProviders/CrefCompletionProvider.vb
浏览文件 @
7815502e
...
@@ -70,10 +70,20 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
...
@@ -70,10 +70,20 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
Return
CreateCompletionItems
(
symbols
,
span
,
semanticModel
,
workspace
,
touchingToken
.
SpanStart
)
Return
CreateCompletionItems
(
symbols
,
span
,
semanticModel
,
workspace
,
touchingToken
.
SpanStart
)
End
If
End
If
If
IsParameterContext
(
touchingToken
)
OrElse
If
IsTypeParameterContext
(
touchingToken
)
Then
IsTypeParameterContext
(
touchingToken
)
Then
Return
Nothing
End
If
If
IsFirstParameterContext
(
touchingToken
)
OrElse
IsOtherParameterContext
(
touchingToken
)
Then
Dim
symbols
=
semanticModel
.
LookupNamespacesAndTypes
(
position
)
Dim
symbols
=
semanticModel
.
LookupNamespacesAndTypes
(
position
)
Return
CreateCompletionItems
(
symbols
,
span
,
semanticModel
,
workspace
,
touchingToken
.
SpanStart
)
Dim
items
=
CreateCompletionItems
(
symbols
,
span
,
semanticModel
,
workspace
,
touchingToken
.
SpanStart
)
If
(
IsFirstParameterContext
(
touchingToken
))
Then
' Include Of in case they're typing a type parameter
Return
items
.
Concat
(
CreateOfCompletionItem
(
span
))
End
If
Return
items
End
If
End
If
If
touchingToken
.
IsChildToken
(
Function
(
x
As
QualifiedNameSyntax
)
x
.
DotToken
)
Then
If
touchingToken
.
IsChildToken
(
Function
(
x
As
QualifiedNameSyntax
)
x
.
DotToken
)
Then
...
@@ -129,9 +139,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
...
@@ -129,9 +139,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
Return
False
Return
False
End
Function
End
Function
Private
Shared
Function
IsParameterContext
(
ByRef
touchingToken
As
SyntaxToken
)
As
Boolean
Private
Shared
Function
IsFirstParameterContext
(
ByRef
touchingToken
As
SyntaxToken
)
As
Boolean
Return
touchingToken
.
IsChildToken
(
Function
(
x
As
CrefSignatureSyntax
)
x
.
OpenParenToken
)
OrElse
Return
touchingToken
.
IsChildToken
(
Function
(
x
As
CrefSignatureSyntax
)
x
.
OpenParenToken
)
touchingToken
.
IsChildSeparatorToken
(
Function
(
p
As
CrefSignatureSyntax
)
p
.
ArgumentTypes
)
End
Function
Private
Shared
Function
IsOtherParameterContext
(
ByRef
touchingToken
As
SyntaxToken
)
As
Boolean
Return
touchingToken
.
IsChildSeparatorToken
(
Function
(
p
As
CrefSignatureSyntax
)
p
.
ArgumentTypes
)
End
Function
End
Function
Private
Shared
Function
IsCrefStartPosition
(
ByRef
touchingToken
As
SyntaxToken
)
As
Boolean
Private
Shared
Function
IsCrefStartPosition
(
ByRef
touchingToken
As
SyntaxToken
)
As
Boolean
...
@@ -176,6 +189,13 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
...
@@ -176,6 +189,13 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
End
Function
)
End
Function
)
End
Function
End
Function
Private
Function
CreateOfCompletionItem
(
span
As
TextSpan
)
As
IEnumerable
(
Of
CompletionItem
)
Dim
item
=
New
CompletionItem
(
Me
,
"Of"
,
span
,
glyph
:
=
Glyph
.
Keyword
,
descriptionFactory
:
=
Function
(
c
As
CancellationToken
)
Task
.
FromResult
(
RecommendedKeyword
.
CreateDisplayParts
(
"Of"
,
VBFeaturesResources
.
OfKeywordToolTip
)))
Return
SpecializedCollections
.
SingletonEnumerable
(
item
)
End
Function
Protected
Overrides
Function
IsExclusiveAsync
(
document
As
Document
,
position
As
Integer
,
triggerInfo
As
CompletionTriggerInfo
,
cancellationToken
As
CancellationToken
)
As
Task
(
Of
Boolean
)
Protected
Overrides
Function
IsExclusiveAsync
(
document
As
Document
,
position
As
Integer
,
triggerInfo
As
CompletionTriggerInfo
,
cancellationToken
As
CancellationToken
)
As
Task
(
Of
Boolean
)
Return
SpecializedTasks
.
True
Return
SpecializedTasks
.
True
End
Function
End
Function
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录