Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
67e0234f
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,发现更多精彩内容 >>
提交
67e0234f
编写于
11月 20, 2016
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use inline variables.
上级
361235cc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
21 deletion
+10
-21
src/Workspaces/Core/Portable/Shared/Extensions/ICodeDefinitionFactoryExtensions.cs
...ble/Shared/Extensions/ICodeDefinitionFactoryExtensions.cs
+3
-6
src/Workspaces/Core/Portable/Shared/Extensions/ITypeSymbolExtensions.SubstituteTypesVisitor.cs
...xtensions/ITypeSymbolExtensions.SubstituteTypesVisitor.cs
+1
-2
src/Workspaces/Core/Portable/Shared/Extensions/SyntaxNodeExtensions.cs
...s/Core/Portable/Shared/Extensions/SyntaxNodeExtensions.cs
+6
-13
未找到文件。
src/Workspaces/Core/Portable/Shared/Extensions/ICodeDefinitionFactoryExtensions.cs
浏览文件 @
67e0234f
...
...
@@ -132,8 +132,7 @@ internal static partial class ICodeDefinitionFactoryExtensions
{
// For non-out parameters, create a field and assign the parameter to it.
// TODO: I'm not sure that's what we really want for ref parameters.
string
fieldName
;
if
(
TryGetValue
(
parameterToNewFieldMap
,
parameterName
,
out
fieldName
))
if
(
TryGetValue
(
parameterToNewFieldMap
,
parameterName
,
out
var
fieldName
))
{
yield
return
CodeGenerationSymbolFactory
.
CreateFieldSymbol
(
attributes
:
null
,
...
...
@@ -157,8 +156,7 @@ private static bool TryGetValue(IDictionary<string, string> dictionary, string k
private
static
bool
TryGetValue
(
IDictionary
<
string
,
ISymbol
>
dictionary
,
string
key
,
out
string
value
)
{
value
=
null
;
ISymbol
symbol
;
if
(
dictionary
!=
null
&&
dictionary
.
TryGetValue
(
key
,
out
symbol
))
if
(
dictionary
!=
null
&&
dictionary
.
TryGetValue
(
key
,
out
var
symbol
))
{
value
=
symbol
.
Name
;
return
true
;
...
...
@@ -193,8 +191,7 @@ private static bool TryGetValue(IDictionary<string, ISymbol> dictionary, string
{
// For non-out parameters, create a field and assign the parameter to it.
// TODO: I'm not sure that's what we really want for ref parameters.
string
fieldName
;
if
(
TryGetValue
(
parameterToExistingFieldMap
,
parameterName
,
out
fieldName
)
||
if
(
TryGetValue
(
parameterToExistingFieldMap
,
parameterName
,
out
var
fieldName
)
||
TryGetValue
(
parameterToNewFieldMap
,
parameterName
,
out
fieldName
))
{
var
fieldAccess
=
factory
.
MemberAccessExpression
(
factory
.
ThisExpression
(),
factory
.
IdentifierName
(
fieldName
))
...
...
src/Workspaces/Core/Portable/Shared/Extensions/ITypeSymbolExtensions.SubstituteTypesVisitor.cs
浏览文件 @
67e0234f
...
...
@@ -31,8 +31,7 @@ public override ITypeSymbol DefaultVisit(ISymbol node)
private
ITypeSymbol
VisitType
(
ITypeSymbol
symbol
)
{
TType2
converted
;
if
(
symbol
is
TType1
&&
_map
.
TryGetValue
((
TType1
)
symbol
,
out
converted
))
if
(
symbol
is
TType1
&&
_map
.
TryGetValue
((
TType1
)
symbol
,
out
var
converted
))
{
return
converted
;
}
...
...
src/Workspaces/Core/Portable/Shared/Extensions/SyntaxNodeExtensions.cs
浏览文件 @
67e0234f
...
...
@@ -434,17 +434,13 @@ public static bool OverlapsHiddenPosition(this SyntaxNode declaration, SyntaxNod
// should ensure that parent nodes are not processed in the same batch as child nodes.
if
(
previous
==
default
(
TextSpan
)
||
!
previous
.
IntersectsWith
(
span
))
{
SyntaxNode
currentNode
;
SyntaxToken
currentToken
;
SyntaxTrivia
currentTrivia
;
if
(
nodesToReplace
.
TryGetValue
(
span
,
out
currentNode
))
if
(
nodesToReplace
.
TryGetValue
(
span
,
out
var
currentNode
))
{
var
original
=
(
SyntaxNode
)
retryAnnotations
.
GetAnnotations
(
currentNode
).
SingleOrDefault
()
??
currentNode
;
var
newNode
=
await
computeReplacementNodeAsync
(
original
,
currentNode
,
cancellationToken
).
ConfigureAwait
(
false
);
nodeReplacements
[
currentNode
]
=
newNode
;
}
else
if
(
tokensToReplace
.
TryGetValue
(
span
,
out
currentToken
))
else
if
(
tokensToReplace
.
TryGetValue
(
span
,
out
var
currentToken
))
{
var
original
=
(
SyntaxToken
)
retryAnnotations
.
GetAnnotations
(
currentToken
).
SingleOrDefault
();
if
(
original
==
default
(
SyntaxToken
))
...
...
@@ -455,7 +451,7 @@ public static bool OverlapsHiddenPosition(this SyntaxNode declaration, SyntaxNod
var
newToken
=
await
computeReplacementTokenAsync
(
original
,
currentToken
,
cancellationToken
).
ConfigureAwait
(
false
);
tokenReplacements
[
currentToken
]
=
newToken
;
}
else
if
(
triviaToReplace
.
TryGetValue
(
span
,
out
currentTrivia
))
else
if
(
triviaToReplace
.
TryGetValue
(
span
,
out
var
currentTrivia
))
{
var
original
=
(
SyntaxTrivia
)
retryAnnotations
.
GetAnnotations
(
currentTrivia
).
SingleOrDefault
();
if
(
original
==
default
(
SyntaxTrivia
))
...
...
@@ -481,8 +477,7 @@ public static bool OverlapsHiddenPosition(this SyntaxNode declaration, SyntaxNod
nodes
:
nodesToReplace
.
Values
,
computeReplacementNode
:
(
original
,
rewritten
)
=>
{
SyntaxNode
replaced
;
if
(
rewritten
!=
original
||
!
nodeReplacements
.
TryGetValue
(
original
,
out
replaced
))
if
(
rewritten
!=
original
||
!
nodeReplacements
.
TryGetValue
(
original
,
out
var
replaced
))
{
// the subtree did change, or we didn't have a replacement for it in this batch
// so we need to add an annotation so we can find this node again for the next batch.
...
...
@@ -495,8 +490,7 @@ public static bool OverlapsHiddenPosition(this SyntaxNode declaration, SyntaxNod
tokens
:
tokensToReplace
.
Values
,
computeReplacementToken
:
(
original
,
rewritten
)
=>
{
SyntaxToken
replaced
;
if
(
rewritten
!=
original
||
!
tokenReplacements
.
TryGetValue
(
original
,
out
replaced
))
if
(
rewritten
!=
original
||
!
tokenReplacements
.
TryGetValue
(
original
,
out
var
replaced
))
{
// the subtree did change, or we didn't have a replacement for it in this batch
// so we need to add an annotation so we can find this node again for the next batch.
...
...
@@ -509,8 +503,7 @@ public static bool OverlapsHiddenPosition(this SyntaxNode declaration, SyntaxNod
trivia
:
triviaToReplace
.
Values
,
computeReplacementTrivia
:
(
original
,
rewritten
)
=>
{
SyntaxTrivia
replaced
;
if
(!
triviaReplacements
.
TryGetValue
(
original
,
out
replaced
))
if
(!
triviaReplacements
.
TryGetValue
(
original
,
out
var
replaced
))
{
// the subtree did change, or we didn't have a replacement for it in this batch
// so we need to add an annotation so we can find this node again for the next batch.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录