Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
6db545eb
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,发现更多精彩内容 >>
提交
6db545eb
编写于
7月 13, 2019
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use pattern matching in a few more places.
上级
9da4a909
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
14 addition
and
15 deletion
+14
-15
src/Compilers/CSharp/Portable/Compilation/SyntaxTreeSemanticModel.cs
...rs/CSharp/Portable/Compilation/SyntaxTreeSemanticModel.cs
+1
-1
src/Compilers/CSharp/Test/Symbol/Symbols/MockSymbolTests.cs
src/Compilers/CSharp/Test/Symbol/Symbols/MockSymbolTests.cs
+2
-2
src/ExpressionEvaluator/Core/Source/ExpressionCompiler/PDB/PdbHelpers.cs
...valuator/Core/Source/ExpressionCompiler/PDB/PdbHelpers.cs
+6
-7
src/Features/CSharp/Portable/Completion/CompletionProviders/ObjectInitializerCompletionProvider.cs
...ompletionProviders/ObjectInitializerCompletionProvider.cs
+1
-1
src/VisualStudio/CSharp/Impl/LanguageService/CSharpHelpContextService.cs
...o/CSharp/Impl/LanguageService/CSharpHelpContextService.cs
+1
-1
src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractReferenceFinder.cs
...Symbols/FindReferences/Finders/AbstractReferenceFinder.cs
+2
-2
src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/ParameterSymbolReferenceFinder.cs
.../FindReferences/Finders/ParameterSymbolReferenceFinder.cs
+1
-1
未找到文件。
src/Compilers/CSharp/Portable/Compilation/SyntaxTreeSemanticModel.cs
浏览文件 @
6db545eb
...
...
@@ -507,7 +507,7 @@ private ConsList<TypeSymbol> GetBasesBeingResolved(TypeSyntax expression)
for
(;
expression
!=
null
&&
expression
.
Parent
!=
null
;
expression
=
expression
.
Parent
as
TypeSyntax
)
{
var
parent
=
expression
.
Parent
;
if
(
parent
is
BaseTypeSyntax
&&
parent
.
Parent
!=
null
&&
parent
.
Parent
.
Kind
()
==
SyntaxKind
.
BaseList
&&
((
BaseTypeSyntax
)
parent
)
.
Type
==
expression
)
if
(
parent
is
BaseTypeSyntax
baseType
&&
parent
.
Parent
!=
null
&&
parent
.
Parent
.
Kind
()
==
SyntaxKind
.
BaseList
&&
baseType
.
Type
==
expression
)
{
// we have a winner
var
decl
=
(
BaseTypeDeclarationSyntax
)
parent
.
Parent
.
Parent
;
...
...
src/Compilers/CSharp/Test/Symbol/Symbols/MockSymbolTests.cs
浏览文件 @
6db545eb
...
...
@@ -140,10 +140,10 @@ private void DumpSymbol(Symbol sym, StringBuilder builder, int level)
throw
new
InvalidOperationException
(
"Unexpected symbol kind"
);
}
if
(
sym
is
NamespaceOrTypeSymbol
&&
((
NamespaceOrTypeSymbol
)
sym
)
.
GetMembers
().
Any
())
if
(
sym
is
NamespaceOrTypeSymbol
namespaceOrType
&&
namespaceOrType
.
GetMembers
().
Any
())
{
builder
.
AppendLine
(
" { "
);
var
q
=
from
c
in
((
NamespaceOrTypeSymbol
)
sym
)
.
GetMembers
()
var
q
=
from
c
in
namespaceOrType
.
GetMembers
()
orderby
c
.
Name
select
c
;
...
...
src/ExpressionEvaluator/Core/Source/ExpressionCompiler/PDB/PdbHelpers.cs
浏览文件 @
6db545eb
...
...
@@ -194,7 +194,7 @@ public static ConstantValue GetSymConstantValue(ITypeSymbol type, object symValu
return
ConstantValue
.
Create
((
double
)
symValue
);
case
SpecialType
.
System_String
:
if
(
symValue
is
int
&&
(
int
)
symValue
==
0
)
if
(
symValue
is
int
intVal1
&&
intVal1
==
0
)
{
return
ConstantValue
.
Null
;
}
...
...
@@ -204,8 +204,7 @@ public static ConstantValue GetSymConstantValue(ITypeSymbol type, object symValu
return
ConstantValue
.
Create
(
string
.
Empty
);
}
var
str
=
symValue
as
string
;
if
(
str
==
null
)
if
(!(
symValue
is
string
str
))
{
return
ConstantValue
.
Bad
;
}
...
...
@@ -213,7 +212,7 @@ public static ConstantValue GetSymConstantValue(ITypeSymbol type, object symValu
return
ConstantValue
.
Create
(
str
);
case
SpecialType
.
System_Object
:
if
(
symValue
is
int
&&
(
int
)
symValue
==
0
)
if
(
symValue
is
int
intVal2
&&
intVal2
==
0
)
{
return
ConstantValue
.
Null
;
}
...
...
@@ -221,12 +220,12 @@ public static ConstantValue GetSymConstantValue(ITypeSymbol type, object symValu
return
ConstantValue
.
Bad
;
case
SpecialType
.
System_Decimal
:
if
(!(
symValue
is
decimal
))
if
(!(
symValue
is
decimal
decimalValue
))
{
return
ConstantValue
.
Bad
;
}
return
ConstantValue
.
Create
(
(
decimal
)
sym
Value
);
return
ConstantValue
.
Create
(
decimal
Value
);
case
SpecialType
.
System_DateTime
:
if
(!(
symValue
is
double
))
...
...
@@ -239,7 +238,7 @@ public static ConstantValue GetSymConstantValue(ITypeSymbol type, object symValu
case
SpecialType
.
None
:
if
(
type
.
IsReferenceType
)
{
if
(
symValue
is
int
&&
(
int
)
symValue
==
0
)
if
(
symValue
is
int
intValue3
&&
intValue3
==
0
)
{
return
ConstantValue
.
Null
;
}
...
...
src/Features/CSharp/Portable/Completion/CompletionProviders/ObjectInitializerCompletionProvider.cs
浏览文件 @
6db545eb
...
...
@@ -174,7 +174,7 @@ protected override HashSet<string> GetInitializedMembers(SyntaxTree tree, int po
protected
override
bool
IsInitializable
(
ISymbol
member
,
INamedTypeSymbol
containingType
)
{
if
(
member
is
IPropertySymbol
&&
((
IPropertySymbol
)
member
)
.
Parameters
.
Any
(
p
=>
!
p
.
IsOptional
))
if
(
member
is
IPropertySymbol
property
&&
property
.
Parameters
.
Any
(
p
=>
!
p
.
IsOptional
))
{
return
false
;
}
...
...
src/VisualStudio/CSharp/Impl/LanguageService/CSharpHelpContextService.cs
浏览文件 @
6db545eb
...
...
@@ -163,7 +163,7 @@ private bool TryGetTextForSymbol(SyntaxToken token, SemanticModel semanticModel,
}
// Just use syntaxfacts for operators
if
(
symbol
is
IMethodSymbol
&&
((
IMethodSymbol
)
symbol
)
.
MethodKind
==
MethodKind
.
BuiltinOperator
)
if
(
symbol
is
IMethodSymbol
method
&&
method
.
MethodKind
==
MethodKind
.
BuiltinOperator
)
{
text
=
null
;
return
false
;
...
...
src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractReferenceFinder.cs
浏览文件 @
6db545eb
...
...
@@ -744,10 +744,10 @@ public override Task<ImmutableArray<Project>> DetermineProjectsToSearchAsync(ISy
FindReferencesSearchOptions
options
,
CancellationToken
cancellationToken
)
{
var
symbol
=
symbolAndProjectId
.
Symbol
;
if
(
symbol
is
TSymbol
&&
CanFind
((
TSymbol
)
s
ymbol
))
if
(
symbol
is
TSymbol
typedSymbol
&&
CanFind
(
typedS
ymbol
))
{
return
DetermineCascadedSymbolsAsync
(
symbolAndProjectId
.
WithSymbol
(
(
TSymbol
)
s
ymbol
),
symbolAndProjectId
.
WithSymbol
(
typedS
ymbol
),
solution
,
projects
,
options
,
cancellationToken
);
}
...
...
src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/ParameterSymbolReferenceFinder.cs
浏览文件 @
6db545eb
...
...
@@ -211,7 +211,7 @@ private SyntaxNode GetContainer(SemanticModel semanticModel, SyntaxNode paramete
{
var
declaredSymbol
=
semanticModel
.
GetDeclaredSymbol
(
current
);
if
(
declaredSymbol
is
IMethodSymbol
&&
((
IMethodSymbol
)
declaredSymbol
)
.
MethodKind
!=
MethodKind
.
AnonymousFunction
)
if
(
declaredSymbol
is
IMethodSymbol
method
&&
method
.
MethodKind
!=
MethodKind
.
AnonymousFunction
)
{
return
current
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录