Skip to content

Commit bc7e753

Browse files
committed
Small clean up.
1 parent 4cf908d commit bc7e753

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

CSharpToJavaScript/APIs/JS/ParentNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ namespace CSharpToJavaScript.APIs.JS;
44

55
public partial interface ParentNode
66
{
7+
///<include file='CSharpToJavaScript/Utils/Docs/element/element.generated.xml' path='docs/ElementQuerySelector/*'/>
78
[To(ToAttribute.FirstCharToLowerCase)]
8-
///<include file='Utils/Docs/ElementQuerySelector/ElementQuerySelector.generated.xml' path='docs/ElementQuerySelector/*'/>
99
public T? QuerySelector<T>(string selectors) where T : Element { throw new System.NotImplementedException(); }
1010
}
1111

CSharpToJavaScript/CSTOJS.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ public static FileData[] Translate(FileData[] files, MetadataReference[]? refere
8383

8484
StringBuilderWalker _stringBuilderWalker = new();
8585

86-
SyntaxNode newRoot1 = _withSemanticRewriter.Visit(_root);
87-
if (_root != newRoot1)
88-
_root = newRoot1;
86+
_root = _withSemanticRewriter.Visit(_root);
8987

9088
_root = _root.ReplaceNodes(_withSemanticRewriter.ReplaceNodes.Keys, (o, r) =>
9189
{
@@ -95,9 +93,7 @@ public static FileData[] Translate(FileData[] files, MetadataReference[]? refere
9593
if (files[i].OptionsForFile.Debug)
9694
files[i].Debug_WithSemanticRewriter = _root.ToFullString();
9795

98-
SyntaxNode newRoot2 = _withoutSemanticRewriter.Visit(_root);
99-
if (_root != newRoot2)
100-
_root = newRoot2;
96+
_root = _withoutSemanticRewriter.Visit(_root);
10197

10298
if (files[i].OptionsForFile.Debug)
10399
files[i].Debug_WithoutSemanticRewriter = _root.ToFullString();
@@ -108,10 +104,8 @@ public static FileData[] Translate(FileData[] files, MetadataReference[]? refere
108104
if (files[i].OptionsForFile.KeepBraceOnTheSameLine)
109105
{
110106
KeepBraceOnTheSameLineRewriter _keepBraceOnTheSameLineRewriter = new();
111-
112-
SyntaxNode newRoot3 = _keepBraceOnTheSameLineRewriter.Visit(_root);
113-
if (_root != newRoot3)
114-
_root = newRoot3;
107+
108+
_root = _keepBraceOnTheSameLineRewriter.Visit(_root);
115109
}
116110

117111
_stringBuilderWalker.JSSB.Append(files[i].OptionsForFile.AddSBAtTheTop);

CSharpToJavaScript/WithSemanticRewriter.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ public WithSemanticRewriter(SemanticModel semanticModel, CSTOJSOptions options)
3535
return base.Visit(node);
3636
}
3737
#endif
38-
38+
public override SyntaxNode? VisitUsingDirective(UsingDirectiveSyntax node)
39+
{
40+
return node;
41+
}
42+
public override SyntaxNode? VisitExternAliasDirective(ExternAliasDirectiveSyntax node)
43+
{
44+
return node;
45+
}
3946
public override SyntaxNode? VisitClassDeclaration(ClassDeclarationSyntax node)
4047
{
4148
_CurrentClassSymbol = _Model.GetDeclaredSymbol(node);

0 commit comments

Comments
 (0)