Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
dedba13d
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,发现更多精彩内容 >>
提交
dedba13d
编写于
9月 14, 2015
作者:
D
Dustin Campbell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Code review feedback for C# and VB cref completion clean up
上级
f74d5081
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
23 deletion
+8
-23
src/Features/CSharp/Portable/Completion/CompletionProviders/CrefCompletionProvider.cs
.../Completion/CompletionProviders/CrefCompletionProvider.cs
+2
-7
src/Features/VisualBasic/Portable/Completion/CompletionProviders/CrefCompletionProvider.vb
.../Completion/CompletionProviders/CrefCompletionProvider.vb
+2
-6
src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs
...aces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs
+4
-9
src/Workspaces/VisualBasic/Portable/Extensions/ContextQuery/SyntaxTreeExtensions.vb
.../Portable/Extensions/ContextQuery/SyntaxTreeExtensions.vb
+0
-1
未找到文件。
src/Features/CSharp/Portable/Completion/CompletionProviders/CrefCompletionProvider.cs
浏览文件 @
dedba13d
...
...
@@ -59,11 +59,6 @@ public override async Task ProduceCompletionListAsync(CompletionListContext cont
var
token
=
tree
.
FindTokenOnLeftOfPosition
(
position
,
cancellationToken
)
.
GetPreviousTokenIfTouchingWord
(
position
);
if
(
token
.
Kind
()
==
SyntaxKind
.
None
)
{
return
;
}
// To get a Speculative SemanticModel (which is much faster), we need to
// walk up to the node the DocumentationTrivia is attached to.
var
parentNode
=
token
.
Parent
.
FirstAncestorOrSelf
<
DocumentationCommentTriviaSyntax
>()?.
ParentTrivia
.
Token
.
Parent
;
...
...
@@ -218,8 +213,8 @@ private static TextSpan GetTextChangeSpan(SourceText text, int position)
return
CommonCompletionUtilities
.
GetTextChangeSpan
(
text
,
position
,
(
ch
)
=>
CompletionUtilities
.
IsTextChangeSpanStartCharacter
(
ch
)
||
ch
==
'{'
,
(
ch
)
=>
CompletionUtilities
.
IsWordCharacter
(
ch
)
||
ch
==
'{'
||
ch
==
'}'
);
ch
=>
CompletionUtilities
.
IsTextChangeSpanStartCharacter
(
ch
)
||
ch
==
'{'
,
ch
=>
CompletionUtilities
.
IsWordCharacter
(
ch
)
||
ch
==
'{'
||
ch
==
'}'
);
}
private
IEnumerable
<
CompletionItem
>
CreateCompletionItems
(
...
...
src/Features/VisualBasic/Portable/Completion/CompletionProviders/CrefCompletionProvider.vb
浏览文件 @
dedba13d
...
...
@@ -7,6 +7,7 @@ Imports Microsoft.CodeAnalysis.Completion
Imports
Microsoft.CodeAnalysis.Completion.Providers
Imports
Microsoft.CodeAnalysis.Options
Imports
Microsoft.CodeAnalysis.Text
Imports
Microsoft.CodeAnalysis.VisualBasic.Extensions.ContextQuery
Imports
Microsoft.CodeAnalysis.VisualBasic.Syntax
Namespace
Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
...
...
@@ -31,12 +32,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
Dim
cancellationToken
=
context
.
CancellationToken
Dim
tree
=
Await
document
.
GetSyntaxTreeAsync
(
cancellationToken
).
ConfigureAwait
(
False
)
Dim
token
=
tree
.
FindTokenOnLeftOfPosition
(
position
,
cancellationToken
)
_
.
GetPreviousTokenIfTouchingWord
(
position
)
If
token
.
Kind
=
SyntaxKind
.
None
Then
Return
End
If
Dim
token
=
tree
.
GetTargetToken
(
position
,
cancellationToken
)
If
IsCrefTypeParameterContext
(
token
)
Then
Return
...
...
src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs
浏览文件 @
dedba13d
...
...
@@ -394,7 +394,7 @@ public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol symbol
{
return
symbol
.
TypeSwitch
(
(
IMethodSymbol
m
)
=>
m
.
Parameters
,
(
IPropertySymbol
p
)
=>
p
.
Parameters
,
(
IPropertySymbol
nt
)
=>
nt
.
Parameters
,
_
=>
ImmutableArray
.
Create
<
IParameterSymbol
>());
}
...
...
@@ -416,7 +416,8 @@ public static ImmutableArray<ITypeSymbol> GetTypeArguments(this ISymbol symbol)
public
static
ImmutableArray
<
ITypeSymbol
>
GetAllTypeArguments
(
this
ISymbol
symbol
)
{
var
results
=
new
List
<
ITypeSymbol
>(
symbol
.
GetTypeArguments
());
var
results
=
ImmutableArray
.
CreateBuilder
<
ITypeSymbol
>();
results
.
AddRange
(
symbol
.
GetTypeArguments
());
var
containingType
=
symbol
.
ContainingType
;
while
(
containingType
!=
null
)
...
...
@@ -425,7 +426,7 @@ public static ImmutableArray<ITypeSymbol> GetAllTypeArguments(this ISymbol symbo
containingType
=
containingType
.
ContainingType
;
}
return
ImmutableArray
.
CreateRange
(
results
);
return
results
.
AsImmutable
(
);
}
public
static
bool
IsAttribute
(
this
ISymbol
symbol
)
...
...
@@ -517,12 +518,6 @@ public static bool IsUnsafe(this ISymbol member)
return
compilation
.
ObjectType
;
}
public
static
bool
IsDeprecated
(
this
ISymbol
symbol
)
{
// TODO(cyrusn): Implement this
return
false
;
}
public
static
bool
IsStaticType
(
this
ISymbol
symbol
)
{
return
symbol
!=
null
&&
symbol
.
Kind
==
SymbolKind
.
NamedType
&&
symbol
.
IsStatic
;
...
...
src/Workspaces/VisualBasic/Portable/Extensions/ContextQuery/SyntaxTreeExtensions.vb
浏览文件 @
dedba13d
...
...
@@ -27,7 +27,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions.ContextQuery
End
If
token
=
token
.
GetPreviousToken
()
Loop
Return
token
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录