未验证 提交 51a1864f 编写于 作者: S Shyam N 提交者: GitHub

Merge pull request #23213 from dotnet/merges/master-to-post-dev15.5-contrib-20171116-080023

Merge master to post-dev15.5-contrib
...@@ -594,7 +594,9 @@ private IObjectOrCollectionInitializerOperation CreateBoundCollectionInitializer ...@@ -594,7 +594,9 @@ private IObjectOrCollectionInitializerOperation CreateBoundCollectionInitializer
private IOperation CreateBoundObjectInitializerMemberOperation(BoundObjectInitializerMember boundObjectInitializerMember) private IOperation CreateBoundObjectInitializerMemberOperation(BoundObjectInitializerMember boundObjectInitializerMember)
{ {
Lazy<IOperation> instance = boundObjectInitializerMember.MemberSymbol.IsStatic ? Symbol memberSymbol = boundObjectInitializerMember.MemberSymbol;
Lazy<IOperation> instance = memberSymbol?.IsStatic == true ?
OperationFactory.NullOperation : OperationFactory.NullOperation :
new Lazy<IOperation>(() => new Lazy<IOperation>(() =>
new InstanceReferenceExpression( new InstanceReferenceExpression(
...@@ -609,17 +611,27 @@ private IOperation CreateBoundObjectInitializerMemberOperation(BoundObjectInitia ...@@ -609,17 +611,27 @@ private IOperation CreateBoundObjectInitializerMemberOperation(BoundObjectInitia
Optional<object> constantValue = ConvertToOptional(boundObjectInitializerMember.ConstantValue); Optional<object> constantValue = ConvertToOptional(boundObjectInitializerMember.ConstantValue);
bool isImplicit = boundObjectInitializerMember.WasCompilerGenerated; bool isImplicit = boundObjectInitializerMember.WasCompilerGenerated;
switch (boundObjectInitializerMember.MemberSymbol.Kind) if ((object)memberSymbol == null)
{
Debug.Assert(boundObjectInitializerMember.Type.IsDynamic());
Lazy<ImmutableArray<IOperation>> arguments = new Lazy<ImmutableArray<IOperation>>(() => boundObjectInitializerMember.Arguments.SelectAsArray(n => Create(n)));
ImmutableArray<string> argumentNames = boundObjectInitializerMember.ArgumentNamesOpt.NullToEmpty();
ImmutableArray<RefKind> argumentRefKinds = boundObjectInitializerMember.ArgumentRefKindsOpt.NullToEmpty();
return new LazyDynamicIndexerAccessExpression(instance, arguments, argumentNames, argumentRefKinds, _semanticModel, syntax, type, constantValue, isImplicit);
}
switch (memberSymbol.Kind)
{ {
case SymbolKind.Field: case SymbolKind.Field:
var field = (FieldSymbol)boundObjectInitializerMember.MemberSymbol; var field = (FieldSymbol)memberSymbol;
bool isDeclaration = false; bool isDeclaration = false;
return new LazyFieldReferenceExpression(field, isDeclaration, instance, _semanticModel, syntax, type, constantValue, isImplicit); return new LazyFieldReferenceExpression(field, isDeclaration, instance, _semanticModel, syntax, type, constantValue, isImplicit);
case SymbolKind.Event: case SymbolKind.Event:
var eventSymbol = (EventSymbol)boundObjectInitializerMember.MemberSymbol; var eventSymbol = (EventSymbol)memberSymbol;
return new LazyEventReferenceExpression(eventSymbol, instance, _semanticModel, syntax, type, constantValue, isImplicit); return new LazyEventReferenceExpression(eventSymbol, instance, _semanticModel, syntax, type, constantValue, isImplicit);
case SymbolKind.Property: case SymbolKind.Property:
var property = (PropertySymbol)boundObjectInitializerMember.MemberSymbol; var property = (PropertySymbol)memberSymbol;
Lazy<ImmutableArray<IArgumentOperation>> arguments; Lazy<ImmutableArray<IArgumentOperation>> arguments;
if (!boundObjectInitializerMember.Arguments.Any()) if (!boundObjectInitializerMember.Arguments.Any())
{ {
......
...@@ -604,5 +604,183 @@ public void M1() ...@@ -604,5 +604,183 @@ public void M1()
VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics); VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
} }
[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
[WorkItem(23154, "https://github.com/dotnet/roslyn/issues/23154")]
public void ObjectCreationWithDynamicMemberInitializer_01()
{
string source = @"
#pragma warning disable 0169
class A
{
dynamic this[int x, int y]
{
get
{
return new A();
}
}
dynamic this[string x, string y]
{
get
{
throw null;
}
}
int X, Y, Z;
static void Main()
{
dynamic x = 1;
new A {/*<bind>*/[y: x, x: x] = { X = 1, Y = 1, Z = 1 }/*</bind>*/ };
}
}
";
string expectedOperationTree = @"
IMemberInitializerOperation (OperationKind.MemberInitializer, Type: dynamic) (Syntax: '[y: x, x: x ... 1, Z = 1 }')
InitializedMember:
IDynamicIndexerAccessOperation (OperationKind.DynamicIndexerAccess, Type: dynamic) (Syntax: '[y: x, x: x]')
Expression:
IInstanceReferenceOperation (OperationKind.InstanceReference, Type: A, IsImplicit) (Syntax: '[y: x, x: x]')
Arguments(2):
ILocalReferenceOperation: x (OperationKind.LocalReference, Type: dynamic) (Syntax: 'x')
ILocalReferenceOperation: x (OperationKind.LocalReference, Type: dynamic) (Syntax: 'x')
ArgumentNames(2):
""y""
""x""
ArgumentRefKinds(0)
Initializer:
IObjectOrCollectionInitializerOperation (OperationKind.ObjectOrCollectionInitializer, Type: dynamic) (Syntax: '{ X = 1, Y = 1, Z = 1 }')
Initializers(3):
ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: dynamic) (Syntax: 'X = 1')
Left:
IOperation: (OperationKind.None, Type: null) (Syntax: 'X')
Right:
ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 1) (Syntax: '1')
ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: dynamic) (Syntax: 'Y = 1')
Left:
IOperation: (OperationKind.None, Type: null) (Syntax: 'Y')
Right:
ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 1) (Syntax: '1')
ISimpleAssignmentOperation (OperationKind.SimpleAssignment, Type: dynamic) (Syntax: 'Z = 1')
Left:
IOperation: (OperationKind.None, Type: null) (Syntax: 'Z')
Right:
ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 1) (Syntax: '1')
";
var expectedDiagnostics = DiagnosticDescription.None;
VerifyOperationTreeAndDiagnosticsForTest<AssignmentExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}
[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
[WorkItem(23154, "https://github.com/dotnet/roslyn/issues/23154")]
public void ObjectCreationWithDynamicMemberInitializer_02()
{
string source = @"
#pragma warning disable 0169
class A
{
dynamic this[int x, int y]
{
get
{
return new A();
}
}
dynamic this[string x, string y]
{
get
{
throw null;
}
}
int X, Y, Z;
static void Main()
{
dynamic x = 1;
new A {/*<bind>*/[y: x, x: x] = { }/*</bind>*/ };
}
}
";
string expectedOperationTree = @"
IMemberInitializerOperation (OperationKind.MemberInitializer, Type: dynamic) (Syntax: '[y: x, x: x] = { }')
InitializedMember:
IDynamicIndexerAccessOperation (OperationKind.DynamicIndexerAccess, Type: dynamic) (Syntax: '[y: x, x: x]')
Expression:
IInstanceReferenceOperation (OperationKind.InstanceReference, Type: A, IsImplicit) (Syntax: '[y: x, x: x]')
Arguments(2):
ILocalReferenceOperation: x (OperationKind.LocalReference, Type: dynamic) (Syntax: 'x')
ILocalReferenceOperation: x (OperationKind.LocalReference, Type: dynamic) (Syntax: 'x')
ArgumentNames(2):
""y""
""x""
ArgumentRefKinds(0)
Initializer:
IObjectOrCollectionInitializerOperation (OperationKind.ObjectOrCollectionInitializer, Type: dynamic) (Syntax: '{ }')
Initializers(0)
";
var expectedDiagnostics = DiagnosticDescription.None;
VerifyOperationTreeAndDiagnosticsForTest<AssignmentExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}
[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
[WorkItem(23154, "https://github.com/dotnet/roslyn/issues/23154")]
public void ObjectCreationWithDynamicMemberInitializer_03()
{
string source = @"
#pragma warning disable 0169
class A
{
dynamic this[int x, int y]
{
get
{
return new A();
}
}
dynamic this[string x, string y]
{
get
{
throw null;
}
}
int X, Y, Z;
static void Main()
{
dynamic x = 1;
new A {/*<bind>*/[y: x, x: x]/*</bind>*/ = { } };
}
}
";
string expectedOperationTree = @"
IDynamicIndexerAccessOperation (OperationKind.DynamicIndexerAccess, Type: dynamic) (Syntax: '[y: x, x: x]')
Expression:
IInstanceReferenceOperation (OperationKind.InstanceReference, Type: A, IsImplicit) (Syntax: '[y: x, x: x]')
Arguments(2):
ILocalReferenceOperation: x (OperationKind.LocalReference, Type: dynamic) (Syntax: 'x')
ILocalReferenceOperation: x (OperationKind.LocalReference, Type: dynamic) (Syntax: 'x')
ArgumentNames(2):
""y""
""x""
ArgumentRefKinds(0)
";
var expectedDiagnostics = DiagnosticDescription.None;
VerifyOperationTreeAndDiagnosticsForTest<ExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}
} }
} }
...@@ -879,6 +879,9 @@ public override SyntaxNode SetName(SyntaxNode node, string name) ...@@ -879,6 +879,9 @@ public override SyntaxNode SetName(SyntaxNode node, string name)
throw new ArgumentNullException(nameof(node)); throw new ArgumentNullException(nameof(node));
} }
// In all cases, the resulting syntax for the new name has elastic trivia attached,
// whether via this call to SyntaxFactory.Identifier or via explicitly added elastic
// markers.
SyntaxToken newIdentifier = SyntaxFactory.Identifier(name); SyntaxToken newIdentifier = SyntaxFactory.Identifier(name);
switch (node.Kind()) switch (node.Kind())
{ {
...@@ -904,13 +907,19 @@ public override SyntaxNode SetName(SyntaxNode node, string name) ...@@ -904,13 +907,19 @@ public override SyntaxNode SetName(SyntaxNode node, string name)
case SyntaxKind.Parameter: case SyntaxKind.Parameter:
return ((ParameterSyntax)node).WithIdentifier(newIdentifier); return ((ParameterSyntax)node).WithIdentifier(newIdentifier);
case SyntaxKind.NamespaceDeclaration: case SyntaxKind.NamespaceDeclaration:
return ((NamespaceDeclarationSyntax)node).WithName(SyntaxFactory.IdentifierName(name)); return ((NamespaceDeclarationSyntax)node).WithName(
SyntaxFactory.ParseName(name)
.WithLeadingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticMarker))
.WithTrailingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticMarker)));
case SyntaxKind.EnumMemberDeclaration: case SyntaxKind.EnumMemberDeclaration:
return ((EnumMemberDeclarationSyntax)node).WithIdentifier(newIdentifier); return ((EnumMemberDeclarationSyntax)node).WithIdentifier(newIdentifier);
case SyntaxKind.VariableDeclarator: case SyntaxKind.VariableDeclarator:
return ((VariableDeclaratorSyntax)node).WithIdentifier(newIdentifier); return ((VariableDeclaratorSyntax)node).WithIdentifier(newIdentifier);
case SyntaxKind.Attribute: case SyntaxKind.Attribute:
return ((AttributeSyntax)node).WithName(SyntaxFactory.IdentifierName(name)); return ((AttributeSyntax)node).WithName(
SyntaxFactory.ParseName(name)
.WithLeadingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticMarker))
.WithTrailingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticMarker)));
case SyntaxKind.AttributeArgument: case SyntaxKind.AttributeArgument:
return ((AttributeArgumentSyntax)node).WithNameEquals(SyntaxFactory.NameEquals(SyntaxFactory.IdentifierName(name))); return ((AttributeArgumentSyntax)node).WithNameEquals(SyntaxFactory.NameEquals(SyntaxFactory.IdentifierName(name)));
default: default:
......
...@@ -41,7 +41,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.CodeModel ...@@ -41,7 +41,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.CodeModel
End Function End Function
Protected Overrides Function GetNameSetter(codeElement As EnvDTE.CodeNamespace) As Action(Of String) Protected Overrides Function GetNameSetter(codeElement As EnvDTE.CodeNamespace) As Action(Of String)
Throw New NotImplementedException() Return Sub(name) codeElement.Name = name
End Function End Function
Protected Overrides Function GetParent(codeElement As EnvDTE.CodeNamespace) As Object Protected Overrides Function GetParent(codeElement As EnvDTE.CodeNamespace) As Object
......
...@@ -861,7 +861,7 @@ class CAttribute : Attribute { } ...@@ -861,7 +861,7 @@ class CAttribute : Attribute { }
#Region "Set Name tests" #Region "Set Name tests"
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)> <ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName1() As Task Public Async Function TestSetName_NewName() As Task
Dim code = Dim code =
<Code> <Code>
[$$Goo] [$$Goo]
...@@ -876,6 +876,40 @@ class C { } ...@@ -876,6 +876,40 @@ class C { }
Await TestSetName(code, expected, "Bar", NoThrow(Of String)()) Await TestSetName(code, expected, "Bar", NoThrow(Of String)())
End Function End Function
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName_SimpleNameToDottedName() As Task
Dim code =
<Code>
[$$Goo]
class C { }
</Code>
Dim expected =
<Code>
[Bar.Baz]
class C { }
</Code>
Await TestSetName(code, expected, "Bar.Baz", NoThrow(Of String)())
End Function
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName_DottedNameToSimpleName() As Task
Dim code =
<Code>
[$$Goo.Bar]
class C { }
</Code>
Dim expected =
<Code>
[Baz]
class C { }
</Code>
Await TestSetName(code, expected, "Baz", NoThrow(Of String)())
End Function
#End Region #End Region
#Region "Set Target tests" #Region "Set Target tests"
......
...@@ -389,6 +389,109 @@ namespace N1 ...@@ -389,6 +389,109 @@ namespace N1
#End Region #End Region
#Region "Set Name tests"
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName_SameName() As Task
Dim code =
<Code><![CDATA[
namespace N$$
{
class C
{
}
}
]]></Code>
Dim expected =
<Code><![CDATA[
namespace N
{
class C
{
}
}
]]></Code>
Await TestSetName(code, expected, "N", NoThrow(Of String)())
End Function
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName_NewName() As Task
Dim code =
<Code><![CDATA[
namespace N$$
{
class C
{
}
}
]]></Code>
Dim expected =
<Code><![CDATA[
namespace N2
{
class C
{
}
}
]]></Code>
Await TestSetName(code, expected, "N2", NoThrow(Of String)())
End Function
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName_SimpleNameToDottedName() As Task
Dim code =
<Code><![CDATA[
namespace N1$$
{
class C
{
}
}
]]></Code>
Dim expected =
<Code><![CDATA[
namespace N2.N3
{
class C
{
}
}
]]></Code>
Await TestSetName(code, expected, "N2.N3", NoThrow(Of String)())
End Function
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName_DottedNameToSimpleName() As Task
Dim code =
<Code><![CDATA[
namespace N1.N2$$
{
class C
{
}
}
]]></Code>
Dim expected =
<Code><![CDATA[
namespace N3.N4
{
class C
{
}
}
]]></Code>
Await TestSetName(code, expected, "N3.N4", NoThrow(Of String)())
End Function
#End Region
#Region "Remove tests" #Region "Remove tests"
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)> <ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
......
...@@ -1065,7 +1065,7 @@ End Class ...@@ -1065,7 +1065,7 @@ End Class
#Region "Set Name tests" #Region "Set Name tests"
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)> <ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName1() As Task Public Async Function TestSetName_NewName() As Task
Dim code = Dim code =
<Code><![CDATA[ <Code><![CDATA[
<$$Goo()> <$$Goo()>
...@@ -1082,6 +1082,44 @@ End Class ...@@ -1082,6 +1082,44 @@ End Class
Await TestSetName(code, expected, "Bar", NoThrow(Of String)()) Await TestSetName(code, expected, "Bar", NoThrow(Of String)())
End Function End Function
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName_SimpleNameToDottedName() As Task
Dim code =
<Code><![CDATA[
<$$Goo()>
Class C
End Class
]]></Code>
Dim expected =
<Code><![CDATA[
<Bar.Baz()>
Class C
End Class
]]></Code>
Await TestSetName(code, expected, "Bar.Baz", NoThrow(Of String)())
End Function
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName_DottedNameToSimpleName() As Task
Dim code =
<Code><![CDATA[
<$$Goo()>
Class C
End Class
]]></Code>
Dim expected =
<Code><![CDATA[
<Bar.Baz()>
Class C
End Class
]]></Code>
Await TestSetName(code, expected, "Bar.Baz", NoThrow(Of String)())
End Function
#End Region #End Region
#Region "Set Target tests" #Region "Set Target tests"
......
...@@ -821,6 +821,94 @@ End Namespace ...@@ -821,6 +821,94 @@ End Namespace
#End Region #End Region
#Region "Set Name tests"
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName_SameName() As Task
Dim code =
<Code>
Namespace N$$
Class C
End Class
End Namespace
</Code>
Dim expected =
<Code>
Namespace N
Class C
End Class
End Namespace
</Code>
Await TestSetName(code, expected, "N", NoThrow(Of String)())
End Function
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName_NewName() As Task
Dim code =
<Code>
Namespace N$$
Class C
End Class
End Namespace
</Code>
Dim expected =
<Code>
Namespace N2
Class C
End Class
End Namespace
</Code>
Await TestSetName(code, expected, "N2", NoThrow(Of String)())
End Function
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName_SimpleNameToDottedName() As Task
Dim code =
<Code>
Namespace N1$$
Class C
End Class
End Namespace
</Code>
Dim expected =
<Code>
Namespace N2.N3
Class C
End Class
End Namespace
</Code>
Await TestSetName(code, expected, "N2.N3", NoThrow(Of String)())
End Function
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
Public Async Function TestSetName_DottedNameToDottedName() As Task
Dim code =
<Code>
Namespace N1.N2$$
Class C
End Class
End Namespace
</Code>
Dim expected =
<Code>
Namespace N3.N4
Class C
End Class
End Namespace
</Code>
Await TestSetName(code, expected, "N3.N4", NoThrow(Of String)())
End Function
#End Region
#Region "Remove tests" #Region "Remove tests"
<ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)> <ConditionalWpfFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
......
...@@ -941,11 +941,17 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel ...@@ -941,11 +941,17 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel
Throw New ArgumentNullException(NameOf(node)) Throw New ArgumentNullException(NameOf(node))
End If End If
' In all cases, the resulting syntax for the new name has elastic trivia attached,
' whether via this call to SyntaxFactory.Identifier or via explicitly added elastic
' markers.
Dim identifier As SyntaxToken = SyntaxFactory.Identifier(name) Dim identifier As SyntaxToken = SyntaxFactory.Identifier(name)
Select Case node.Kind Select Case node.Kind
Case SyntaxKind.Attribute Case SyntaxKind.Attribute
Return DirectCast(node, AttributeSyntax).WithName(SyntaxFactory.ParseTypeName(name)) Return DirectCast(node, AttributeSyntax).WithName(
SyntaxFactory.ParseTypeName(name) _
.WithLeadingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticMarker)) _
.WithTrailingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticMarker)))
Case SyntaxKind.ClassStatement Case SyntaxKind.ClassStatement
Return DirectCast(node, ClassStatementSyntax).WithIdentifier(identifier) Return DirectCast(node, ClassStatementSyntax).WithIdentifier(identifier)
Case SyntaxKind.InterfaceStatement Case SyntaxKind.InterfaceStatement
...@@ -960,7 +966,10 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel ...@@ -960,7 +966,10 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel
SyntaxKind.DelegateSubStatement SyntaxKind.DelegateSubStatement
Return DirectCast(node, DelegateStatementSyntax).WithIdentifier(identifier) Return DirectCast(node, DelegateStatementSyntax).WithIdentifier(identifier)
Case SyntaxKind.NamespaceStatement Case SyntaxKind.NamespaceStatement
Return DirectCast(node, NamespaceStatementSyntax).WithName(SyntaxFactory.ParseName(name)) Return DirectCast(node, NamespaceStatementSyntax).WithName(
SyntaxFactory.ParseName(name) _
.WithLeadingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticMarker)) _
.WithTrailingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticMarker)))
Case SyntaxKind.SubStatement, Case SyntaxKind.SubStatement,
SyntaxKind.FunctionStatement, SyntaxKind.FunctionStatement,
SyntaxKind.SubNewStatement SyntaxKind.SubNewStatement
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册