Skip to content

Commit 9810c56

Browse files
This can obviously have dots in, so is a name, and it turns out we don't need to parse it
1 parent 825cc5e commit 9810c56

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

CodeConverter/CSharp/DeclarationNodeVisitor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public override async Task<CSharpSyntaxNode> VisitCompilationUnit(VBSyntax.Compi
9595

9696
var convertedMembers = string.IsNullOrEmpty(options.RootNamespace)
9797
? sourceAndConverted.Select(sd => sd.Converted)
98-
: PrependRootNamespace(sourceAndConverted, ValidSyntaxFactory.IdentifierName(options.RootNamespace));
98+
: PrependRootNamespace(sourceAndConverted, options.RootNamespace);
9999

100100
var usings = await importsClauses
101101
.SelectAsync(async c => await c.AcceptAsync<UsingDirectiveSyntax>(TriviaConvertingDeclarationVisitor));
@@ -126,13 +126,13 @@ private static bool HasSourceMapAnnotations(UsingDirectiveSyntax c)
126126

127127
private IReadOnlyCollection<MemberDeclarationSyntax> PrependRootNamespace(
128128
IReadOnlyCollection<(VBSyntax.StatementSyntax VbNode, MemberDeclarationSyntax CsNode)> membersConversions,
129-
IdentifierNameSyntax rootNamespaceIdentifier)
129+
string rootNamespace)
130130
{
131131

132132
if (_topAncestorNamespace != null) {
133-
var csMembers = membersConversions.ToLookup(c => ShouldBeNestedInRootNamespace(c.VbNode, rootNamespaceIdentifier.Identifier.Text), c => c.CsNode);
133+
var csMembers = membersConversions.ToLookup(c => ShouldBeNestedInRootNamespace(c.VbNode, rootNamespace), c => c.CsNode);
134134
var nestedMembers = csMembers[true].Select<MemberDeclarationSyntax, SyntaxNode>(x => x);
135-
var newNamespaceDecl = (MemberDeclarationSyntax) _csSyntaxGenerator.NamespaceDeclaration(rootNamespaceIdentifier.Identifier.Text, nestedMembers);
135+
var newNamespaceDecl = (MemberDeclarationSyntax) _csSyntaxGenerator.NamespaceDeclaration(rootNamespace, nestedMembers);
136136
return csMembers[false].Concat(new[] { newNamespaceDecl }).ToArray();
137137
}
138138
return membersConversions.Select(n => n.CsNode).ToArray();

0 commit comments

Comments
 (0)