Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
5a099726
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,发现更多精彩内容 >>
未验证
提交
5a099726
编写于
5月 15, 2019
作者:
S
Sam Harwell
提交者:
GitHub
5月 15, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #35470 from sharwell/rs1024-ms-ca-ws
Fix violations of RS1024 in Microsoft.CodeAnalysis.Workspaces
上级
e8bfe06a
2ec832cd
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
24 addition
and
24 deletion
+24
-24
src/Workspaces/Core/Portable/FindSymbols/Declarations/DeclarationFinder.cs
...re/Portable/FindSymbols/Declarations/DeclarationFinder.cs
+1
-1
src/Workspaces/Core/Portable/FindSymbols/SymbolFinder_Hierarchy.cs
...paces/Core/Portable/FindSymbols/SymbolFinder_Hierarchy.cs
+1
-1
src/Workspaces/Core/Portable/FlowAnalysis/SymbolUsageAnalysis/SymbolUsageAnalysis.cs
...e/FlowAnalysis/SymbolUsageAnalysis/SymbolUsageAnalysis.cs
+1
-1
src/Workspaces/Core/Portable/FlowAnalysis/SymbolUsageAnalysis/SymbolUsageResult.cs
...ble/FlowAnalysis/SymbolUsageAnalysis/SymbolUsageResult.cs
+2
-2
src/Workspaces/Core/Portable/Rename/ConflictEngine/ConflictResolver.Session.cs
...ortable/Rename/ConflictEngine/ConflictResolver.Session.cs
+1
-1
src/Workspaces/Core/Portable/Rename/ConflictEngine/DeclarationConflictHelpers.cs
...table/Rename/ConflictEngine/DeclarationConflictHelpers.cs
+2
-2
src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs
...ore/Portable/Shared/Extensions/IMethodSymbolExtensions.cs
+2
-2
src/Workspaces/Core/Portable/Shared/Extensions/INamedTypeSymbolExtensions.cs
.../Portable/Shared/Extensions/INamedTypeSymbolExtensions.cs
+2
-2
src/Workspaces/Core/Portable/Shared/Extensions/INamespaceSymbolExtensions.cs
.../Portable/Shared/Extensions/INamespaceSymbolExtensions.cs
+1
-1
src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs
...aces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs
+3
-3
src/Workspaces/Core/Portable/Shared/Extensions/ITypeSymbolExtensions.SubstituteTypesVisitor.cs
...xtensions/ITypeSymbolExtensions.SubstituteTypesVisitor.cs
+4
-4
src/Workspaces/Core/Portable/Shared/Utilities/EditorBrowsableHelpers.cs
.../Core/Portable/Shared/Utilities/EditorBrowsableHelpers.cs
+2
-2
src/Workspaces/Core/Portable/Utilities/AbstractSpeculationAnalyzer.cs
...es/Core/Portable/Utilities/AbstractSpeculationAnalyzer.cs
+1
-1
src/Workspaces/Core/Portable/Workspace/Solution/SolutionState.cs
...kspaces/Core/Portable/Workspace/Solution/SolutionState.cs
+1
-1
未找到文件。
src/Workspaces/Core/Portable/FindSymbols/Declarations/DeclarationFinder.cs
浏览文件 @
5a099726
...
...
@@ -72,7 +72,7 @@ internal static partial class DeclarationFinder
var
symbolsWithName
=
symbols
.
SelectAsArray
(
s
=>
new
SymbolAndProjectId
(
s
,
project
.
Id
));
if
(
startingCompilation
!=
null
&&
startingAssembly
!=
null
&&
compilation
.
Assembly
!=
startingAssembly
)
if
(
startingCompilation
!=
null
&&
startingAssembly
!=
null
&&
!
Equals
(
compilation
.
Assembly
,
startingAssembly
)
)
{
// Return symbols from skeleton assembly in this case so that symbols have
// the same language as startingCompilation.
...
...
src/Workspaces/Core/Portable/FindSymbols/SymbolFinder_Hierarchy.cs
浏览文件 @
5a099726
...
...
@@ -571,7 +571,7 @@ public static async Task<IEnumerable<SymbolCallerInfo>> FindCallersAsync(ISymbol
// Resolve forwarded type and verify that the types from different assembly are indeed equivalent.
var
forwardedType
=
referencedAssembly
.
ResolveForwardedType
(
fullyQualifiedTypeName
);
if
(
forwardedType
==
expectedForwardedType
)
if
(
Equals
(
forwardedType
,
expectedForwardedType
)
)
{
verifiedKeys
.
Add
(
kvp
.
Key
);
verifiedCount
++;
...
...
src/Workspaces/Core/Portable/FlowAnalysis/SymbolUsageAnalysis/SymbolUsageAnalysis.cs
浏览文件 @
5a099726
...
...
@@ -40,7 +40,7 @@ public static SymbolUsageResult Run(IOperation rootOperation, ISymbol owningSymb
BasicBlockAnalysisData
AnalyzeLocalFunction
(
IMethodSymbol
localFunction
)
{
var
localFunctionOperation
=
rootOperation
.
Descendants
()
.
FirstOrDefault
(
o
=>
(
o
as
ILocalFunctionOperation
)?.
Symbol
==
localFunction
);
.
FirstOrDefault
(
o
=>
Equals
((
o
as
ILocalFunctionOperation
)?.
Symbol
,
localFunction
)
);
// Can likely be null for broken code.
if
(
localFunctionOperation
!=
null
)
...
...
src/Workspaces/Core/Portable/FlowAnalysis/SymbolUsageAnalysis/SymbolUsageResult.cs
浏览文件 @
5a099726
...
...
@@ -59,7 +59,7 @@ public bool IsInitialParameterValueUsed(IParameterSymbol parameter)
{
// 'write' operation is 'null' for the initial write of the parameter,
// which may be from the caller's argument or parameter initializer.
if
(
kvp
.
Key
.
write
==
null
&&
kvp
.
Key
.
symbol
==
parameter
)
if
(
kvp
.
Key
.
write
==
null
&&
Equals
(
kvp
.
Key
.
symbol
,
parameter
)
)
{
return
kvp
.
Value
;
}
...
...
@@ -76,7 +76,7 @@ public int GetSymbolWriteCount(ISymbol symbol)
int
count
=
0
;
foreach
(
var
kvp
in
SymbolWritesMap
)
{
if
(
kvp
.
Key
.
symbol
==
symbol
)
if
(
Equals
(
kvp
.
Key
.
symbol
,
symbol
)
)
{
count
++;
}
...
...
src/Workspaces/Core/Portable/Rename/ConflictEngine/ConflictResolver.Session.cs
浏览文件 @
5a099726
...
...
@@ -544,7 +544,7 @@ private async Task DebugVerifyNoErrorsAsync(ConflictResolution conflictResolutio
if
(
conflictAnnotation
.
RenameDeclarationLocationReferences
[
symbolIndex
].
IsOverriddenFromMetadata
)
{
var
overridingSymbol
=
await
SymbolFinder
.
FindSymbolAtPositionAsync
(
solution
.
GetDocument
(
newLocation
.
SourceTree
),
newLocation
.
SourceSpan
.
Start
,
cancellationToken
:
_cancellationToken
).
ConfigureAwait
(
false
);
if
(
overridingSymbol
!=
null
&&
renamedSymbolInNewSolution
!=
overridingSymbol
)
if
(
overridingSymbol
!=
null
&&
!
Equals
(
renamedSymbolInNewSolution
,
overridingSymbol
)
)
{
if
(!
overridingSymbol
.
IsOverride
)
{
...
...
src/Workspaces/Core/Portable/Rename/ConflictEngine/DeclarationConflictHelpers.cs
浏览文件 @
5a099726
...
...
@@ -58,8 +58,8 @@ public static ImmutableArray<Location> GetMembersWithConflictingSignatures(IProp
{
var
conflictingMethod
=
conflictingSymbol
as
IMethodSymbol
;
var
renamedMethod
=
renamedMember
as
IMethodSymbol
;
if
(!(
conflictingMethod
.
PartialDefinitionPart
!=
null
&&
conflictingMethod
.
PartialDefinitionPart
==
renamedMethod
)
&&
!(
conflictingMethod
.
PartialImplementationPart
!=
null
&&
conflictingMethod
.
PartialImplementationPart
==
renamedMethod
))
if
(!(
conflictingMethod
.
PartialDefinitionPart
!=
null
&&
Equals
(
conflictingMethod
.
PartialDefinitionPart
,
renamedMethod
)
)
&&
!(
conflictingMethod
.
PartialImplementationPart
!=
null
&&
Equals
(
conflictingMethod
.
PartialImplementationPart
,
renamedMethod
)
))
{
builder
.
AddRange
(
conflictingSymbol
.
Locations
);
}
...
...
src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs
浏览文件 @
5a099726
...
...
@@ -61,12 +61,12 @@ public static ImmutableArray<IMethodSymbol> GetAllMethodSymbolsOfPartialParts(th
{
if
(
method
.
PartialDefinitionPart
!=
null
)
{
Debug
.
Assert
(
method
.
PartialImplementationPart
==
null
&&
method
.
PartialDefinitionPart
!=
method
);
Debug
.
Assert
(
method
.
PartialImplementationPart
==
null
&&
!
Equals
(
method
.
PartialDefinitionPart
,
method
)
);
return
ImmutableArray
.
Create
(
method
,
method
.
PartialDefinitionPart
);
}
else
if
(
method
.
PartialImplementationPart
!=
null
)
{
Debug
.
Assert
(
method
.
PartialImplementationPart
!=
method
);
Debug
.
Assert
(
!
Equals
(
method
.
PartialImplementationPart
,
method
)
);
return
ImmutableArray
.
Create
(
method
.
PartialImplementationPart
,
method
);
}
else
...
...
src/Workspaces/Core/Portable/Shared/Extensions/INamedTypeSymbolExtensions.cs
浏览文件 @
5a099726
...
...
@@ -242,7 +242,7 @@ private static bool IsImplementable(ISymbol m)
(
t
,
m
)
=>
{
var
implementation
=
classOrStructType
.
FindImplementationForInterfaceMember
(
m
);
return
implementation
!=
null
&&
implementation
.
ContainingType
==
classOrStructType
;
return
implementation
!=
null
&&
Equals
(
implementation
.
ContainingType
,
classOrStructType
)
;
},
GetMembers
,
allowReimplementation
:
true
,
...
...
@@ -261,7 +261,7 @@ private static bool IsImplementable(ISymbol m)
(
t
,
m
)
=>
{
var
implementation
=
classOrStructType
.
FindImplementationForInterfaceMember
(
m
);
return
implementation
!=
null
&&
implementation
.
ContainingType
==
classOrStructType
;
return
implementation
!=
null
&&
Equals
(
implementation
.
ContainingType
,
classOrStructType
)
;
},
interfaceMemberGetter
,
allowReimplementation
:
true
,
...
...
src/Workspaces/Core/Portable/Shared/Extensions/INamespaceSymbolExtensions.cs
浏览文件 @
5a099726
...
...
@@ -177,7 +177,7 @@ public static int CompareTo(this INamespaceSymbol n1, INamespaceSymbol n2)
{
// Assume that any namespace in our own assembly is accessible to us. This saves a
// lot of cpu time checking namespaces.
if
(
constituent
.
ContainingAssembly
==
assembly
)
if
(
Equals
(
constituent
.
ContainingAssembly
,
assembly
)
)
{
return
true
;
}
...
...
src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs
浏览文件 @
5a099726
...
...
@@ -714,7 +714,7 @@ public static bool IsInaccessibleLocal(this ISymbol symbol, int position)
hideModuleNameAttribute
=
hideModuleNameAttribute
??
compilation
.
HideModuleNameAttribute
();
foreach
(
var
attribute
in
attributes
)
{
if
(
attribute
.
AttributeClass
==
hideModuleNameAttribute
)
if
(
Equals
(
attribute
.
AttributeClass
,
hideModuleNameAttribute
)
)
{
return
true
;
}
...
...
@@ -734,7 +734,7 @@ public static bool IsInaccessibleLocal(this ISymbol symbol, int position)
foreach
(
var
attribute
in
attributes
)
{
if
(
attribute
.
AttributeConstructor
==
constructor
&&
if
(
Equals
(
attribute
.
AttributeConstructor
,
constructor
)
&&
attribute
.
ConstructorArguments
.
Length
==
1
&&
attribute
.
ConstructorArguments
.
First
().
Value
is
int
)
{
...
...
@@ -794,7 +794,7 @@ public static bool IsInaccessibleLocal(this ISymbol symbol, int position)
{
foreach
(
var
constructor
in
attributeConstructors
)
{
if
(
attribute
.
AttributeConstructor
==
constructor
)
if
(
Equals
(
attribute
.
AttributeConstructor
,
constructor
)
)
{
var
actualFlags
=
0
;
...
...
src/Workspaces/Core/Portable/Shared/Extensions/ITypeSymbolExtensions.SubstituteTypesVisitor.cs
浏览文件 @
5a099726
...
...
@@ -52,7 +52,7 @@ public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
public
override
ITypeSymbol
VisitNamedType
(
INamedTypeSymbol
symbol
)
{
var
mapped
=
VisitType
(
symbol
);
if
(
mapped
!=
symbol
)
if
(
!
Equals
(
mapped
,
symbol
)
)
{
return
mapped
;
}
...
...
@@ -75,7 +75,7 @@ public override ITypeSymbol VisitNamedType(INamedTypeSymbol symbol)
:
symbol
.
ContainingType
.
Accept
(
this
);
// If our containing type changed, then find us again in the new containing type.
if
(
updatedContainingType
!=
symbol
.
ContainingType
)
if
(
!
Equals
(
updatedContainingType
,
symbol
.
ContainingType
)
)
{
symbol
=
updatedContainingType
.
GetTypeMembers
(
symbol
.
Name
,
symbol
.
Arity
).
First
(
m
=>
m
.
TypeKind
==
symbol
.
TypeKind
);
}
...
...
@@ -92,7 +92,7 @@ public override ITypeSymbol VisitNamedType(INamedTypeSymbol symbol)
public
override
ITypeSymbol
VisitArrayType
(
IArrayTypeSymbol
symbol
)
{
var
mapped
=
VisitType
(
symbol
);
if
(
mapped
!=
symbol
)
if
(
!
Equals
(
mapped
,
symbol
)
)
{
return
mapped
;
}
...
...
@@ -109,7 +109,7 @@ public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol)
public
override
ITypeSymbol
VisitPointerType
(
IPointerTypeSymbol
symbol
)
{
var
mapped
=
VisitType
(
symbol
);
if
(
mapped
!=
symbol
)
if
(
!
Equals
(
mapped
,
symbol
)
)
{
return
mapped
;
}
...
...
src/Workspaces/Core/Portable/Shared/Utilities/EditorBrowsableHelpers.cs
浏览文件 @
5a099726
...
...
@@ -27,7 +27,7 @@ public static IMethodSymbol GetSpecialEditorBrowsableAttributeConstructor(Compil
}
var
candidateConstructors
=
editorBrowsableAttributeType
.
Constructors
.
Where
(
c
=>
c
.
Parameters
.
Length
==
1
&&
c
.
Parameters
[
0
].
Type
==
editorBrowsableStateType
);
.
Where
(
c
=>
c
.
Parameters
.
Length
==
1
&&
Equals
(
c
.
Parameters
[
0
].
Type
,
editorBrowsableStateType
)
);
// Ensure the constructor adheres to the expected EditorBrowsable pattern
candidateConstructors
=
candidateConstructors
.
Where
(
c
=>
(!
c
.
IsVararg
&&
...
...
@@ -93,7 +93,7 @@ public static List<IMethodSymbol> GetSpecialTypeLibVarAttributeConstructors(Comp
var
candidateConstructors
=
typeLibAttributeType
.
Constructors
.
Where
(
c
=>
c
.
Parameters
.
Length
==
1
&&
(
c
.
Parameters
[
0
].
Type
==
typeLibFlagsType
||
c
.
Parameters
[
0
].
Type
==
shortType
));
(
Equals
(
c
.
Parameters
[
0
].
Type
,
typeLibFlagsType
)
||
Equals
(
c
.
Parameters
[
0
].
Type
,
shortType
)
));
candidateConstructors
=
candidateConstructors
.
Where
(
c
=>
(!
c
.
IsVararg
&&
!
c
.
Parameters
[
0
].
IsRefOrOut
()
&&
...
...
src/Workspaces/Core/Portable/Utilities/AbstractSpeculationAnalyzer.cs
浏览文件 @
5a099726
...
...
@@ -894,7 +894,7 @@ private static bool IsEffectivelySealedClass(ITypeSymbol type)
// A private class with no nested or sibling classes is effectively sealed.
if
(
namedType
.
DeclaredAccessibility
==
Accessibility
.
Private
&&
namedType
.
ContainingType
!=
null
&&
!
namedType
.
ContainingType
.
GetTypeMembers
().
Any
(
nestedType
=>
nestedType
.
TypeKind
==
TypeKind
.
Class
&&
namedType
!=
nestedType
))
!
namedType
.
ContainingType
.
GetTypeMembers
().
Any
(
nestedType
=>
nestedType
.
TypeKind
==
TypeKind
.
Class
&&
!
Equals
(
namedType
,
nestedType
)
))
{
return
true
;
}
...
...
src/Workspaces/Core/Portable/Workspace/Solution/SolutionState.cs
浏览文件 @
5a099726
...
...
@@ -400,7 +400,7 @@ public ProjectState GetProjectState(IAssemblySymbol assemblySymbol, Cancellation
if
(
this
.
TryGetCompilation
(
state
.
Id
,
out
var
compilation
))
{
// if the symbol is the compilation's assembly symbol, we are done
if
(
compilation
.
Assembly
==
assemblySymbol
)
if
(
Equals
(
compilation
.
Assembly
,
assemblySymbol
)
)
{
return
state
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录