Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
89dca7a9
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,发现更多精彩内容 >>
提交
89dca7a9
编写于
4月 23, 2015
作者:
M
Matt Warren
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove use of ClearTrivia on SyntaxGenerator inputs
上级
8f0df9c7
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
33 addition
and
124 deletion
+33
-124
src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs
...s/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs
+16
-51
src/Workspaces/CSharpTest/CodeGeneration/SyntaxGeneratorTests.cs
...kspaces/CSharpTest/CodeGeneration/SyntaxGeneratorTests.cs
+2
-2
src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs
src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs
+4
-6
src/Workspaces/Core/Portable/PublicAPI.txt
src/Workspaces/Core/Portable/PublicAPI.txt
+0
-1
src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb
...sic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb
+11
-55
src/Workspaces/VisualBasicTest/CodeGeneration/SyntaxGeneratorTests.vb
...es/VisualBasicTest/CodeGeneration/SyntaxGeneratorTests.vb
+0
-9
未找到文件。
src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs
浏览文件 @
89dca7a9
...
@@ -89,9 +89,6 @@ public override SyntaxNode NamespaceDeclaration(SyntaxNode name, IEnumerable<Syn
...
@@ -89,9 +89,6 @@ public override SyntaxNode NamespaceDeclaration(SyntaxNode name, IEnumerable<Syn
DeclarationModifiers
modifiers
,
DeclarationModifiers
modifiers
,
SyntaxNode
initializer
)
SyntaxNode
initializer
)
{
{
type
=
this
.
ClearTrivia
(
type
);
initializer
=
this
.
ClearTrivia
(
initializer
);
return
SyntaxFactory
.
FieldDeclaration
(
return
SyntaxFactory
.
FieldDeclaration
(
default
(
SyntaxList
<
AttributeListSyntax
>),
default
(
SyntaxList
<
AttributeListSyntax
>),
AsModifierList
(
accessibility
,
modifiers
,
SyntaxKind
.
FieldDeclaration
),
AsModifierList
(
accessibility
,
modifiers
,
SyntaxKind
.
FieldDeclaration
),
...
@@ -106,9 +103,6 @@ public override SyntaxNode NamespaceDeclaration(SyntaxNode name, IEnumerable<Syn
...
@@ -106,9 +103,6 @@ public override SyntaxNode NamespaceDeclaration(SyntaxNode name, IEnumerable<Syn
public
override
SyntaxNode
ParameterDeclaration
(
string
name
,
SyntaxNode
type
,
SyntaxNode
initializer
,
RefKind
refKind
)
public
override
SyntaxNode
ParameterDeclaration
(
string
name
,
SyntaxNode
type
,
SyntaxNode
initializer
,
RefKind
refKind
)
{
{
type
=
this
.
ClearTrivia
(
type
);
initializer
=
this
.
ClearTrivia
(
initializer
);
return
SyntaxFactory
.
Parameter
(
return
SyntaxFactory
.
Parameter
(
default
(
SyntaxList
<
AttributeListSyntax
>),
default
(
SyntaxList
<
AttributeListSyntax
>),
GetParameterModifiers
(
refKind
),
GetParameterModifiers
(
refKind
),
...
@@ -140,9 +134,6 @@ private SyntaxTokenList GetParameterModifiers(RefKind refKind)
...
@@ -140,9 +134,6 @@ private SyntaxTokenList GetParameterModifiers(RefKind refKind)
DeclarationModifiers
modifiers
,
DeclarationModifiers
modifiers
,
IEnumerable
<
SyntaxNode
>
statements
)
IEnumerable
<
SyntaxNode
>
statements
)
{
{
parameters
=
this
.
ClearTrivia
(
parameters
);
returnType
=
this
.
ClearTrivia
(
returnType
);
bool
hasBody
=
!
modifiers
.
IsAbstract
&&
(!
modifiers
.
IsPartial
||
statements
!=
null
);
bool
hasBody
=
!
modifiers
.
IsAbstract
&&
(!
modifiers
.
IsPartial
||
statements
!=
null
);
return
SyntaxFactory
.
MethodDeclaration
(
return
SyntaxFactory
.
MethodDeclaration
(
...
@@ -173,9 +164,6 @@ private ParameterListSyntax AsParameterList(IEnumerable<SyntaxNode> parameters)
...
@@ -173,9 +164,6 @@ private ParameterListSyntax AsParameterList(IEnumerable<SyntaxNode> parameters)
IEnumerable
<
SyntaxNode
>
baseConstructorArguments
,
IEnumerable
<
SyntaxNode
>
baseConstructorArguments
,
IEnumerable
<
SyntaxNode
>
statements
)
IEnumerable
<
SyntaxNode
>
statements
)
{
{
parameters
=
this
.
ClearTrivia
(
parameters
);
baseConstructorArguments
=
this
.
ClearTrivia
(
baseConstructorArguments
);
return
SyntaxFactory
.
ConstructorDeclaration
(
return
SyntaxFactory
.
ConstructorDeclaration
(
default
(
SyntaxList
<
AttributeListSyntax
>),
default
(
SyntaxList
<
AttributeListSyntax
>),
AsModifierList
(
accessibility
,
modifiers
,
SyntaxKind
.
ConstructorDeclaration
),
AsModifierList
(
accessibility
,
modifiers
,
SyntaxKind
.
ConstructorDeclaration
),
...
@@ -193,8 +181,6 @@ private ParameterListSyntax AsParameterList(IEnumerable<SyntaxNode> parameters)
...
@@ -193,8 +181,6 @@ private ParameterListSyntax AsParameterList(IEnumerable<SyntaxNode> parameters)
IEnumerable
<
SyntaxNode
>
getAccessorStatements
,
IEnumerable
<
SyntaxNode
>
getAccessorStatements
,
IEnumerable
<
SyntaxNode
>
setAccessorStatements
)
IEnumerable
<
SyntaxNode
>
setAccessorStatements
)
{
{
type
=
this
.
ClearTrivia
(
type
);
var
accessors
=
new
List
<
AccessorDeclarationSyntax
>();
var
accessors
=
new
List
<
AccessorDeclarationSyntax
>();
var
hasGetter
=
!
modifiers
.
IsWriteOnly
;
var
hasGetter
=
!
modifiers
.
IsWriteOnly
;
var
hasSetter
=
!
modifiers
.
IsReadOnly
;
var
hasSetter
=
!
modifiers
.
IsReadOnly
;
...
@@ -246,8 +232,6 @@ private ParameterListSyntax AsParameterList(IEnumerable<SyntaxNode> parameters)
...
@@ -246,8 +232,6 @@ private ParameterListSyntax AsParameterList(IEnumerable<SyntaxNode> parameters)
IEnumerable
<
SyntaxNode
>
getAccessorStatements
,
IEnumerable
<
SyntaxNode
>
getAccessorStatements
,
IEnumerable
<
SyntaxNode
>
setAccessorStatements
)
IEnumerable
<
SyntaxNode
>
setAccessorStatements
)
{
{
type
=
this
.
ClearTrivia
(
type
);
var
accessors
=
new
List
<
AccessorDeclarationSyntax
>();
var
accessors
=
new
List
<
AccessorDeclarationSyntax
>();
var
hasGetter
=
!
modifiers
.
IsWriteOnly
;
var
hasGetter
=
!
modifiers
.
IsWriteOnly
;
var
hasSetter
=
!
modifiers
.
IsReadOnly
;
var
hasSetter
=
!
modifiers
.
IsReadOnly
;
...
@@ -318,8 +302,6 @@ private AccessorDeclarationSyntax AccessorDeclaration(SyntaxKind kind, IEnumerab
...
@@ -318,8 +302,6 @@ private AccessorDeclarationSyntax AccessorDeclaration(SyntaxKind kind, IEnumerab
Accessibility
accessibility
,
Accessibility
accessibility
,
DeclarationModifiers
modifiers
)
DeclarationModifiers
modifiers
)
{
{
type
=
this
.
ClearTrivia
(
type
);
return
SyntaxFactory
.
EventFieldDeclaration
(
return
SyntaxFactory
.
EventFieldDeclaration
(
default
(
SyntaxList
<
AttributeListSyntax
>),
default
(
SyntaxList
<
AttributeListSyntax
>),
AsModifierList
(
accessibility
,
modifiers
,
SyntaxKind
.
EventFieldDeclaration
),
AsModifierList
(
accessibility
,
modifiers
,
SyntaxKind
.
EventFieldDeclaration
),
...
@@ -338,9 +320,6 @@ private AccessorDeclarationSyntax AccessorDeclaration(SyntaxKind kind, IEnumerab
...
@@ -338,9 +320,6 @@ private AccessorDeclarationSyntax AccessorDeclaration(SyntaxKind kind, IEnumerab
IEnumerable
<
SyntaxNode
>
addAccessorStatements
,
IEnumerable
<
SyntaxNode
>
addAccessorStatements
,
IEnumerable
<
SyntaxNode
>
removeAccessorStatements
)
IEnumerable
<
SyntaxNode
>
removeAccessorStatements
)
{
{
type
=
this
.
ClearTrivia
(
type
);
parameters
=
this
.
ClearTrivia
(
parameters
);
var
accessors
=
new
List
<
AccessorDeclarationSyntax
>();
var
accessors
=
new
List
<
AccessorDeclarationSyntax
>();
if
(
modifiers
.
IsAbstract
)
if
(
modifiers
.
IsAbstract
)
{
{
...
@@ -380,8 +359,6 @@ public override SyntaxNode AsPublicInterfaceImplementation(SyntaxNode declaratio
...
@@ -380,8 +359,6 @@ public override SyntaxNode AsPublicInterfaceImplementation(SyntaxNode declaratio
public
override
SyntaxNode
AsPrivateInterfaceImplementation
(
SyntaxNode
declaration
,
SyntaxNode
typeName
)
public
override
SyntaxNode
AsPrivateInterfaceImplementation
(
SyntaxNode
declaration
,
SyntaxNode
typeName
)
{
{
typeName
=
this
.
ClearTrivia
(
typeName
);
return
PreserveTrivia
(
declaration
,
d
=>
return
PreserveTrivia
(
declaration
,
d
=>
{
{
var
specifier
=
SyntaxFactory
.
ExplicitInterfaceSpecifier
((
NameSyntax
)
typeName
);
var
specifier
=
SyntaxFactory
.
ExplicitInterfaceSpecifier
((
NameSyntax
)
typeName
);
...
@@ -503,9 +480,6 @@ private AccessorDeclarationSyntax WithoutBody(AccessorDeclarationSyntax accessor
...
@@ -503,9 +480,6 @@ private AccessorDeclarationSyntax WithoutBody(AccessorDeclarationSyntax accessor
IEnumerable
<
SyntaxNode
>
interfaceTypes
,
IEnumerable
<
SyntaxNode
>
interfaceTypes
,
IEnumerable
<
SyntaxNode
>
members
)
IEnumerable
<
SyntaxNode
>
members
)
{
{
baseType
=
this
.
ClearTrivia
(
baseType
);
interfaceTypes
=
this
.
ClearTrivia
(
interfaceTypes
);
List
<
BaseTypeSyntax
>
baseTypes
=
null
;
List
<
BaseTypeSyntax
>
baseTypes
=
null
;
if
(
baseType
!=
null
||
interfaceTypes
!=
null
)
if
(
baseType
!=
null
||
interfaceTypes
!=
null
)
{
{
...
@@ -569,8 +543,6 @@ private MemberDeclarationSyntax AsClassMember(SyntaxNode node, string className)
...
@@ -569,8 +543,6 @@ private MemberDeclarationSyntax AsClassMember(SyntaxNode node, string className)
IEnumerable
<
SyntaxNode
>
interfaceTypes
,
IEnumerable
<
SyntaxNode
>
interfaceTypes
,
IEnumerable
<
SyntaxNode
>
members
)
IEnumerable
<
SyntaxNode
>
members
)
{
{
interfaceTypes
=
this
.
ClearTrivia
(
interfaceTypes
);
var
itypes
=
interfaceTypes
!=
null
?
interfaceTypes
.
Select
(
i
=>
(
BaseTypeSyntax
)
SyntaxFactory
.
SimpleBaseType
((
TypeSyntax
)
i
)).
ToList
()
:
null
;
var
itypes
=
interfaceTypes
!=
null
?
interfaceTypes
.
Select
(
i
=>
(
BaseTypeSyntax
)
SyntaxFactory
.
SimpleBaseType
((
TypeSyntax
)
i
)).
ToList
()
:
null
;
if
(
itypes
!=
null
&&
itypes
.
Count
==
0
)
if
(
itypes
!=
null
&&
itypes
.
Count
==
0
)
{
{
...
@@ -594,8 +566,6 @@ private MemberDeclarationSyntax AsClassMember(SyntaxNode node, string className)
...
@@ -594,8 +566,6 @@ private MemberDeclarationSyntax AsClassMember(SyntaxNode node, string className)
IEnumerable
<
SyntaxNode
>
interfaceTypes
=
null
,
IEnumerable
<
SyntaxNode
>
interfaceTypes
=
null
,
IEnumerable
<
SyntaxNode
>
members
=
null
)
IEnumerable
<
SyntaxNode
>
members
=
null
)
{
{
interfaceTypes
=
this
.
ClearTrivia
(
interfaceTypes
);
var
itypes
=
interfaceTypes
!=
null
?
interfaceTypes
.
Select
(
i
=>
(
BaseTypeSyntax
)
SyntaxFactory
.
SimpleBaseType
((
TypeSyntax
)
i
)).
ToList
()
:
null
;
var
itypes
=
interfaceTypes
!=
null
?
interfaceTypes
.
Select
(
i
=>
(
BaseTypeSyntax
)
SyntaxFactory
.
SimpleBaseType
((
TypeSyntax
)
i
)).
ToList
()
:
null
;
if
(
itypes
!=
null
&&
itypes
.
Count
==
0
)
if
(
itypes
!=
null
&&
itypes
.
Count
==
0
)
{
{
...
@@ -656,7 +626,7 @@ private SyntaxNode AsInterfaceMember(SyntaxNode m)
...
@@ -656,7 +626,7 @@ private SyntaxNode AsInterfaceMember(SyntaxNode m)
case
SyntaxKind
.
EventFieldDeclaration
:
case
SyntaxKind
.
EventFieldDeclaration
:
var
ef
=
(
EventFieldDeclarationSyntax
)
member
;
var
ef
=
(
EventFieldDeclarationSyntax
)
member
;
this
.
GetAccessibilityAndModifiers
(
ef
.
Modifiers
,
out
acc
,
out
modifiers
);
this
.
GetAccessibilityAndModifiers
(
ef
.
Modifiers
,
out
acc
,
out
modifiers
);
var
ep
=
this
.
CustomEventDeclaration
(
this
.
GetName
(
ef
),
this
.
GetType
(
ef
),
acc
,
modifiers
,
parameters
:
null
,
addAccessorStatements
:
null
,
removeAccessorStatements
:
null
);
var
ep
=
this
.
CustomEventDeclaration
(
this
.
GetName
(
ef
),
this
.
ClearTrivia
(
this
.
GetType
(
ef
)
),
acc
,
modifiers
,
parameters
:
null
,
addAccessorStatements
:
null
,
removeAccessorStatements
:
null
);
return
this
.
AsInterfaceMember
(
ep
);
return
this
.
AsInterfaceMember
(
ep
);
// convert field into property
// convert field into property
...
@@ -664,7 +634,7 @@ private SyntaxNode AsInterfaceMember(SyntaxNode m)
...
@@ -664,7 +634,7 @@ private SyntaxNode AsInterfaceMember(SyntaxNode m)
var
f
=
(
FieldDeclarationSyntax
)
member
;
var
f
=
(
FieldDeclarationSyntax
)
member
;
this
.
GetAccessibilityAndModifiers
(
f
.
Modifiers
,
out
acc
,
out
modifiers
);
this
.
GetAccessibilityAndModifiers
(
f
.
Modifiers
,
out
acc
,
out
modifiers
);
return
this
.
AsInterfaceMember
(
return
this
.
AsInterfaceMember
(
this
.
PropertyDeclaration
(
this
.
GetName
(
f
),
this
.
GetType
(
f
),
acc
,
modifiers
,
getAccessorStatements
:
null
,
setAccessorStatements
:
null
));
this
.
PropertyDeclaration
(
this
.
GetName
(
f
),
this
.
ClearTrivia
(
this
.
GetType
(
f
)
),
acc
,
modifiers
,
getAccessorStatements
:
null
,
setAccessorStatements
:
null
));
default
:
default
:
return
null
;
return
null
;
...
@@ -688,8 +658,6 @@ private SyntaxNode AsInterfaceMember(SyntaxNode m)
...
@@ -688,8 +658,6 @@ private SyntaxNode AsInterfaceMember(SyntaxNode m)
public
override
SyntaxNode
EnumMember
(
string
name
,
SyntaxNode
expression
)
public
override
SyntaxNode
EnumMember
(
string
name
,
SyntaxNode
expression
)
{
{
expression
=
this
.
ClearTrivia
(
expression
);
return
SyntaxFactory
.
EnumMemberDeclaration
(
return
SyntaxFactory
.
EnumMemberDeclaration
(
default
(
SyntaxList
<
AttributeListSyntax
>),
default
(
SyntaxList
<
AttributeListSyntax
>),
name
.
ToIdentifierToken
(),
name
.
ToIdentifierToken
(),
...
@@ -730,9 +698,6 @@ private SeparatedSyntaxList<EnumMemberDeclarationSyntax> AsEnumMembers(IEnumerab
...
@@ -730,9 +698,6 @@ private SeparatedSyntaxList<EnumMemberDeclarationSyntax> AsEnumMembers(IEnumerab
Accessibility
accessibility
=
Accessibility
.
NotApplicable
,
Accessibility
accessibility
=
Accessibility
.
NotApplicable
,
DeclarationModifiers
modifiers
=
default
(
DeclarationModifiers
))
DeclarationModifiers
modifiers
=
default
(
DeclarationModifiers
))
{
{
parameters
=
this
.
ClearTrivia
(
parameters
);
returnType
=
this
.
ClearTrivia
(
returnType
);
return
SyntaxFactory
.
DelegateDeclaration
(
return
SyntaxFactory
.
DelegateDeclaration
(
default
(
SyntaxList
<
AttributeListSyntax
>),
default
(
SyntaxList
<
AttributeListSyntax
>),
AsModifierList
(
accessibility
,
modifiers
),
AsModifierList
(
accessibility
,
modifiers
),
...
@@ -784,7 +749,7 @@ private AttributeArgumentSyntax AsAttributeArgument(SyntaxNode node)
...
@@ -784,7 +749,7 @@ private AttributeArgumentSyntax AsAttributeArgument(SyntaxNode node)
return
(
AttributeArgumentSyntax
)
node
;
return
(
AttributeArgumentSyntax
)
node
;
}
}
p
rotected
override
TNode
ClearTrivia
<
TNode
>(
TNode
node
)
p
ublic
override
TNode
ClearTrivia
<
TNode
>(
TNode
node
)
{
{
if
(
node
!=
null
)
if
(
node
!=
null
)
{
{
...
@@ -864,7 +829,7 @@ public override SyntaxNode InsertAttributes(SyntaxNode declaration, int index, I
...
@@ -864,7 +829,7 @@ public override SyntaxNode InsertAttributes(SyntaxNode declaration, int index, I
private
SyntaxNode
InsertAttributesInternal
(
SyntaxNode
declaration
,
int
index
,
IEnumerable
<
SyntaxNode
>
attributes
)
private
SyntaxNode
InsertAttributesInternal
(
SyntaxNode
declaration
,
int
index
,
IEnumerable
<
SyntaxNode
>
attributes
)
{
{
var
newAttributes
=
AsAttributeLists
(
ClearTrivia
(
attributes
)
);
var
newAttributes
=
AsAttributeLists
(
attributes
);
var
existingAttributes
=
this
.
GetAttributes
(
declaration
);
var
existingAttributes
=
this
.
GetAttributes
(
declaration
);
if
(
index
>=
0
&&
index
<
existingAttributes
.
Count
)
if
(
index
>=
0
&&
index
<
existingAttributes
.
Count
)
...
@@ -899,7 +864,7 @@ public override SyntaxNode InsertReturnAttributes(SyntaxNode declaration, int in
...
@@ -899,7 +864,7 @@ public override SyntaxNode InsertReturnAttributes(SyntaxNode declaration, int in
private
SyntaxNode
InsertReturnAttributesInternal
(
SyntaxNode
d
,
int
index
,
IEnumerable
<
SyntaxNode
>
attributes
)
private
SyntaxNode
InsertReturnAttributesInternal
(
SyntaxNode
d
,
int
index
,
IEnumerable
<
SyntaxNode
>
attributes
)
{
{
var
newAttributes
=
AsReturnAttributes
(
ClearTrivia
(
attributes
)
);
var
newAttributes
=
AsReturnAttributes
(
attributes
);
var
existingAttributes
=
this
.
GetReturnAttributes
(
d
);
var
existingAttributes
=
this
.
GetReturnAttributes
(
d
);
if
(
index
>=
0
&&
index
<
existingAttributes
.
Count
)
if
(
index
>=
0
&&
index
<
existingAttributes
.
Count
)
...
@@ -960,7 +925,7 @@ public override SyntaxNode InsertAttributeArguments(SyntaxNode declaration, int
...
@@ -960,7 +925,7 @@ public override SyntaxNode InsertAttributeArguments(SyntaxNode declaration, int
private
SyntaxNode
InsertAttributeArgumentsInternal
(
SyntaxNode
declaration
,
int
index
,
IEnumerable
<
SyntaxNode
>
attributeArguments
)
private
SyntaxNode
InsertAttributeArgumentsInternal
(
SyntaxNode
declaration
,
int
index
,
IEnumerable
<
SyntaxNode
>
attributeArguments
)
{
{
var
newArgumentList
=
this
.
ClearTrivia
(
this
.
AsAttributeArgumentList
(
attributeArguments
)
);
var
newArgumentList
=
this
.
AsAttributeArgumentList
(
attributeArguments
);
var
existingArgumentList
=
this
.
GetAttributeArgumentList
(
declaration
);
var
existingArgumentList
=
this
.
GetAttributeArgumentList
(
declaration
);
...
@@ -1115,7 +1080,7 @@ public override IReadOnlyList<SyntaxNode> GetNamespaceImports(SyntaxNode declara
...
@@ -1115,7 +1080,7 @@ public override IReadOnlyList<SyntaxNode> GetNamespaceImports(SyntaxNode declara
public
override
SyntaxNode
InsertNamespaceImports
(
SyntaxNode
declaration
,
int
index
,
IEnumerable
<
SyntaxNode
>
imports
)
public
override
SyntaxNode
InsertNamespaceImports
(
SyntaxNode
declaration
,
int
index
,
IEnumerable
<
SyntaxNode
>
imports
)
{
{
var
usings
=
AsUsingDirectives
(
this
.
ClearTrivia
(
imports
)
);
var
usings
=
AsUsingDirectives
(
imports
);
switch
(
declaration
.
Kind
())
switch
(
declaration
.
Kind
())
{
{
...
@@ -1234,7 +1199,7 @@ private void Flatten(SyntaxNode declaration, VariableDeclarationSyntax vd, List<
...
@@ -1234,7 +1199,7 @@ private void Flatten(SyntaxNode declaration, VariableDeclarationSyntax vd, List<
public
override
SyntaxNode
InsertMembers
(
SyntaxNode
declaration
,
int
index
,
IEnumerable
<
SyntaxNode
>
members
)
public
override
SyntaxNode
InsertMembers
(
SyntaxNode
declaration
,
int
index
,
IEnumerable
<
SyntaxNode
>
members
)
{
{
var
newMembers
=
this
.
ClearTrivia
(
this
.
AsMembersOf
(
declaration
,
members
)
);
var
newMembers
=
this
.
AsMembersOf
(
declaration
,
members
);
var
existingMembers
=
this
.
GetMembers
(
declaration
);
var
existingMembers
=
this
.
GetMembers
(
declaration
);
if
(
index
>=
0
&&
index
<
existingMembers
.
Count
)
if
(
index
>=
0
&&
index
<
existingMembers
.
Count
)
...
@@ -2418,7 +2383,7 @@ public override IReadOnlyList<SyntaxNode> GetParameters(SyntaxNode declaration)
...
@@ -2418,7 +2383,7 @@ public override IReadOnlyList<SyntaxNode> GetParameters(SyntaxNode declaration)
public
override
SyntaxNode
InsertParameters
(
SyntaxNode
declaration
,
int
index
,
IEnumerable
<
SyntaxNode
>
parameters
)
public
override
SyntaxNode
InsertParameters
(
SyntaxNode
declaration
,
int
index
,
IEnumerable
<
SyntaxNode
>
parameters
)
{
{
var
newParameters
=
AsParameterList
(
this
.
ClearTrivia
(
parameters
)
);
var
newParameters
=
AsParameterList
(
parameters
);
var
currentList
=
this
.
GetParameterList
(
declaration
);
var
currentList
=
this
.
GetParameterList
(
declaration
);
if
(
currentList
==
null
)
if
(
currentList
==
null
)
...
@@ -2534,7 +2499,7 @@ public override SyntaxNode WithExpression(SyntaxNode declaration, SyntaxNode exp
...
@@ -2534,7 +2499,7 @@ public override SyntaxNode WithExpression(SyntaxNode declaration, SyntaxNode exp
private
SyntaxNode
WithExpressionInternal
(
SyntaxNode
declaration
,
SyntaxNode
expression
)
private
SyntaxNode
WithExpressionInternal
(
SyntaxNode
declaration
,
SyntaxNode
expression
)
{
{
var
expr
=
(
ExpressionSyntax
)
this
.
ClearTrivia
(
expression
)
;
var
expr
=
(
ExpressionSyntax
)
expression
;
switch
(
declaration
.
Kind
())
switch
(
declaration
.
Kind
())
{
{
...
@@ -2729,7 +2694,7 @@ public override IReadOnlyList<SyntaxNode> GetAccessors(SyntaxNode declaration)
...
@@ -2729,7 +2694,7 @@ public override IReadOnlyList<SyntaxNode> GetAccessors(SyntaxNode declaration)
public
override
SyntaxNode
InsertAccessors
(
SyntaxNode
declaration
,
int
index
,
IEnumerable
<
SyntaxNode
>
accessors
)
public
override
SyntaxNode
InsertAccessors
(
SyntaxNode
declaration
,
int
index
,
IEnumerable
<
SyntaxNode
>
accessors
)
{
{
var
newAccessors
=
AsAccessorList
(
this
.
ClearTrivia
(
accessors
)
,
declaration
.
Kind
());
var
newAccessors
=
AsAccessorList
(
accessors
,
declaration
.
Kind
());
var
currentList
=
this
.
GetAccessorList
(
declaration
);
var
currentList
=
this
.
GetAccessorList
(
declaration
);
if
(
currentList
==
null
)
if
(
currentList
==
null
)
...
@@ -2955,9 +2920,9 @@ private SyntaxNode WithBaseList(SyntaxNode declaration, BaseListSyntax baseList)
...
@@ -2955,9 +2920,9 @@ private SyntaxNode WithBaseList(SyntaxNode declaration, BaseListSyntax baseList)
}
}
}
}
#
endregion
#endregion
#
region
Remove
,
Replace
,
Insert
#region Remove, Replace, Insert
public
override
SyntaxNode
ReplaceNode
(
SyntaxNode
root
,
SyntaxNode
declaration
,
SyntaxNode
newDeclaration
)
public
override
SyntaxNode
ReplaceNode
(
SyntaxNode
root
,
SyntaxNode
declaration
,
SyntaxNode
newDeclaration
)
{
{
...
@@ -3237,9 +3202,9 @@ private SyntaxNode RemoveNodeInternal(SyntaxNode root, SyntaxNode declaration)
...
@@ -3237,9 +3202,9 @@ private SyntaxNode RemoveNodeInternal(SyntaxNode root, SyntaxNode declaration)
return
base
.
RemoveNode
(
root
,
declaration
);
return
base
.
RemoveNode
(
root
,
declaration
);
}
}
#
endregion
#endregion
#
region
Statements
and
Expressions
#region Statements and Expressions
public
override
SyntaxNode
AwaitExpression
(
SyntaxNode
expression
)
public
override
SyntaxNode
AwaitExpression
(
SyntaxNode
expression
)
{
{
...
@@ -3831,6 +3796,6 @@ private IReadOnlyList<T> AsReadOnlyList<T>(IEnumerable<T> sequence)
...
@@ -3831,6 +3796,6 @@ private IReadOnlyList<T> AsReadOnlyList<T>(IEnumerable<T> sequence)
return
list
;
return
list
;
}
}
#
endregion
#endregion
}
}
}
}
src/Workspaces/CSharpTest/CodeGeneration/SyntaxGeneratorTests.cs
浏览文件 @
89dca7a9
...
@@ -1226,8 +1226,8 @@ public class C { } // end").Members[0];
...
@@ -1226,8 +1226,8 @@ public class C { } // end").Members[0];
VerifySyntax
<
AttributeListSyntax
>(
attrWithComment
,
"// comment\r\n[a]"
);
VerifySyntax
<
AttributeListSyntax
>(
attrWithComment
,
"// comment\r\n[a]"
);
// added attributes are stripped of trivia
// added attributes are stripped of trivia
var
added2
=
_g
.
AddAttributes
(
cls
,
attrWithComment
);
//
var added2 = _g.AddAttributes(cls, attrWithComment);
VerifySyntax
<
ClassDeclarationSyntax
>(
added2
,
"// comment\r\n[a]\r\npublic class C\r\n{\r\n} // end\r\n"
);
//
VerifySyntax<ClassDeclarationSyntax>(added2, "// comment\r\n[a]\r\npublic class C\r\n{\r\n} // end\r\n");
}
}
[
Fact
]
[
Fact
]
...
...
src/Workspaces/Core/Portable/Editing/SyntaxGenerator.cs
浏览文件 @
89dca7a9
...
@@ -1094,12 +1094,10 @@ protected static SyntaxNode ReplaceWithTrivia(SyntaxNode root, SyntaxToken origi
...
@@ -1094,12 +1094,10 @@ protected static SyntaxNode ReplaceWithTrivia(SyntaxNode root, SyntaxToken origi
return
root
.
ReplaceToken
(
original
,
combinedTriviaReplacement
);
return
root
.
ReplaceToken
(
original
,
combinedTriviaReplacement
);
}
}
protected
IEnumerable
<
TNode
>
ClearTrivia
<
TNode
>(
IEnumerable
<
TNode
>
nodes
)
where
TNode
:
SyntaxNode
/// <summary>
{
/// Creates a new instance of the node with the leading and trailing trivia removed and replaced with elastic markers.
return
nodes
!=
null
?
nodes
.
Select
(
n
=>
ClearTrivia
(
n
))
:
null
;
/// </summary>
}
public
abstract
TNode
ClearTrivia
<
TNode
>(
TNode
node
)
where
TNode
:
SyntaxNode
;
protected
abstract
TNode
ClearTrivia
<
TNode
>(
TNode
node
)
where
TNode
:
SyntaxNode
;
protected
int
IndexOf
<
T
>(
IReadOnlyList
<
T
>
list
,
T
element
)
protected
int
IndexOf
<
T
>(
IReadOnlyList
<
T
>
list
,
T
element
)
{
{
...
...
src/Workspaces/Core/Portable/PublicAPI.txt
浏览文件 @
89dca7a9
...
@@ -293,7 +293,6 @@ Microsoft.CodeAnalysis.Editing.SyntaxGenerator.Attribute(string name, params Mic
...
@@ -293,7 +293,6 @@ Microsoft.CodeAnalysis.Editing.SyntaxGenerator.Attribute(string name, params Mic
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.AttributeArgument(Microsoft.CodeAnalysis.SyntaxNode expression) -> Microsoft.CodeAnalysis.SyntaxNode
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.AttributeArgument(Microsoft.CodeAnalysis.SyntaxNode expression) -> Microsoft.CodeAnalysis.SyntaxNode
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.CastExpression(Microsoft.CodeAnalysis.ITypeSymbol type, Microsoft.CodeAnalysis.SyntaxNode expression) -> Microsoft.CodeAnalysis.SyntaxNode
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.CastExpression(Microsoft.CodeAnalysis.ITypeSymbol type, Microsoft.CodeAnalysis.SyntaxNode expression) -> Microsoft.CodeAnalysis.SyntaxNode
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.CatchClause(Microsoft.CodeAnalysis.ITypeSymbol type, string identifer, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxNode> statements) -> Microsoft.CodeAnalysis.SyntaxNode
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.CatchClause(Microsoft.CodeAnalysis.ITypeSymbol type, string identifer, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxNode> statements) -> Microsoft.CodeAnalysis.SyntaxNode
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.ClearTrivia<TNode>(System.Collections.Generic.IEnumerable<TNode> nodes) -> System.Collections.Generic.IEnumerable<TNode>
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.CompilationUnit(params Microsoft.CodeAnalysis.SyntaxNode[] declarations) -> Microsoft.CodeAnalysis.SyntaxNode
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.CompilationUnit(params Microsoft.CodeAnalysis.SyntaxNode[] declarations) -> Microsoft.CodeAnalysis.SyntaxNode
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.ConstructorDeclaration(Microsoft.CodeAnalysis.IMethodSymbol constructorMethod, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxNode> baseConstructorArguments = null, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxNode> statements = null) -> Microsoft.CodeAnalysis.SyntaxNode
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.ConstructorDeclaration(Microsoft.CodeAnalysis.IMethodSymbol constructorMethod, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxNode> baseConstructorArguments = null, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxNode> statements = null) -> Microsoft.CodeAnalysis.SyntaxNode
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.ConvertExpression(Microsoft.CodeAnalysis.ITypeSymbol type, Microsoft.CodeAnalysis.SyntaxNode expression) -> Microsoft.CodeAnalysis.SyntaxNode
Microsoft.CodeAnalysis.Editing.SyntaxGenerator.ConvertExpression(Microsoft.CodeAnalysis.ITypeSymbol type, Microsoft.CodeAnalysis.SyntaxNode expression) -> Microsoft.CodeAnalysis.SyntaxNode
...
...
src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb
浏览文件 @
89dca7a9
...
@@ -590,9 +590,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -590,9 +590,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Public
Overrides
Function
FieldDeclaration
(
name
As
String
,
type
As
SyntaxNode
,
Optional
accessibility
As
Accessibility
=
Nothing
,
Optional
modifiers
As
DeclarationModifiers
=
Nothing
,
Optional
initializer
As
SyntaxNode
=
Nothing
)
As
SyntaxNode
Public
Overrides
Function
FieldDeclaration
(
name
As
String
,
type
As
SyntaxNode
,
Optional
accessibility
As
Accessibility
=
Nothing
,
Optional
modifiers
As
DeclarationModifiers
=
Nothing
,
Optional
initializer
As
SyntaxNode
=
Nothing
)
As
SyntaxNode
type
=
Me
.
ClearTrivia
(
type
)
initializer
=
Me
.
ClearTrivia
(
initializer
)
Return
SyntaxFactory
.
FieldDeclaration
(
Return
SyntaxFactory
.
FieldDeclaration
(
attributeLists
:
=
Nothing
,
attributeLists
:
=
Nothing
,
modifiers
:
=
GetModifierList
(
accessibility
,
modifiers
And
s_fieldModifiers
,
isField
:
=
True
),
modifiers
:
=
GetModifierList
(
accessibility
,
modifiers
And
s_fieldModifiers
,
isField
:
=
True
),
...
@@ -608,9 +605,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -608,9 +605,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Optional
modifiers
As
DeclarationModifiers
=
Nothing
,
Optional
modifiers
As
DeclarationModifiers
=
Nothing
,
Optional
statements
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
Optional
statements
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
parameters
=
MyBase
.
ClearTrivia
(
parameters
)
returnType
=
Me
.
ClearTrivia
(
returnType
)
Dim
statement
=
SyntaxFactory
.
MethodStatement
(
Dim
statement
=
SyntaxFactory
.
MethodStatement
(
kind
:
=
If
(
returnType
Is
Nothing
,
SyntaxKind
.
SubStatement
,
SyntaxKind
.
FunctionStatement
),
kind
:
=
If
(
returnType
Is
Nothing
,
SyntaxKind
.
SubStatement
,
SyntaxKind
.
FunctionStatement
),
attributeLists
:
=
Nothing
,
attributeLists
:
=
Nothing
,
...
@@ -639,8 +633,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -639,8 +633,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Public
Overrides
Function
ParameterDeclaration
(
name
As
String
,
Optional
type
As
SyntaxNode
=
Nothing
,
Optional
initializer
As
SyntaxNode
=
Nothing
,
Optional
refKind
As
RefKind
=
Nothing
)
As
SyntaxNode
Public
Overrides
Function
ParameterDeclaration
(
name
As
String
,
Optional
type
As
SyntaxNode
=
Nothing
,
Optional
initializer
As
SyntaxNode
=
Nothing
,
Optional
refKind
As
RefKind
=
Nothing
)
As
SyntaxNode
type
=
Me
.
ClearTrivia
(
type
)
Return
SyntaxFactory
.
Parameter
(
Return
SyntaxFactory
.
Parameter
(
attributeLists
:
=
Nothing
,
attributeLists
:
=
Nothing
,
modifiers
:
=
GetParameterModifiers
(
refKind
,
initializer
),
modifiers
:
=
GetParameterModifiers
(
refKind
,
initializer
),
...
@@ -668,8 +660,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -668,8 +660,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Optional
getAccessorStatements
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
,
Optional
getAccessorStatements
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
,
Optional
setAccessorStatements
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
Optional
setAccessorStatements
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
type
=
Me
.
ClearTrivia
(
type
)
Dim
asClause
=
SyntaxFactory
.
SimpleAsClause
(
DirectCast
(
type
,
TypeSyntax
))
Dim
asClause
=
SyntaxFactory
.
SimpleAsClause
(
DirectCast
(
type
,
TypeSyntax
))
Dim
statement
=
SyntaxFactory
.
PropertyStatement
(
Dim
statement
=
SyntaxFactory
.
PropertyStatement
(
attributeLists
:
=
Nothing
,
attributeLists
:
=
Nothing
,
...
@@ -708,9 +698,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -708,9 +698,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Optional
getAccessorStatements
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
,
Optional
getAccessorStatements
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
,
Optional
setAccessorStatements
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
Optional
setAccessorStatements
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
type
=
ClearTrivia
(
type
)
parameters
=
MyBase
.
ClearTrivia
(
parameters
)
Dim
asClause
=
SyntaxFactory
.
SimpleAsClause
(
DirectCast
(
type
,
TypeSyntax
))
Dim
asClause
=
SyntaxFactory
.
SimpleAsClause
(
DirectCast
(
type
,
TypeSyntax
))
Dim
statement
=
SyntaxFactory
.
PropertyStatement
(
Dim
statement
=
SyntaxFactory
.
PropertyStatement
(
attributeLists
:
=
Nothing
,
attributeLists
:
=
Nothing
,
...
@@ -742,8 +729,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -742,8 +729,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Private
Function
AccessorBlock
(
kind
As
SyntaxKind
,
statements
As
IEnumerable
(
Of
SyntaxNode
),
type
As
SyntaxNode
)
As
AccessorBlockSyntax
Private
Function
AccessorBlock
(
kind
As
SyntaxKind
,
statements
As
IEnumerable
(
Of
SyntaxNode
),
type
As
SyntaxNode
)
As
AccessorBlockSyntax
type
=
Me
.
ClearTrivia
(
type
)
Select
Case
kind
Select
Case
kind
Case
SyntaxKind
.
GetAccessorBlock
Case
SyntaxKind
.
GetAccessorBlock
Return
CreateGetAccessorBlock
(
statements
)
Return
CreateGetAccessorBlock
(
statements
)
...
@@ -767,8 +752,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -767,8 +752,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Private
Function
CreateSetAccessorBlock
(
type
As
SyntaxNode
,
statements
As
IEnumerable
(
Of
SyntaxNode
))
As
AccessorBlockSyntax
Private
Function
CreateSetAccessorBlock
(
type
As
SyntaxNode
,
statements
As
IEnumerable
(
Of
SyntaxNode
))
As
AccessorBlockSyntax
type
=
Me
.
ClearTrivia
(
type
)
Dim
asClause
=
SyntaxFactory
.
SimpleAsClause
(
DirectCast
(
type
,
TypeSyntax
))
Dim
asClause
=
SyntaxFactory
.
SimpleAsClause
(
DirectCast
(
type
,
TypeSyntax
))
Dim
valueParameter
=
SyntaxFactory
.
Parameter
(
Dim
valueParameter
=
SyntaxFactory
.
Parameter
(
...
@@ -791,8 +774,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -791,8 +774,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Private
Function
CreateAddHandlerAccessorBlock
(
delegateType
As
SyntaxNode
,
statements
As
IEnumerable
(
Of
SyntaxNode
))
As
AccessorBlockSyntax
Private
Function
CreateAddHandlerAccessorBlock
(
delegateType
As
SyntaxNode
,
statements
As
IEnumerable
(
Of
SyntaxNode
))
As
AccessorBlockSyntax
delegateType
=
Me
.
ClearTrivia
(
delegateType
)
Dim
asClause
=
SyntaxFactory
.
SimpleAsClause
(
DirectCast
(
delegateType
,
TypeSyntax
))
Dim
asClause
=
SyntaxFactory
.
SimpleAsClause
(
DirectCast
(
delegateType
,
TypeSyntax
))
Dim
valueParameter
=
SyntaxFactory
.
Parameter
(
Dim
valueParameter
=
SyntaxFactory
.
Parameter
(
...
@@ -815,8 +796,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -815,8 +796,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Private
Function
CreateRemoveHandlerAccessorBlock
(
delegateType
As
SyntaxNode
,
statements
As
IEnumerable
(
Of
SyntaxNode
))
As
AccessorBlockSyntax
Private
Function
CreateRemoveHandlerAccessorBlock
(
delegateType
As
SyntaxNode
,
statements
As
IEnumerable
(
Of
SyntaxNode
))
As
AccessorBlockSyntax
delegateType
=
Me
.
ClearTrivia
(
delegateType
)
Dim
asClause
=
SyntaxFactory
.
SimpleAsClause
(
DirectCast
(
delegateType
,
TypeSyntax
))
Dim
asClause
=
SyntaxFactory
.
SimpleAsClause
(
DirectCast
(
delegateType
,
TypeSyntax
))
Dim
valueParameter
=
SyntaxFactory
.
Parameter
(
Dim
valueParameter
=
SyntaxFactory
.
Parameter
(
...
@@ -839,7 +818,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -839,7 +818,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Private
Function
CreateRaiseEventAccessorBlock
(
parameters
As
IEnumerable
(
Of
SyntaxNode
),
statements
As
IEnumerable
(
Of
SyntaxNode
))
As
AccessorBlockSyntax
Private
Function
CreateRaiseEventAccessorBlock
(
parameters
As
IEnumerable
(
Of
SyntaxNode
),
statements
As
IEnumerable
(
Of
SyntaxNode
))
As
AccessorBlockSyntax
parameters
=
MyBase
.
ClearTrivia
(
parameters
)
Dim
parameterList
=
GetParameterList
(
parameters
)
Dim
parameterList
=
GetParameterList
(
parameters
)
Return
SyntaxFactory
.
AccessorBlock
(
Return
SyntaxFactory
.
AccessorBlock
(
...
@@ -859,7 +837,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -859,7 +837,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Private
Function
AsPublicInterfaceImplementationInternal
(
declaration
As
SyntaxNode
,
typeName
As
SyntaxNode
)
As
SyntaxNode
Private
Function
AsPublicInterfaceImplementationInternal
(
declaration
As
SyntaxNode
,
typeName
As
SyntaxNode
)
As
SyntaxNode
typeName
=
Me
.
ClearTrivia
(
typeName
)
Dim
type
=
DirectCast
(
typeName
,
NameSyntax
)
Dim
type
=
DirectCast
(
typeName
,
NameSyntax
)
declaration
=
WithBody
(
declaration
,
allowDefault
:
=
True
)
declaration
=
WithBody
(
declaration
,
allowDefault
:
=
True
)
...
@@ -887,7 +864,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -887,7 +864,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Private
Function
AsPrivateInterfaceImplementationInternal
(
declaration
As
SyntaxNode
,
typeName
As
SyntaxNode
)
As
SyntaxNode
Private
Function
AsPrivateInterfaceImplementationInternal
(
declaration
As
SyntaxNode
,
typeName
As
SyntaxNode
)
As
SyntaxNode
typeName
=
Me
.
ClearTrivia
(
typeName
)
Dim
type
=
DirectCast
(
typeName
,
NameSyntax
)
Dim
type
=
DirectCast
(
typeName
,
NameSyntax
)
' convert declaration statements to blocks
' convert declaration statements to blocks
...
@@ -1013,9 +989,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -1013,9 +989,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Optional
baseConstructorArguments
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
,
Optional
baseConstructorArguments
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
,
Optional
statements
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
Optional
statements
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
parameters
=
MyBase
.
ClearTrivia
(
parameters
)
baseConstructorArguments
=
MyBase
.
ClearTrivia
(
baseConstructorArguments
)
Dim
stats
=
GetStatementList
(
statements
)
Dim
stats
=
GetStatementList
(
statements
)
If
(
baseConstructorArguments
IsNot
Nothing
)
Then
If
(
baseConstructorArguments
IsNot
Nothing
)
Then
...
@@ -1040,9 +1013,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -1040,9 +1013,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Optional
interfaceTypes
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
,
Optional
interfaceTypes
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
,
Optional
members
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
Optional
members
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
baseType
=
Me
.
ClearTrivia
(
baseType
)
interfaceTypes
=
MyBase
.
ClearTrivia
(
interfaceTypes
)
Dim
itypes
=
If
(
interfaceTypes
IsNot
Nothing
,
interfaceTypes
.
Cast
(
Of
TypeSyntax
),
Nothing
)
Dim
itypes
=
If
(
interfaceTypes
IsNot
Nothing
,
interfaceTypes
.
Cast
(
Of
TypeSyntax
),
Nothing
)
If
itypes
IsNot
Nothing
AndAlso
itypes
.
Count
=
0
Then
If
itypes
IsNot
Nothing
AndAlso
itypes
.
Count
=
0
Then
itypes
=
Nothing
itypes
=
Nothing
...
@@ -1079,8 +1049,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -1079,8 +1049,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Optional
interfaceTypes
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
,
Optional
interfaceTypes
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
,
Optional
members
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
Optional
members
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
interfaceTypes
=
MyBase
.
ClearTrivia
(
interfaceTypes
)
Dim
itypes
=
If
(
interfaceTypes
IsNot
Nothing
,
interfaceTypes
.
Cast
(
Of
TypeSyntax
),
Nothing
)
Dim
itypes
=
If
(
interfaceTypes
IsNot
Nothing
,
interfaceTypes
.
Cast
(
Of
TypeSyntax
),
Nothing
)
If
itypes
IsNot
Nothing
AndAlso
itypes
.
Count
=
0
Then
If
itypes
IsNot
Nothing
AndAlso
itypes
.
Count
=
0
Then
itypes
=
Nothing
itypes
=
Nothing
...
@@ -1116,8 +1084,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -1116,8 +1084,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Optional
interfaceTypes
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
,
Optional
interfaceTypes
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
,
Optional
members
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
Optional
members
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
interfaceTypes
=
MyBase
.
ClearTrivia
(
interfaceTypes
)
Dim
itypes
=
If
(
interfaceTypes
IsNot
Nothing
,
interfaceTypes
.
Cast
(
Of
TypeSyntax
),
Nothing
)
Dim
itypes
=
If
(
interfaceTypes
IsNot
Nothing
,
interfaceTypes
.
Cast
(
Of
TypeSyntax
),
Nothing
)
If
itypes
IsNot
Nothing
AndAlso
itypes
.
Count
=
0
Then
If
itypes
IsNot
Nothing
AndAlso
itypes
.
Count
=
0
Then
itypes
=
Nothing
itypes
=
Nothing
...
@@ -1211,8 +1177,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -1211,8 +1177,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Optional
accessibility
As
Accessibility
=
Accessibility
.
NotApplicable
,
Optional
accessibility
As
Accessibility
=
Accessibility
.
NotApplicable
,
Optional
modifiers
As
DeclarationModifiers
=
Nothing
)
As
SyntaxNode
Optional
modifiers
As
DeclarationModifiers
=
Nothing
)
As
SyntaxNode
parameters
=
MyBase
.
ClearTrivia
(
parameters
)
Dim
kind
=
If
(
returnType
Is
Nothing
,
SyntaxKind
.
DelegateSubStatement
,
SyntaxKind
.
DelegateFunctionStatement
)
Dim
kind
=
If
(
returnType
Is
Nothing
,
SyntaxKind
.
DelegateSubStatement
,
SyntaxKind
.
DelegateFunctionStatement
)
Return
SyntaxFactory
.
DelegateStatement
(
Return
SyntaxFactory
.
DelegateStatement
(
...
@@ -1247,13 +1211,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -1247,13 +1211,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Public
Overrides
Function
NamespaceImportDeclaration
(
name
As
SyntaxNode
)
As
SyntaxNode
Public
Overrides
Function
NamespaceImportDeclaration
(
name
As
SyntaxNode
)
As
SyntaxNode
name
=
Me
.
ClearTrivia
(
name
)
Return
SyntaxFactory
.
ImportsStatement
(
SyntaxFactory
.
SingletonSeparatedList
(
Of
ImportsClauseSyntax
)(
SyntaxFactory
.
SimpleImportsClause
(
DirectCast
(
name
,
NameSyntax
))))
Return
SyntaxFactory
.
ImportsStatement
(
SyntaxFactory
.
SingletonSeparatedList
(
Of
ImportsClauseSyntax
)(
SyntaxFactory
.
SimpleImportsClause
(
DirectCast
(
name
,
NameSyntax
))))
End
Function
End
Function
Public
Overrides
Function
NamespaceDeclaration
(
name
As
SyntaxNode
,
nestedDeclarations
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Public
Overrides
Function
NamespaceDeclaration
(
name
As
SyntaxNode
,
nestedDeclarations
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
name
=
Me
.
ClearTrivia
(
name
)
Dim
imps
As
IEnumerable
(
Of
StatementSyntax
)
=
AsImports
(
nestedDeclarations
)
Dim
imps
As
IEnumerable
(
Of
StatementSyntax
)
=
AsImports
(
nestedDeclarations
)
Dim
members
As
IEnumerable
(
Of
StatementSyntax
)
=
AsNamespaceMembers
(
nestedDeclarations
)
Dim
members
As
IEnumerable
(
Of
StatementSyntax
)
=
AsNamespaceMembers
(
nestedDeclarations
)
...
@@ -1266,9 +1227,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -1266,9 +1227,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Public
Overrides
Function
Attribute
(
name
As
SyntaxNode
,
Optional
attributeArguments
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
Public
Overrides
Function
Attribute
(
name
As
SyntaxNode
,
Optional
attributeArguments
As
IEnumerable
(
Of
SyntaxNode
)
=
Nothing
)
As
SyntaxNode
name
=
Me
.
ClearTrivia
(
name
)
attributeArguments
=
MyBase
.
ClearTrivia
(
attributeArguments
)
Dim
attr
=
SyntaxFactory
.
Attribute
(
Dim
attr
=
SyntaxFactory
.
Attribute
(
target
:
=
Nothing
,
target
:
=
Nothing
,
name
:
=
DirectCast
(
name
,
TypeSyntax
),
name
:
=
DirectCast
(
name
,
TypeSyntax
),
...
@@ -1279,19 +1237,17 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -1279,19 +1237,17 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Private
Function
AsArgumentList
(
arguments
As
IEnumerable
(
Of
SyntaxNode
))
As
ArgumentListSyntax
Private
Function
AsArgumentList
(
arguments
As
IEnumerable
(
Of
SyntaxNode
))
As
ArgumentListSyntax
If
arguments
IsNot
Nothing
Then
If
arguments
IsNot
Nothing
Then
Return
SyntaxFactory
.
ArgumentList
(
SyntaxFactory
.
SeparatedList
(
MyBase
.
ClearTrivia
(
arguments
)
.
Select
(
AddressOf
AsArgument
)))
Return
SyntaxFactory
.
ArgumentList
(
SyntaxFactory
.
SeparatedList
(
arguments
.
Select
(
AddressOf
AsArgument
)))
Else
Else
Return
Nothing
Return
Nothing
End
If
End
If
End
Function
End
Function
Public
Overrides
Function
AttributeArgument
(
name
As
String
,
expression
As
SyntaxNode
)
As
SyntaxNode
Public
Overrides
Function
AttributeArgument
(
name
As
String
,
expression
As
SyntaxNode
)
As
SyntaxNode
expression
=
Me
.
ClearTrivia
(
expression
)
Return
Argument
(
name
,
RefKind
.
None
,
expression
)
Return
Argument
(
name
,
RefKind
.
None
,
expression
)
End
Function
End
Function
P
rotected
Overrides
Function
ClearTrivia
(
Of
TNode
As
SyntaxNode
)(
node
As
TNode
)
As
TNode
P
ublic
Overrides
Function
ClearTrivia
(
Of
TNode
As
SyntaxNode
)(
node
As
TNode
)
As
TNode
If
node
IsNot
Nothing
Then
If
node
IsNot
Nothing
Then
Return
node
.
WithLeadingTrivia
(
SyntaxFactory
.
ElasticMarker
).
WithTrailingTrivia
(
SyntaxFactory
.
ElasticMarker
)
Return
node
.
WithLeadingTrivia
(
SyntaxFactory
.
ElasticMarker
).
WithTrailingTrivia
(
SyntaxFactory
.
ElasticMarker
)
Else
Else
...
@@ -1333,11 +1289,11 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -1333,11 +1289,11 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Public
Overrides
Function
InsertAttributes
(
declaration
As
SyntaxNode
,
index
As
Integer
,
attributes
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Public
Overrides
Function
InsertAttributes
(
declaration
As
SyntaxNode
,
index
As
Integer
,
attributes
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Return
Isolate
(
declaration
,
Function
(
d
)
InsertAttributesInternal
(
d
,
index
,
MyBase
.
ClearTrivia
(
attributes
)
))
Return
Isolate
(
declaration
,
Function
(
d
)
InsertAttributesInternal
(
d
,
index
,
attributes
))
End
Function
End
Function
Private
Function
InsertAttributesInternal
(
declaration
As
SyntaxNode
,
index
As
Integer
,
attributes
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Private
Function
InsertAttributesInternal
(
declaration
As
SyntaxNode
,
index
As
Integer
,
attributes
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Dim
newAttributes
=
AsAttributeLists
(
MyBase
.
ClearTrivia
(
attributes
)
)
Dim
newAttributes
=
AsAttributeLists
(
attributes
)
Dim
existingAttributes
=
Me
.
GetAttributes
(
declaration
)
Dim
existingAttributes
=
Me
.
GetAttributes
(
declaration
)
If
index
>=
0
AndAlso
index
<
existingAttributes
.
Count
Then
If
index
>=
0
AndAlso
index
<
existingAttributes
.
Count
Then
...
@@ -1386,7 +1342,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -1386,7 +1342,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Private
Function
InsertReturnAttributesInternal
(
declaration
As
SyntaxNode
,
index
As
Integer
,
attributes
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Private
Function
InsertReturnAttributesInternal
(
declaration
As
SyntaxNode
,
index
As
Integer
,
attributes
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Dim
newAttributes
=
AsAttributeLists
(
MyBase
.
ClearTrivia
(
attributes
)
)
Dim
newAttributes
=
AsAttributeLists
(
attributes
)
Dim
existingReturnAttributes
=
Me
.
GetReturnAttributes
(
declaration
)
Dim
existingReturnAttributes
=
Me
.
GetReturnAttributes
(
declaration
)
If
index
>=
0
AndAlso
index
<
existingReturnAttributes
.
Count
Then
If
index
>=
0
AndAlso
index
<
existingReturnAttributes
.
Count
Then
...
@@ -2723,7 +2679,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -2723,7 +2679,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Public
Overrides
Function
InsertParameters
(
declaration
As
SyntaxNode
,
index
As
Integer
,
parameters
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Public
Overrides
Function
InsertParameters
(
declaration
As
SyntaxNode
,
index
As
Integer
,
parameters
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Dim
currentList
=
GetParameterList
(
declaration
)
Dim
currentList
=
GetParameterList
(
declaration
)
Dim
newList
=
GetParameterList
(
MyBase
.
ClearTrivia
(
parameters
)
)
Dim
newList
=
GetParameterList
(
parameters
)
If
currentList
IsNot
Nothing
Then
If
currentList
IsNot
Nothing
Then
Return
WithParameterList
(
declaration
,
currentList
.
WithParameters
(
currentList
.
Parameters
.
InsertRange
(
index
,
newList
.
Parameters
)))
Return
WithParameterList
(
declaration
,
currentList
.
WithParameters
(
currentList
.
Parameters
.
InsertRange
(
index
,
newList
.
Parameters
)))
Else
Else
...
@@ -2843,7 +2799,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -2843,7 +2799,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Public
Overrides
Function
WithExpression
(
declaration
As
SyntaxNode
,
expression
As
SyntaxNode
)
As
SyntaxNode
Public
Overrides
Function
WithExpression
(
declaration
As
SyntaxNode
,
expression
As
SyntaxNode
)
As
SyntaxNode
Return
Isolate
(
declaration
,
Function
(
d
)
WithExpressionInternal
(
d
,
ClearTrivia
(
expression
)
))
Return
Isolate
(
declaration
,
Function
(
d
)
WithExpressionInternal
(
d
,
expression
))
End
Function
End
Function
Private
Function
WithExpressionInternal
(
declaration
As
SyntaxNode
,
expression
As
SyntaxNode
)
As
SyntaxNode
Private
Function
WithExpressionInternal
(
declaration
As
SyntaxNode
,
expression
As
SyntaxNode
)
As
SyntaxNode
...
@@ -2941,7 +2897,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -2941,7 +2897,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Private
Function
InsertNamespaceImportsInternal
(
declaration
As
SyntaxNode
,
index
As
Integer
,
[
imports
]
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Private
Function
InsertNamespaceImportsInternal
(
declaration
As
SyntaxNode
,
index
As
Integer
,
[
imports
]
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Dim
newImports
=
AsImports
(
MyBase
.
ClearTrivia
(
[
imports
]
)
)
Dim
newImports
=
AsImports
(
[
imports
]
)
Dim
existingImports
=
Me
.
GetNamespaceImports
(
declaration
)
Dim
existingImports
=
Me
.
GetNamespaceImports
(
declaration
)
If
index
>=
0
AndAlso
index
<
existingImports
.
Count
Then
If
index
>=
0
AndAlso
index
<
existingImports
.
Count
Then
...
@@ -3007,7 +2963,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -3007,7 +2963,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End
Function
End
Function
Private
Function
InsertMembersInternal
(
declaration
As
SyntaxNode
,
index
As
Integer
,
members
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Private
Function
InsertMembersInternal
(
declaration
As
SyntaxNode
,
index
As
Integer
,
members
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Dim
newMembers
=
Me
.
AsMembersOf
(
declaration
,
MyBase
.
ClearTrivia
(
members
)
)
Dim
newMembers
=
Me
.
AsMembersOf
(
declaration
,
members
)
Dim
existingMembers
=
Me
.
GetMembers
(
declaration
)
Dim
existingMembers
=
Me
.
GetMembers
(
declaration
)
If
index
>=
0
AndAlso
index
<
existingMembers
.
Count
Then
If
index
>=
0
AndAlso
index
<
existingMembers
.
Count
Then
...
@@ -3109,7 +3065,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -3109,7 +3065,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Public
Overrides
Function
InsertAccessors
(
declaration
As
SyntaxNode
,
index
As
Integer
,
accessors
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Public
Overrides
Function
InsertAccessors
(
declaration
As
SyntaxNode
,
index
As
Integer
,
accessors
As
IEnumerable
(
Of
SyntaxNode
))
As
SyntaxNode
Dim
currentList
=
GetAccessorList
(
declaration
)
Dim
currentList
=
GetAccessorList
(
declaration
)
Dim
newList
=
AsAccessorList
(
MyBase
.
ClearTrivia
(
accessors
)
,
declaration
.
Kind
)
Dim
newList
=
AsAccessorList
(
accessors
,
declaration
.
Kind
)
If
Not
currentList
.
IsEmpty
Then
If
Not
currentList
.
IsEmpty
Then
Return
WithAccessorList
(
declaration
,
currentList
.
InsertRange
(
index
,
newList
))
Return
WithAccessorList
(
declaration
,
currentList
.
InsertRange
(
index
,
newList
))
...
@@ -3205,7 +3161,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
...
@@ -3205,7 +3161,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
accessor
=
DirectCast
(
Me
.
WithStatements
(
accessor
,
statements
),
AccessorBlockSyntax
)
accessor
=
DirectCast
(
Me
.
WithStatements
(
accessor
,
statements
),
AccessorBlockSyntax
)
Return
Me
.
WithAccessorBlock
(
declaration
,
kind
,
accessor
)
Return
Me
.
WithAccessorBlock
(
declaration
,
kind
,
accessor
)
ElseIf
Me
.
CanHaveAccessors
(
declaration
.
Kind
)
ElseIf
Me
.
CanHaveAccessors
(
declaration
.
Kind
)
accessor
=
Me
.
AccessorBlock
(
kind
,
statements
,
Me
.
GetType
(
declaration
))
accessor
=
Me
.
AccessorBlock
(
kind
,
statements
,
Me
.
ClearTrivia
(
Me
.
GetType
(
declaration
)
))
Return
Me
.
WithAccessorBlock
(
declaration
,
kind
,
accessor
)
Return
Me
.
WithAccessorBlock
(
declaration
,
kind
,
accessor
)
Else
Else
Return
declaration
Return
declaration
...
...
src/Workspaces/VisualBasicTest/CodeGeneration/SyntaxGeneratorTests.vb
浏览文件 @
89dca7a9
...
@@ -1754,15 +1754,6 @@ End Class ' end</x>.Value)
...
@@ -1754,15 +1754,6 @@ End Class ' end</x>.Value)
<
x
>
' comment
<
x
>
' comment
&
lt
;
a>
;
</
x
>
.
Value
)
&
lt
;
a>
;
</
x
>
.
Value
)
' added attributes are stripped of trivia
Dim
added2
=
_g
.
AddAttributes
(
cls
,
attrWithComment
)
VerifySyntax
(
Of
ClassBlockSyntax
)(
added2
,
<
x
>
' comment
&
lt
;
a>
;
Class
C
End
Class
' end</x>.Value)
End
Sub
End
Sub
<
Fact
>
<
Fact
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录