Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
71788e59
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,发现更多精彩内容 >>
提交
71788e59
编写于
9月 13, 2016
作者:
V
VSadov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Made IDE change very specific to the affected scenario
More CR feedback
上级
5a7d3afc
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
11 deletion
+20
-11
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Conversion.cs
...rtable/Lowering/LocalRewriter/LocalRewriter_Conversion.cs
+1
-1
src/Compilers/CSharp/Portable/Symbols/Tuples/TupleTypeSymbol.cs
...mpilers/CSharp/Portable/Symbols/Tuples/TupleTypeSymbol.cs
+5
-5
src/Compilers/VisualBasic/Portable/Symbols/Tuples/TupleErrorFieldSymbol.vb
...ualBasic/Portable/Symbols/Tuples/TupleErrorFieldSymbol.vb
+2
-2
src/Compilers/VisualBasic/Portable/Symbols/Tuples/TupleFieldSymbol.vb
...s/VisualBasic/Portable/Symbols/Tuples/TupleFieldSymbol.vb
+2
-2
src/EditorFeatures/Core/Implementation/RenameTracking/RenameTrackingTaggerProvider.TrackingSession.cs
...eTracking/RenameTrackingTaggerProvider.TrackingSession.cs
+10
-1
未找到文件。
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Conversion.cs
浏览文件 @
71788e59
...
...
@@ -618,7 +618,7 @@ private BoundExpression MakeImplicitConversion(BoundExpression rewrittenOperand,
tupleTypeSymbol
=
TupleTypeSymbol
.
Create
((
NamedTypeSymbol
)
srcType
);
}
var
srcElementFields
=
((
TupleTypeSymbol
)
srcType
)
.
TupleDefaultElementFields
;
var
srcElementFields
=
tupleTypeSymbol
.
TupleDefaultElementFields
;
var
fieldAccessorsBuilder
=
ArrayBuilder
<
BoundExpression
>.
GetInstance
(
numElements
);
BoundAssignmentOperator
assignmentToTemp
;
...
...
src/Compilers/CSharp/Portable/Symbols/Tuples/TupleTypeSymbol.cs
浏览文件 @
71788e59
...
...
@@ -845,10 +845,10 @@ private ImmutableArray<Symbol> CreateMembers()
if
(
defaultImplicitlyDeclared
&&
providedName
!=
null
)
{
// The name given doesn't match the default name Item8, etc.
// Add a virtual field with the given name
// tupleFieldIndex << 1 + 1, because this is not a default element
members
.
Add
(
new
TupleVirtualElementFieldSymbol
(
this
,
fieldSymbol
,
providedName
,
(
tupleFieldIndex
<<
1
)
+
1
,
location
,
isImplicitlyDeclared
:
false
));
// The name given doesn't match the default name Item8, etc.
// Add a virtual field with the given name
// tupleFieldIndex << 1 + 1, because this is not a default element
members
.
Add
(
new
TupleVirtualElementFieldSymbol
(
this
,
fieldSymbol
,
providedName
,
(
tupleFieldIndex
<<
1
)
+
1
,
location
,
isImplicitlyDeclared
:
false
));
}
elementsMatchedByFields
[
tupleFieldIndex
]
=
true
;
// mark as handled
...
...
@@ -937,7 +937,7 @@ private ImmutableArray<Symbol> CreateMembers()
// Add default element field.
// i << 1 because this is a default element
members
.
Add
(
new
TupleErrorFieldSymbol
(
this
,
defaultName
,
i
<<
1
,
defaultImplicitlyDeclared
?
null
:
location
,
_elementTypes
[
i
],
diagnosticInfo
,
defaultImplicitlyDeclared
));
members
.
Add
(
new
TupleErrorFieldSymbol
(
this
,
defaultName
,
i
<<
1
,
defaultImplicitlyDeclared
?
null
:
location
,
_elementTypes
[
i
],
diagnosticInfo
,
defaultImplicitlyDeclared
));
if
(
defaultImplicitlyDeclared
&&
providedName
!=
null
)
...
...
src/Compilers/VisualBasic/Portable/Symbols/Tuples/TupleErrorFieldSymbol.vb
浏览文件 @
71788e59
...
...
@@ -83,12 +83,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End
Get
End
Property
Public
Sub
New
(
container
As
NamedTypeSymbol
,
name
As
String
,
tuple
FieldId
As
Integer
,
location
As
Location
,
type
As
TypeSymbol
,
useSiteDiagnosticInfo
As
DiagnosticInfo
,
isImplicitlyDeclared
As
Boolean
)
Public
Sub
New
(
container
As
NamedTypeSymbol
,
name
As
String
,
tuple
ElementIndex
As
Integer
,
location
As
Location
,
type
As
TypeSymbol
,
useSiteDiagnosticInfo
As
DiagnosticInfo
,
isImplicitlyDeclared
As
Boolean
)
MyBase
.
New
(
container
,
container
,
type
,
name
,
Accessibility
.
Public
)
Debug
.
Assert
(
name
<>
Nothing
)
Me
.
_locations
=
If
((
location
Is
Nothing
),
ImmutableArray
(
Of
Location
).
Empty
,
ImmutableArray
.
Create
(
Of
Location
)(
location
))
Me
.
_useSiteDiagnosticInfo
=
useSiteDiagnosticInfo
Me
.
_tupleElementIndex
=
tuple
FieldId
Me
.
_tupleElementIndex
=
tuple
ElementIndex
Me
.
_isImplicitlyDeclared
=
isImplicitlyDeclared
End
Sub
...
...
src/Compilers/VisualBasic/Portable/Symbols/Tuples/TupleFieldSymbol.vb
浏览文件 @
71788e59
...
...
@@ -175,8 +175,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End
Get
End
Property
Public
Sub
New
(
container
As
TupleTypeSymbol
,
underlyingField
As
FieldSymbol
,
tuple
FieldId
As
Integer
,
location
As
Location
,
isImplicitlyDeclared
As
Boolean
)
MyBase
.
New
(
container
,
underlyingField
,
tuple
FieldId
)
Public
Sub
New
(
container
As
TupleTypeSymbol
,
underlyingField
As
FieldSymbol
,
tuple
ElementIndex
As
Integer
,
location
As
Location
,
isImplicitlyDeclared
As
Boolean
)
MyBase
.
New
(
container
,
underlyingField
,
tuple
ElementIndex
)
Me
.
_locations
=
If
((
location
Is
Nothing
),
ImmutableArray
(
Of
Location
).
Empty
,
ImmutableArray
.
Create
(
Of
Location
)(
location
))
Me
.
_isImplicitlyDeclared
=
isImplicitlyDeclared
End
Sub
...
...
src/EditorFeatures/Core/Implementation/RenameTracking/RenameTrackingTaggerProvider.TrackingSession.cs
浏览文件 @
71788e59
...
...
@@ -208,7 +208,16 @@ private async Task<TriggerIdentifierKind> DetermineIfRenamableSymbolAsync(ISymbo
// Get the source symbol if possible
var
sourceSymbol
=
await
SymbolFinder
.
FindSourceDefinitionAsync
(
symbol
,
document
.
Project
.
Solution
,
_cancellationToken
).
ConfigureAwait
(
false
)
??
symbol
;
if
(
sourceSymbol
.
IsImplicitlyDeclared
||
!
sourceSymbol
.
Locations
.
All
(
loc
=>
loc
.
IsInSource
))
if
(
sourceSymbol
.
Kind
==
SymbolKind
.
Field
&&
((
IFieldSymbol
)
sourceSymbol
).
ContainingType
.
IsTupleType
&&
sourceSymbol
.
IsImplicitlyDeclared
)
{
// should not rename Item1, Item2...
// when user did not declare them in source.
return
TriggerIdentifierKind
.
NotRenamable
;
}
if
(!
sourceSymbol
.
Locations
.
All
(
loc
=>
loc
.
IsInSource
))
{
return
TriggerIdentifierKind
.
NotRenamable
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录