Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
2d07f569
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,发现更多精彩内容 >>
提交
2d07f569
编写于
4月 16, 2018
作者:
Š
Šimon Koníček
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Undoing rename
上级
4bb5b9bb
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
176 addition
and
176 deletion
+176
-176
src/EditorFeatures/CSharpTest/Completion/CompletionProviders/DeclarationNameCompletionProviderTests_NameDeclarationInfoTests.cs
...onNameCompletionProviderTests_NameDeclarationInfoTests.cs
+53
-53
src/EditorFeatures/CSharpTest/ConvertAutoPropertyToFullProperty/ConvertAutoPropertyToFullPropertyTests_OptionSets.cs
...erty/ConvertAutoPropertyToFullPropertyTests_OptionSets.cs
+2
-2
src/EditorFeatures/CSharpTest/Diagnostics/NamingStyles/EditorConfigNamingStyleParserTests.cs
...ostics/NamingStyles/EditorConfigNamingStyleParserTests.cs
+17
-17
src/EditorFeatures/TestUtilities/Diagnostics/NamingStyles/NamingStylesTestOptionSets.cs
...es/Diagnostics/NamingStyles/NamingStylesTestOptionSets.cs
+13
-13
src/Features/CSharp/Portable/Completion/CompletionProviders/DeclarationNameCompletionProvider.DeclarationInfo.cs
...ders/DeclarationNameCompletionProvider.DeclarationInfo.cs
+23
-23
src/Features/CSharp/Portable/Completion/CompletionProviders/DeclarationNameCompletionProvider_BuiltInStyles.cs
...viders/DeclarationNameCompletionProvider_BuiltInStyles.cs
+4
-4
src/Features/CSharp/Portable/ConvertAutoPropertyToFullProperty/CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs
...nvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs
+2
-2
src/Features/Core/Portable/InitializeParameter/AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs
...mberFromParameterCodeRefactoringProviderMemberCreation.cs
+3
-3
src/VisualStudio/Core/Impl/Options/Style/NamingPreferences/SymbolSpecification/SymbolSpecificationViewModel.cs
...ences/SymbolSpecification/SymbolSpecificationViewModel.cs
+4
-4
src/Workspaces/Core/Portable/NamingStyles/EditorConfig/EditorConfigNamingStyleParser_SymbolSpec.cs
.../EditorConfig/EditorConfigNamingStyleParser_SymbolSpec.cs
+18
-18
src/Workspaces/Core/Portable/NamingStyles/Serialization/SymbolSpecification.cs
...ortable/NamingStyles/Serialization/SymbolSpecification.cs
+37
-37
未找到文件。
src/EditorFeatures/CSharpTest/Completion/CompletionProviders/DeclarationNameCompletionProviderTests_NameDeclarationInfoTests.cs
浏览文件 @
2d07f569
...
...
@@ -26,9 +26,9 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
await
VerifyNoModifiers
(
markup
);
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -44,9 +44,9 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
await
VerifyNoModifiers
(
markup
);
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
Public
);
...
...
@@ -62,8 +62,8 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
(
isVirtual
:
true
));
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
Public
);
...
...
@@ -79,9 +79,9 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
(
isStatic
:
true
));
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
Private
);
...
...
@@ -97,7 +97,7 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
(
isConst
:
true
));
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
Private
);
...
...
@@ -116,8 +116,8 @@ void goo()
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
());
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -136,7 +136,7 @@ void goo()
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
());
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -155,8 +155,8 @@ void goo()
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
(
isReadOnly
:
true
));
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -175,7 +175,7 @@ void goo()
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
(
isReadOnly
:
true
));
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -194,7 +194,7 @@ void M()
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
());
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -213,7 +213,7 @@ void M()
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
());
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -232,7 +232,7 @@ void M()
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
());
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -251,7 +251,7 @@ void M()
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
());
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -270,7 +270,7 @@ void M()
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
());
await
VerifyTypeName
(
markup
,
"int"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -287,7 +287,7 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Parameter
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Parameter
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
());
await
VerifyTypeName
(
markup
,
"global::C"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -304,7 +304,7 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Parameter
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Parameter
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
());
await
VerifyTypeName
(
markup
,
"global::C"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -321,7 +321,7 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Parameter
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Parameter
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
());
await
VerifyTypeName
(
markup
,
"string"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -338,7 +338,7 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Parameter
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Parameter
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
());
await
VerifyTypeName
(
markup
,
"string"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -356,7 +356,7 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Parameter
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Parameter
));
await
VerifyModifiers
(
markup
,
new
DeclarationModifiers
());
await
VerifyTypeName
(
markup
,
"global::System.Collections.Generic.List<string>"
);
await
VerifyAccessibility
(
markup
,
Accessibility
.
NotApplicable
);
...
...
@@ -371,7 +371,7 @@ class C<$$
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
TypeParameter
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
TypeParameter
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -383,7 +383,7 @@ class C<T1, $$
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
TypeParameter
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
TypeParameter
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -396,7 +396,7 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -409,7 +409,7 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -422,8 +422,8 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -436,8 +436,8 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -450,8 +450,8 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -464,8 +464,8 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -478,7 +478,7 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -492,9 +492,9 @@ class C
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -513,8 +513,8 @@ static void Main(string[] args)
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -533,8 +533,8 @@ static void Main(string[] args)
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -553,8 +553,8 @@ static void Main(string[] args)
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)]
...
...
@@ -572,8 +572,8 @@ static void Main(string[] args)
}
"
;
await
VerifySymbolKinds
(
markup
,
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
));
}
private
async
Task
VerifyNoType
(
string
markup
)
...
...
@@ -594,7 +594,7 @@ private async Task VerifyNoModifiers(string markup)
Assert
.
Equal
(
default
(
DeclarationModifiers
),
result
.
Modifiers
);
}
private
async
Task
VerifySymbolKinds
(
string
markup
,
params
Symbol
OrTypeOrMethod
Kind
[]
expectedSymbolKinds
)
private
async
Task
VerifySymbolKinds
(
string
markup
,
params
Symbol
KindOrType
Kind
[]
expectedSymbolKinds
)
{
var
result
=
await
GetResultsAsync
(
markup
);
Assert
.
True
(
expectedSymbolKinds
.
SequenceEqual
(
result
.
PossibleSymbolKinds
));
...
...
src/EditorFeatures/CSharpTest/ConvertAutoPropertyToFullProperty/ConvertAutoPropertyToFullPropertyTests_OptionSets.cs
浏览文件 @
2d07f569
...
...
@@ -56,7 +56,7 @@ private NamingStylePreferences CreateCustomFieldNamingStylePreference()
var
symbolSpecification
=
new
SymbolSpecification
(
null
,
"Name"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
)),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
<
SymbolSpecification
.
ModifierKind
>.
Empty
);
...
...
@@ -88,7 +88,7 @@ private NamingStylePreferences CreateCustomStaticFieldNamingStylePreference()
var
symbolSpecification
=
new
SymbolSpecification
(
null
,
"Name"
,
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
)),
ImmutableArray
.
Create
(
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
.
Create
(
new
ModifierKind
(
DeclarationModifiers
.
Static
)));
...
...
src/EditorFeatures/CSharpTest/Diagnostics/NamingStyles/EditorConfigNamingStyleParserTests.cs
浏览文件 @
2d07f569
...
...
@@ -37,8 +37,8 @@ public static void TestPascalCaseRule()
Assert
.
Equal
(
"method_and_property_symbols"
,
symbolSpec
.
Name
);
var
expectedApplicableSymbolKindList
=
new
[]
{
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
)
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
)
};
AssertEx
.
SetEqual
(
expectedApplicableSymbolKindList
,
symbolSpec
.
ApplicableSymbolKindList
);
Assert
.
Empty
(
symbolSpec
.
RequiredModifierList
);
...
...
@@ -84,8 +84,8 @@ public static void TestAsyncMethodsAndLocalFunctionsRule()
Assert
.
Equal
(
"method_symbols"
,
symbolSpec
.
Name
);
var
expectedApplicableSymbolKindList
=
new
[]
{
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
)
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
)
};
AssertEx
.
SetEqual
(
expectedApplicableSymbolKindList
,
symbolSpec
.
ApplicableSymbolKindList
);
Assert
.
Single
(
symbolSpec
.
RequiredModifierList
);
...
...
@@ -140,11 +140,11 @@ public static void TestPublicMembersCapitalizedRule()
Assert
.
Equal
(
"public_symbols"
,
symbolSpec
.
Name
);
var
expectedApplicableSymbolKindList
=
new
[]
{
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Event
),
new
Symbol
OrTypeOrMethod
Kind
(
TypeKind
.
Delegate
)
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Event
),
new
Symbol
KindOrType
Kind
(
TypeKind
.
Delegate
)
};
AssertEx
.
SetEqual
(
expectedApplicableSymbolKindList
,
symbolSpec
.
ApplicableSymbolKindList
);
var
expectedApplicableAccessibilityList
=
new
[]
...
...
@@ -188,11 +188,11 @@ public static void TestNonPublicMembersLowerCaseRule()
Assert
.
Equal
(
"non_public_symbols"
,
symbolSpec
.
Name
);
var
expectedApplicableSymbolKindList
=
new
[]
{
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Event
),
new
Symbol
OrTypeOrMethod
Kind
(
TypeKind
.
Delegate
)
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Event
),
new
Symbol
KindOrType
Kind
(
TypeKind
.
Delegate
)
};
AssertEx
.
SetEqual
(
expectedApplicableSymbolKindList
,
symbolSpec
.
ApplicableSymbolKindList
);
Assert
.
Single
(
symbolSpec
.
ApplicableAccessibilityList
);
...
...
@@ -232,8 +232,8 @@ public static void TestParametersAndLocalsAreCamelCaseRule()
Assert
.
Equal
(
"parameters_and_locals"
,
symbolSpec
.
Name
);
var
expectedApplicableSymbolKindList
=
new
[]
{
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Parameter
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Parameter
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
),
};
AssertEx
.
SetEqual
(
expectedApplicableSymbolKindList
,
symbolSpec
.
ApplicableSymbolKindList
);
Assert
.
Empty
(
symbolSpec
.
ApplicableAccessibilityList
);
...
...
@@ -271,7 +271,7 @@ public static void TestLocalFunctionsAreCamelCaseRule()
Assert
.
Equal
(
DiagnosticSeverity
.
Info
,
namingRule
.
EnforcementLevel
);
Assert
.
Equal
(
"local_functions"
,
symbolSpec
.
Name
);
var
expectedApplicableSymbolKindList
=
new
[]
{
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
)
};
var
expectedApplicableSymbolKindList
=
new
[]
{
new
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
)
};
AssertEx
.
SetEqual
(
expectedApplicableSymbolKindList
,
symbolSpec
.
ApplicableSymbolKindList
);
Assert
.
Empty
(
symbolSpec
.
ApplicableAccessibilityList
);
Assert
.
Empty
(
symbolSpec
.
RequiredModifierList
);
...
...
src/EditorFeatures/TestUtilities/Diagnostics/NamingStyles/NamingStylesTestOptionSets.cs
浏览文件 @
2d07f569
...
...
@@ -62,7 +62,7 @@ private static NamingStylePreferences ClassNamesArePascalCaseOption()
var
symbolSpecification
=
new
SymbolSpecification
(
null
,
"Name"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
TypeKind
.
Class
)),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
TypeKind
.
Class
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
<
SymbolSpecification
.
ModifierKind
>.
Empty
);
...
...
@@ -92,7 +92,7 @@ private static NamingStylePreferences MethodNamesArePascalCaseOption()
var
symbolSpecification
=
new
SymbolSpecification
(
null
,
"Name"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
)),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
<
SymbolSpecification
.
ModifierKind
>.
Empty
);
...
...
@@ -123,7 +123,7 @@ private static NamingStylePreferences ParameterNamesAreCamelCaseOption()
var
symbolSpecification
=
new
SymbolSpecification
(
null
,
"Name"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Parameter
)),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
SymbolKind
.
Parameter
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
<
SymbolSpecification
.
ModifierKind
>.
Empty
);
...
...
@@ -155,7 +155,7 @@ private static NamingStylePreferences LocalNamesAreCamelCaseOption()
var
symbolSpecification
=
new
SymbolSpecification
(
null
,
"Name"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
)),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
<
SymbolSpecification
.
ModifierKind
>.
Empty
);
...
...
@@ -187,7 +187,7 @@ private static NamingStylePreferences LocalFunctionNamesAreCamelCaseOption()
var
symbolSpecification
=
new
SymbolSpecification
(
null
,
"Name"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
)),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
<
SymbolSpecification
.
ModifierKind
>.
Empty
);
...
...
@@ -219,7 +219,7 @@ private static NamingStylePreferences PropertyNamesArePascalCaseOption()
var
symbolSpecification
=
new
SymbolSpecification
(
null
,
"Name"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
)),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
<
SymbolSpecification
.
ModifierKind
>.
Empty
);
...
...
@@ -251,7 +251,7 @@ private static NamingStylePreferences InterfacesNamesStartWithIOption()
var
symbolSpecification
=
new
SymbolSpecification
(
null
,
"Name"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
TypeKind
.
Interface
)),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
TypeKind
.
Interface
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
<
SymbolSpecification
.
ModifierKind
>.
Empty
);
...
...
@@ -284,8 +284,8 @@ private static NamingStylePreferences ConstantsAreUpperCaseOption()
null
,
"Name"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
),
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
)),
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
),
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
ModifierKind
(
SymbolSpecification
.
ModifierKindEnum
.
IsConst
)));
...
...
@@ -317,14 +317,14 @@ private static NamingStylePreferences LocalsAreCamelCaseConstantsAreUpperCaseOpt
var
localsSymbolSpecification
=
new
SymbolSpecification
(
null
,
"Locals"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
)),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
<
SymbolSpecification
.
ModifierKind
>.
Empty
);
var
constLocalsSymbolSpecification
=
new
SymbolSpecification
(
null
,
"Const Locals"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
)),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
ModifierKind
(
SymbolSpecification
.
ModifierKindEnum
.
IsConst
)));
...
...
@@ -372,8 +372,8 @@ private static NamingStylePreferences AsyncFunctionNamesEndWithAsyncOption()
null
,
"Name"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
),
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
)),
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
),
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
)),
ImmutableArray
<
Accessibility
>.
Empty
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
ModifierKind
(
SymbolSpecification
.
ModifierKindEnum
.
IsAsync
)));
...
...
src/Features/CSharp/Portable/Completion/CompletionProviders/DeclarationNameCompletionProvider.DeclarationInfo.cs
浏览文件 @
2d07f569
...
...
@@ -17,11 +17,11 @@ internal partial class DeclarationNameCompletionProvider
{
internal
struct
NameDeclarationInfo
{
private
static
readonly
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>
s_parameterSyntaxKind
=
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Parameter
));
private
static
readonly
ImmutableArray
<
Symbol
KindOrType
Kind
>
s_parameterSyntaxKind
=
ImmutableArray
.
Create
(
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Parameter
));
public
NameDeclarationInfo
(
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>
possibleSymbolKinds
,
ImmutableArray
<
Symbol
KindOrType
Kind
>
possibleSymbolKinds
,
Accessibility
accessibility
,
DeclarationModifiers
declarationModifiers
,
ITypeSymbol
type
,
...
...
@@ -34,7 +34,7 @@ internal struct NameDeclarationInfo
Alias
=
alias
;
}
public
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>
PossibleSymbolKinds
{
get
;
}
public
ImmutableArray
<
Symbol
KindOrType
Kind
>
PossibleSymbolKinds
{
get
;
}
public
DeclarationModifiers
Modifiers
{
get
;
}
public
ITypeSymbol
Type
{
get
;
}
public
IAliasSymbol
Alias
{
get
;
}
...
...
@@ -88,7 +88,7 @@ internal static async Task<NameDeclarationInfo> GetDeclarationInfo(Document docu
if
(
type
!=
null
)
{
result
=
new
NameDeclarationInfo
(
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
)),
ImmutableArray
.
Create
(
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
)),
Accessibility
.
NotApplicable
,
new
DeclarationModifiers
(),
type
,
...
...
@@ -109,8 +109,8 @@ internal static async Task<NameDeclarationInfo> GetDeclarationInfo(Document docu
e
=>
e
.
Expression
,
_
=>
default
,
_
=>
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
)),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
)),
cancellationToken
);
return
result
.
Type
!=
null
;
}
...
...
@@ -147,7 +147,7 @@ internal static async Task<NameDeclarationInfo> GetDeclarationInfo(Document docu
SemanticModel
semanticModel
,
Func
<
TSyntaxNode
,
SyntaxNode
>
typeSyntaxGetter
,
Func
<
TSyntaxNode
,
SyntaxTokenList
?>
modifierGetter
,
Func
<
DeclarationModifiers
,
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>>
possibleDeclarationComputer
,
Func
<
DeclarationModifiers
,
ImmutableArray
<
Symbol
KindOrType
Kind
>>
possibleDeclarationComputer
,
CancellationToken
cancellationToken
)
where
TSyntaxNode
:
SyntaxNode
{
if
(!
IsPossibleTypeToken
(
token
)
&&
!
token
.
IsKind
(
SyntaxKind
.
CommaToken
))
...
...
@@ -200,7 +200,7 @@ internal static async Task<NameDeclarationInfo> GetDeclarationInfo(Document docu
SemanticModel
semanticModel
,
Func
<
TSyntaxNode
,
SyntaxNode
>
typeSyntaxGetter
,
Func
<
TSyntaxNode
,
SyntaxTokenList
>
modifierGetter
,
Func
<
DeclarationModifiers
,
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>>
possibleDeclarationComputer
,
Func
<
DeclarationModifiers
,
ImmutableArray
<
Symbol
KindOrType
Kind
>>
possibleDeclarationComputer
,
CancellationToken
cancellationToken
)
where
TSyntaxNode
:
SyntaxNode
{
if
(!
IsPossibleTypeToken
(
token
))
...
...
@@ -266,15 +266,15 @@ internal static async Task<NameDeclarationInfo> GetDeclarationInfo(Document docu
cancellationToken
);
return
result
.
Type
!=
null
;
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>
GetPossibleKinds
()
ImmutableArray
<
Symbol
KindOrType
Kind
>
GetPossibleKinds
()
{
// If we only have a type, this can still end up being a local function.
return
token
.
IsKind
(
SyntaxKind
.
CommaToken
)
?
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
))
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
))
:
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
));
}
}
...
...
@@ -289,7 +289,7 @@ ImmutableArray<SymbolOrTypeOrMethodKind> GetPossibleKinds()
f
is
ForEachVariableStatementSyntax
forEachVariableStatement
?
forEachVariableStatement
.
Variable
:
null
,
// Return null to bail out.
modifierGetter
:
f
=>
default
,
possibleDeclarationComputer
:
d
=>
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
)),
possibleDeclarationComputer
:
d
=>
ImmutableArray
.
Create
(
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
)),
cancellationToken
);
return
result
.
Type
!=
null
;
}
...
...
@@ -301,7 +301,7 @@ ImmutableArray<SymbolOrTypeOrMethodKind> GetPossibleKinds()
token
.
Parent
.
IsKind
(
SyntaxKind
.
TypeParameterList
))
{
result
=
new
NameDeclarationInfo
(
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
TypeParameter
)),
ImmutableArray
.
Create
(
new
Symbol
KindOrType
Kind
(
SymbolKind
.
TypeParameter
)),
Accessibility
.
NotApplicable
,
new
DeclarationModifiers
(),
type
:
null
,
...
...
@@ -368,28 +368,28 @@ ImmutableArray<SymbolOrTypeOrMethodKind> GetPossibleKinds()
SyntaxKind
.
CloseBracketToken
)
||
token
.
Parent
.
IsKind
(
SyntaxKind
.
PredefinedType
);
private
static
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>
GetPossibleMemberDeclarations
(
DeclarationModifiers
modifiers
)
private
static
ImmutableArray
<
Symbol
KindOrType
Kind
>
GetPossibleMemberDeclarations
(
DeclarationModifiers
modifiers
)
{
if
(
modifiers
.
IsConst
||
modifiers
.
IsReadOnly
)
{
return
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
));
return
ImmutableArray
.
Create
(
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
));
}
var
possibleTypes
=
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
if
(
modifiers
.
IsAbstract
||
modifiers
.
IsVirtual
||
modifiers
.
IsSealed
||
modifiers
.
IsOverride
)
{
possibleTypes
=
possibleTypes
.
Remove
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
));
possibleTypes
=
possibleTypes
.
Remove
(
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
));
}
if
(
modifiers
.
IsAsync
||
modifiers
.
IsPartial
)
{
// Fields and properties cannot be async or partial.
possibleTypes
=
possibleTypes
.
Remove
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
));
possibleTypes
=
possibleTypes
.
Remove
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
));
possibleTypes
=
possibleTypes
.
Remove
(
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
));
possibleTypes
=
possibleTypes
.
Remove
(
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
));
}
return
possibleTypes
;
...
...
src/Features/CSharp/Portable/Completion/CompletionProviders/DeclarationNameCompletionProvider_BuiltInStyles.cs
浏览文件 @
2d07f569
...
...
@@ -23,7 +23,7 @@ static DeclarationNameCompletionProvider()
private
static
NamingRule
CreateGetAsyncRule
()
{
var
kinds
=
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
var
kinds
=
ImmutableArray
.
Create
(
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
var
modifiers
=
ImmutableArray
.
Create
(
new
ModifierKind
(
ModifierKindEnum
.
IsAsync
));
return
new
NamingRule
(
new
SymbolSpecification
(
Guid
.
NewGuid
(),
"endswithasync"
,
kinds
,
ImmutableArray
.
Create
<
Accessibility
>(),
modifiers
),
...
...
@@ -33,7 +33,7 @@ private static NamingRule CreateGetAsyncRule()
private
static
NamingRule
CreateCamelCaseFieldsAndParametersRule
()
{
var
kinds
=
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethodKind
(
SymbolKind
.
Field
),
new
SymbolOrTypeOrMethodKind
(
SymbolKind
.
Parameter
),
new
SymbolOrTypeOrMethod
Kind
(
SymbolKind
.
Local
));
var
kinds
=
ImmutableArray
.
Create
(
new
Symbol
KindOrTypeKind
(
SymbolKind
.
Field
),
new
SymbolKindOrTypeKind
(
SymbolKind
.
Parameter
),
new
SymbolKindOrType
Kind
(
SymbolKind
.
Local
));
var
modifiers
=
ImmutableArray
.
Create
<
ModifierKind
>();
return
new
NamingRule
(
new
SymbolSpecification
(
Guid
.
NewGuid
(),
"camelcasefields"
,
kinds
,
ImmutableArray
.
Create
<
Accessibility
>(),
modifiers
),
...
...
@@ -43,7 +43,7 @@ private static NamingRule CreateCamelCaseFieldsAndParametersRule()
private
static
NamingRule
CreateEndWithAsyncRule
()
{
var
kinds
=
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
var
kinds
=
ImmutableArray
.
Create
(
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
var
modifiers
=
ImmutableArray
.
Create
(
new
ModifierKind
(
ModifierKindEnum
.
IsAsync
));
return
new
NamingRule
(
new
SymbolSpecification
(
Guid
.
NewGuid
(),
"endswithasynct"
,
kinds
,
ImmutableArray
.
Create
<
Accessibility
>(),
modifiers
),
...
...
@@ -53,7 +53,7 @@ private static NamingRule CreateEndWithAsyncRule()
private
static
NamingRule
CreateMethodStartsWithGetRule
()
{
var
kinds
=
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
));
var
kinds
=
ImmutableArray
.
Create
(
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
));
var
modifiers
=
ImmutableArray
.
Create
<
ModifierKind
>();
return
new
NamingRule
(
new
SymbolSpecification
(
Guid
.
NewGuid
(),
"startswithget"
,
kinds
,
ImmutableArray
.
Create
<
Accessibility
>(),
modifiers
),
...
...
src/Features/CSharp/Portable/ConvertAutoPropertyToFullProperty/CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs
浏览文件 @
2d07f569
...
...
@@ -87,7 +87,7 @@ internal override async Task<string> GetFieldNameAsync(Document document, IPrope
new
SymbolSpecification
(
Guid
.
NewGuid
(),
"Field"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
)),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
)),
modifiers
:
modifiers
),
new
NamingStyles
.
NamingStyle
(
Guid
.
NewGuid
(),
...
...
@@ -103,7 +103,7 @@ private string GenerateFieldName(IPropertySymbol property, ImmutableArray<Naming
foreach
(
var
rule
in
rules
)
{
if
(
rule
.
SymbolSpecification
.
AppliesTo
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
),
property
.
IsStatic
?
DeclarationModifiers
.
Static
:
DeclarationModifiers
.
None
,
Accessibility
.
Private
))
{
...
...
src/Features/Core/Portable/InitializeParameter/AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs
浏览文件 @
2d07f569
...
...
@@ -45,17 +45,17 @@ internal abstract partial class AbstractInitializeMemberFromParameterCodeRefacto
private
static
readonly
ImmutableArray
<
NamingRule
>
s_builtInRules
=
ImmutableArray
.
Create
(
new
NamingRule
(
new
SymbolSpecification
(
Guid
.
NewGuid
(),
"Property"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
))),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
))),
new
NamingStyles
.
NamingStyle
(
Guid
.
NewGuid
(),
capitalizationScheme
:
Capitalization
.
PascalCase
),
enforcementLevel
:
DiagnosticSeverity
.
Hidden
),
new
NamingRule
(
new
SymbolSpecification
(
Guid
.
NewGuid
(),
"Field"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
))),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
))),
new
NamingStyles
.
NamingStyle
(
Guid
.
NewGuid
(),
capitalizationScheme
:
Capitalization
.
CamelCase
),
enforcementLevel
:
DiagnosticSeverity
.
Hidden
),
new
NamingRule
(
new
SymbolSpecification
(
Guid
.
NewGuid
(),
"FieldWithUnderscore"
,
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
))),
ImmutableArray
.
Create
(
new
SymbolSpecification
.
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
))),
new
NamingStyles
.
NamingStyle
(
Guid
.
NewGuid
(),
prefix
:
"_"
,
capitalizationScheme
:
Capitalization
.
CamelCase
),
enforcementLevel
:
DiagnosticSeverity
.
Hidden
));
...
...
src/VisualStudio/Core/Impl/Options/Style/NamingPreferences/SymbolSpecification/SymbolSpecificationViewModel.cs
浏览文件 @
2d07f569
...
...
@@ -192,12 +192,12 @@ public SymbolKindViewModel(MethodKind methodKind, string name, SymbolSpecificati
IsChecked
=
specification
.
ApplicableSymbolKindList
.
Any
(
k
=>
k
.
MethodKind
==
methodKind
);
}
internal
Symbol
OrTypeOrMethod
Kind
CreateSymbolOrTypeOrMethodKind
()
internal
Symbol
KindOrType
Kind
CreateSymbolOrTypeOrMethodKind
()
{
return
_symbolKind
.
HasValue
?
new
Symbol
OrTypeOrMethod
Kind
(
_symbolKind
.
Value
)
:
_typeKind
.
HasValue
?
new
Symbol
OrTypeOrMethod
Kind
(
_typeKind
.
Value
)
:
_methodKind
.
HasValue
?
new
Symbol
OrTypeOrMethod
Kind
(
_methodKind
.
Value
)
:
_symbolKind
.
HasValue
?
new
Symbol
KindOrType
Kind
(
_symbolKind
.
Value
)
:
_typeKind
.
HasValue
?
new
Symbol
KindOrType
Kind
(
_typeKind
.
Value
)
:
_methodKind
.
HasValue
?
new
Symbol
KindOrType
Kind
(
_methodKind
.
Value
)
:
throw
ExceptionUtilities
.
Unreachable
;
}
}
...
...
src/Workspaces/Core/Portable/NamingStyles/EditorConfig/EditorConfigNamingStyleParser_SymbolSpec.cs
浏览文件 @
2d07f569
...
...
@@ -50,7 +50,7 @@ internal static partial class EditorConfigNamingStyleParser
return
false
;
}
private
static
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>
GetSymbolsApplicableKinds
(
private
static
ImmutableArray
<
Symbol
KindOrType
Kind
>
GetSymbolsApplicableKinds
(
string
symbolSpecName
,
IReadOnlyDictionary
<
string
,
object
>
conventionsDictionary
)
{
...
...
@@ -59,22 +59,22 @@ internal static partial class EditorConfigNamingStyleParser
return
ParseSymbolKindList
(
result
as
string
??
string
.
Empty
);
}
return
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>.
Empty
;
return
ImmutableArray
<
Symbol
KindOrType
Kind
>.
Empty
;
}
private
static
readonly
Symbol
OrTypeOrMethodKind
_class
=
new
SymbolOrTypeOrMethod
Kind
(
TypeKind
.
Class
);
private
static
readonly
Symbol
OrTypeOrMethodKind
_struct
=
new
SymbolOrTypeOrMethod
Kind
(
TypeKind
.
Struct
);
private
static
readonly
Symbol
OrTypeOrMethodKind
_interface
=
new
SymbolOrTypeOrMethod
Kind
(
TypeKind
.
Interface
);
private
static
readonly
Symbol
OrTypeOrMethodKind
_enum
=
new
SymbolOrTypeOrMethod
Kind
(
TypeKind
.
Enum
);
private
static
readonly
Symbol
OrTypeOrMethodKind
_property
=
new
SymbolOrTypeOrMethod
Kind
(
SymbolKind
.
Property
);
private
static
readonly
Symbol
OrTypeOrMethodKind
_method
=
new
SymbolOrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
);
private
static
readonly
Symbol
OrTypeOrMethodKind
_localFunction
=
new
SymbolOrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
);
private
static
readonly
Symbol
OrTypeOrMethodKind
_field
=
new
SymbolOrTypeOrMethod
Kind
(
SymbolKind
.
Field
);
private
static
readonly
Symbol
OrTypeOrMethodKind
_event
=
new
SymbolOrTypeOrMethod
Kind
(
SymbolKind
.
Event
);
private
static
readonly
Symbol
OrTypeOrMethodKind
_delegate
=
new
SymbolOrTypeOrMethod
Kind
(
TypeKind
.
Delegate
);
private
static
readonly
Symbol
OrTypeOrMethodKind
_parameter
=
new
SymbolOrTypeOrMethod
Kind
(
SymbolKind
.
Parameter
);
private
static
readonly
Symbol
OrTypeOrMethodKind
_local
=
new
SymbolOrTypeOrMethod
Kind
(
SymbolKind
.
Local
);
private
static
readonly
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>
_all
=
private
static
readonly
Symbol
KindOrTypeKind
_class
=
new
SymbolKindOrType
Kind
(
TypeKind
.
Class
);
private
static
readonly
Symbol
KindOrTypeKind
_struct
=
new
SymbolKindOrType
Kind
(
TypeKind
.
Struct
);
private
static
readonly
Symbol
KindOrTypeKind
_interface
=
new
SymbolKindOrType
Kind
(
TypeKind
.
Interface
);
private
static
readonly
Symbol
KindOrTypeKind
_enum
=
new
SymbolKindOrType
Kind
(
TypeKind
.
Enum
);
private
static
readonly
Symbol
KindOrTypeKind
_property
=
new
SymbolKindOrType
Kind
(
SymbolKind
.
Property
);
private
static
readonly
Symbol
KindOrTypeKind
_method
=
new
SymbolKindOrType
Kind
(
MethodKind
.
Ordinary
);
private
static
readonly
Symbol
KindOrTypeKind
_localFunction
=
new
SymbolKindOrType
Kind
(
MethodKind
.
LocalFunction
);
private
static
readonly
Symbol
KindOrTypeKind
_field
=
new
SymbolKindOrType
Kind
(
SymbolKind
.
Field
);
private
static
readonly
Symbol
KindOrTypeKind
_event
=
new
SymbolKindOrType
Kind
(
SymbolKind
.
Event
);
private
static
readonly
Symbol
KindOrTypeKind
_delegate
=
new
SymbolKindOrType
Kind
(
TypeKind
.
Delegate
);
private
static
readonly
Symbol
KindOrTypeKind
_parameter
=
new
SymbolKindOrType
Kind
(
SymbolKind
.
Parameter
);
private
static
readonly
Symbol
KindOrTypeKind
_local
=
new
SymbolKindOrType
Kind
(
SymbolKind
.
Local
);
private
static
readonly
ImmutableArray
<
Symbol
KindOrType
Kind
>
_all
=
ImmutableArray
.
Create
(
_class
,
_struct
,
...
...
@@ -89,11 +89,11 @@ internal static partial class EditorConfigNamingStyleParser
_parameter
,
_local
);
private
static
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>
ParseSymbolKindList
(
string
symbolSpecApplicableKinds
)
private
static
ImmutableArray
<
Symbol
KindOrType
Kind
>
ParseSymbolKindList
(
string
symbolSpecApplicableKinds
)
{
if
(
symbolSpecApplicableKinds
==
null
)
{
return
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>.
Empty
;
return
ImmutableArray
<
Symbol
KindOrType
Kind
>.
Empty
;
}
if
(
symbolSpecApplicableKinds
.
Trim
()
==
"*"
)
...
...
@@ -101,7 +101,7 @@ private static ImmutableArray<SymbolOrTypeOrMethodKind> ParseSymbolKindList(stri
return
_all
;
}
var
builder
=
ArrayBuilder
<
Symbol
OrTypeOrMethod
Kind
>.
GetInstance
();
var
builder
=
ArrayBuilder
<
Symbol
KindOrType
Kind
>.
GetInstance
();
foreach
(
var
symbolSpecApplicableKind
in
symbolSpecApplicableKinds
.
Split
(
','
).
Select
(
x
=>
x
.
Trim
()))
{
switch
(
symbolSpecApplicableKind
)
...
...
src/Workspaces/Core/Portable/NamingStyles/Serialization/SymbolSpecification.cs
浏览文件 @
2d07f569
...
...
@@ -17,13 +17,13 @@ internal class SymbolSpecification
public
Guid
ID
{
get
;
}
public
string
Name
{
get
;
}
public
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>
ApplicableSymbolKindList
{
get
;
}
public
ImmutableArray
<
Symbol
KindOrType
Kind
>
ApplicableSymbolKindList
{
get
;
}
public
ImmutableArray
<
Accessibility
>
ApplicableAccessibilityList
{
get
;
}
public
ImmutableArray
<
ModifierKind
>
RequiredModifierList
{
get
;
}
public
SymbolSpecification
(
Guid
?
id
,
string
symbolSpecName
,
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>
symbolKindList
,
ImmutableArray
<
Symbol
KindOrType
Kind
>
symbolKindList
,
ImmutableArray
<
Accessibility
>
accessibilityList
=
default
,
ImmutableArray
<
ModifierKind
>
modifiers
=
default
)
{
...
...
@@ -44,22 +44,22 @@ public static SymbolSpecification CreateDefaultSymbolSpecification()
id
:
Guid
.
NewGuid
(),
symbolSpecName
:
null
,
symbolKindList
:
ImmutableArray
.
Create
(
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Namespace
),
new
Symbol
OrTypeOrMethod
Kind
(
TypeKind
.
Class
),
new
Symbol
OrTypeOrMethod
Kind
(
TypeKind
.
Struct
),
new
Symbol
OrTypeOrMethod
Kind
(
TypeKind
.
Interface
),
new
Symbol
OrTypeOrMethod
Kind
(
TypeKind
.
Delegate
),
new
Symbol
OrTypeOrMethod
Kind
(
TypeKind
.
Enum
),
new
Symbol
OrTypeOrMethod
Kind
(
TypeKind
.
Module
),
new
Symbol
OrTypeOrMethod
Kind
(
TypeKind
.
Pointer
),
new
Symbol
OrTypeOrMethod
Kind
(
TypeKind
.
TypeParameter
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Property
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
Ordinary
),
new
Symbol
OrTypeOrMethod
Kind
(
MethodKind
.
LocalFunction
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Field
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Event
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Parameter
),
new
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
.
Local
)),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Namespace
),
new
Symbol
KindOrType
Kind
(
TypeKind
.
Class
),
new
Symbol
KindOrType
Kind
(
TypeKind
.
Struct
),
new
Symbol
KindOrType
Kind
(
TypeKind
.
Interface
),
new
Symbol
KindOrType
Kind
(
TypeKind
.
Delegate
),
new
Symbol
KindOrType
Kind
(
TypeKind
.
Enum
),
new
Symbol
KindOrType
Kind
(
TypeKind
.
Module
),
new
Symbol
KindOrType
Kind
(
TypeKind
.
Pointer
),
new
Symbol
KindOrType
Kind
(
TypeKind
.
TypeParameter
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Property
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
Ordinary
),
new
Symbol
KindOrType
Kind
(
MethodKind
.
LocalFunction
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Field
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Event
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Parameter
),
new
Symbol
KindOrType
Kind
(
SymbolKind
.
Local
)),
accessibilityList
:
ImmutableArray
.
Create
(
Accessibility
.
Public
,
Accessibility
.
Internal
,
...
...
@@ -78,9 +78,9 @@ internal bool AppliesTo(ISymbol symbol)
}
internal
bool
AppliesTo
(
SymbolKind
symbolKind
,
Accessibility
accessibility
)
=>
this
.
AppliesTo
(
new
Symbol
OrTypeOrMethod
Kind
(
symbolKind
),
new
DeclarationModifiers
(),
accessibility
);
=>
this
.
AppliesTo
(
new
Symbol
KindOrType
Kind
(
symbolKind
),
new
DeclarationModifiers
(),
accessibility
);
internal
bool
AppliesTo
(
Symbol
OrTypeOrMethod
Kind
kind
,
DeclarationModifiers
modifiers
,
Accessibility
accessibility
)
internal
bool
AppliesTo
(
Symbol
KindOrType
Kind
kind
,
DeclarationModifiers
modifiers
,
Accessibility
accessibility
)
{
if
(
ApplicableSymbolKindList
.
Any
()
&&
!
ApplicableSymbolKindList
.
Any
(
k
=>
k
.
Equals
(
kind
)))
{
...
...
@@ -240,22 +240,22 @@ internal static SymbolSpecification FromXElement(XElement symbolSpecificationEle
accessibilityList
:
GetAccessibilityListFromXElement
(
symbolSpecificationElement
.
Element
(
nameof
(
ApplicableAccessibilityList
))),
modifiers
:
GetModifierListFromXElement
(
symbolSpecificationElement
.
Element
(
nameof
(
RequiredModifierList
))));
private
static
ImmutableArray
<
Symbol
OrTypeOrMethod
Kind
>
GetSymbolKindListFromXElement
(
XElement
symbolKindListElement
)
private
static
ImmutableArray
<
Symbol
KindOrType
Kind
>
GetSymbolKindListFromXElement
(
XElement
symbolKindListElement
)
{
var
applicableSymbolKindList
=
ArrayBuilder
<
Symbol
OrTypeOrMethod
Kind
>.
GetInstance
();
var
applicableSymbolKindList
=
ArrayBuilder
<
Symbol
KindOrType
Kind
>.
GetInstance
();
foreach
(
var
symbolKindElement
in
symbolKindListElement
.
Elements
(
nameof
(
SymbolKind
)))
{
applicableSymbolKindList
.
Add
(
Symbol
OrTypeOrMethod
Kind
.
AddSymbolKindFromXElement
(
symbolKindElement
));
applicableSymbolKindList
.
Add
(
Symbol
KindOrType
Kind
.
AddSymbolKindFromXElement
(
symbolKindElement
));
}
foreach
(
var
typeKindElement
in
symbolKindListElement
.
Elements
(
nameof
(
TypeKind
)))
{
applicableSymbolKindList
.
Add
(
Symbol
OrTypeOrMethod
Kind
.
AddTypeKindFromXElement
(
typeKindElement
));
applicableSymbolKindList
.
Add
(
Symbol
KindOrType
Kind
.
AddTypeKindFromXElement
(
typeKindElement
));
}
foreach
(
var
methodKindElement
in
symbolKindListElement
.
Elements
(
nameof
(
MethodKind
)))
{
applicableSymbolKindList
.
Add
(
Symbol
OrTypeOrMethod
Kind
.
AddMethodKindFromXElement
(
methodKindElement
));
applicableSymbolKindList
.
Add
(
Symbol
KindOrType
Kind
.
AddMethodKindFromXElement
(
methodKindElement
));
}
return
applicableSymbolKindList
.
ToImmutableAndFree
();
...
...
@@ -287,27 +287,27 @@ private interface ISymbolMatcher
bool
MatchesSymbol
(
ISymbol
symbol
);
}
public
struct
Symbol
OrTypeOrMethodKind
:
IEquatable
<
SymbolOrTypeOrMethod
Kind
>,
ISymbolMatcher
public
struct
Symbol
KindOrTypeKind
:
IEquatable
<
SymbolKindOrType
Kind
>,
ISymbolMatcher
{
public
SymbolKind
?
SymbolKind
{
get
;
}
public
TypeKind
?
TypeKind
{
get
;
}
public
MethodKind
?
MethodKind
{
get
;
}
public
Symbol
OrTypeOrMethod
Kind
(
SymbolKind
symbolKind
)
:
this
()
public
Symbol
KindOrType
Kind
(
SymbolKind
symbolKind
)
:
this
()
{
SymbolKind
=
symbolKind
;
TypeKind
=
null
;
MethodKind
=
null
;
}
public
Symbol
OrTypeOrMethod
Kind
(
TypeKind
typeKind
)
:
this
()
public
Symbol
KindOrType
Kind
(
TypeKind
typeKind
)
:
this
()
{
SymbolKind
=
null
;
TypeKind
=
typeKind
;
MethodKind
=
null
;
}
public
Symbol
OrTypeOrMethod
Kind
(
MethodKind
methodKind
)
:
this
()
public
Symbol
KindOrType
Kind
(
MethodKind
methodKind
)
:
this
()
{
SymbolKind
=
null
;
TypeKind
=
null
;
...
...
@@ -326,19 +326,19 @@ internal XElement CreateXElement()
MethodKind
.
HasValue
?
new
XElement
(
nameof
(
MethodKind
),
MethodKind
)
:
throw
ExceptionUtilities
.
Unreachable
;
internal
static
Symbol
OrTypeOrMethod
Kind
AddSymbolKindFromXElement
(
XElement
symbolKindElement
)
=>
new
Symbol
OrTypeOrMethod
Kind
((
SymbolKind
)
Enum
.
Parse
(
typeof
(
SymbolKind
),
symbolKindElement
.
Value
));
internal
static
Symbol
KindOrType
Kind
AddSymbolKindFromXElement
(
XElement
symbolKindElement
)
=>
new
Symbol
KindOrType
Kind
((
SymbolKind
)
Enum
.
Parse
(
typeof
(
SymbolKind
),
symbolKindElement
.
Value
));
internal
static
Symbol
OrTypeOrMethod
Kind
AddTypeKindFromXElement
(
XElement
typeKindElement
)
=>
new
Symbol
OrTypeOrMethod
Kind
((
TypeKind
)
Enum
.
Parse
(
typeof
(
TypeKind
),
typeKindElement
.
Value
));
internal
static
Symbol
KindOrType
Kind
AddTypeKindFromXElement
(
XElement
typeKindElement
)
=>
new
Symbol
KindOrType
Kind
((
TypeKind
)
Enum
.
Parse
(
typeof
(
TypeKind
),
typeKindElement
.
Value
));
internal
static
Symbol
OrTypeOrMethod
Kind
AddMethodKindFromXElement
(
XElement
methodKindElement
)
=>
new
Symbol
OrTypeOrMethod
Kind
((
MethodKind
)
Enum
.
Parse
(
typeof
(
MethodKind
),
methodKindElement
.
Value
));
internal
static
Symbol
KindOrType
Kind
AddMethodKindFromXElement
(
XElement
methodKindElement
)
=>
new
Symbol
KindOrType
Kind
((
MethodKind
)
Enum
.
Parse
(
typeof
(
MethodKind
),
methodKindElement
.
Value
));
public
override
bool
Equals
(
object
obj
)
=>
Equals
((
Symbol
OrTypeOrMethod
Kind
)
obj
);
=>
Equals
((
Symbol
KindOrType
Kind
)
obj
);
public
bool
Equals
(
Symbol
OrTypeOrMethod
Kind
other
)
public
bool
Equals
(
Symbol
KindOrType
Kind
other
)
=>
this
.
SymbolKind
==
other
.
SymbolKind
&&
this
.
TypeKind
==
other
.
TypeKind
&&
this
.
MethodKind
==
other
.
MethodKind
;
public
override
int
GetHashCode
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录