@@ -2,7 +2,7 @@ import * as extensions from "./remote_extensions";
22import { Checksum , Cursor , FileAttributes , ListUtils , Tree } from '../../core' ;
33import { DetailsReceiver , Receiver , ReceiverContext , ReceiverFactory , ValueType } from '@openrewrite/rewrite-remote' ;
44import { JavaScriptVisitor } from '..' ;
5- import { JS , JsLeftPadded , JsRightPadded , JsContainer , JsSpace , CompilationUnit , Alias , ArrowFunction , Await , DefaultType , Delete , Export , ExpressionStatement , FunctionType , JsImport , JsImportSpecifier , JsBinary , ObjectBindingDeclarations , PropertyAssignment , ScopedVariableDeclarations , StatementExpression , TemplateExpression , Tuple , TypeDeclaration , TypeOf , TypeQuery , TypeOperator , Unary , Union , Intersection , Void , Yield , TypeInfo , JSVariableDeclarations , JSMethodDeclaration , JSForOfLoop , JSForInLoop , JSForInOfLoopControl , NamespaceDeclaration , FunctionDeclaration , TypeLiteral , IndexSignatureDeclaration , ArrayBindingPattern , BindingElement } from '../tree' ;
5+ import { JS , JsLeftPadded , JsRightPadded , JsContainer , JsSpace , CompilationUnit , Alias , ArrowFunction , Await , ConditionalType , DefaultType , Delete , Export , ExpressionStatement , ExpressionWithTypeArguments , FunctionType , JsImport , JsImportSpecifier , JsBinary , ObjectBindingDeclarations , PropertyAssignment , ScopedVariableDeclarations , StatementExpression , TaggedTemplateExpression , TemplateExpression , Tuple , TypeDeclaration , TypeOf , TypeQuery , TypeOperator , Unary , Union , Intersection , Void , Yield , TypeInfo , JSVariableDeclarations , JSMethodDeclaration , JSForOfLoop , JSForInLoop , JSForInOfLoopControl , NamespaceDeclaration , FunctionDeclaration , TypeLiteral , IndexSignatureDeclaration , ArrayBindingPattern , BindingElement } from '../tree' ;
66import { Expression , J , JContainer , JLeftPadded , JRightPadded , NameTree , Space , Statement , TypeTree , TypedTree } from "../../java" ;
77import * as Java from "../../java/tree" ;
88
@@ -75,6 +75,16 @@ class Visitor extends JavaScriptVisitor<ReceiverContext> {
7575 return await ;
7676 }
7777
78+ public visitConditionalType ( conditionalType : ConditionalType , ctx : ReceiverContext ) : J {
79+ conditionalType = conditionalType . withId ( ctx . receiveValue ( conditionalType . id , ValueType . UUID ) ! ) ;
80+ conditionalType = conditionalType . withPrefix ( ctx . receiveNode ( conditionalType . prefix , receiveSpace ) ! ) ;
81+ conditionalType = conditionalType . withMarkers ( ctx . receiveNode ( conditionalType . markers , ctx . receiveMarkers ) ! ) ;
82+ conditionalType = conditionalType . withCheckType ( ctx . receiveNode ( conditionalType . checkType , ctx . receiveTree ) ! ) ;
83+ conditionalType = conditionalType . padding . withCondition ( ctx . receiveNode ( conditionalType . padding . condition , receiveContainer ) ! ) ;
84+ conditionalType = conditionalType . withType ( ctx . receiveValue ( conditionalType . type , ValueType . Object ) ) ;
85+ return conditionalType ;
86+ }
87+
7888 public visitDefaultType ( defaultType : DefaultType , ctx : ReceiverContext ) : J {
7989 defaultType = defaultType . withId ( ctx . receiveValue ( defaultType . id , ValueType . UUID ) ! ) ;
8090 defaultType = defaultType . withPrefix ( ctx . receiveNode ( defaultType . prefix , receiveSpace ) ! ) ;
@@ -112,6 +122,16 @@ class Visitor extends JavaScriptVisitor<ReceiverContext> {
112122 return expressionStatement ;
113123 }
114124
125+ public visitExpressionWithTypeArguments ( expressionWithTypeArguments : ExpressionWithTypeArguments , ctx : ReceiverContext ) : J {
126+ expressionWithTypeArguments = expressionWithTypeArguments . withId ( ctx . receiveValue ( expressionWithTypeArguments . id , ValueType . UUID ) ! ) ;
127+ expressionWithTypeArguments = expressionWithTypeArguments . withPrefix ( ctx . receiveNode ( expressionWithTypeArguments . prefix , receiveSpace ) ! ) ;
128+ expressionWithTypeArguments = expressionWithTypeArguments . withMarkers ( ctx . receiveNode ( expressionWithTypeArguments . markers , ctx . receiveMarkers ) ! ) ;
129+ expressionWithTypeArguments = expressionWithTypeArguments . withClazz ( ctx . receiveNode ( expressionWithTypeArguments . clazz , ctx . receiveTree ) ! ) ;
130+ expressionWithTypeArguments = expressionWithTypeArguments . padding . withTypeArguments ( ctx . receiveNode ( expressionWithTypeArguments . padding . typeArguments , receiveContainer ) ) ;
131+ expressionWithTypeArguments = expressionWithTypeArguments . withType ( ctx . receiveValue ( expressionWithTypeArguments . type , ValueType . Object ) ) ;
132+ return expressionWithTypeArguments ;
133+ }
134+
115135 public visitFunctionType ( functionType : FunctionType , ctx : ReceiverContext ) : J {
116136 functionType = functionType . withId ( ctx . receiveValue ( functionType . id , ValueType . UUID ) ! ) ;
117137 functionType = functionType . withPrefix ( ctx . receiveNode ( functionType . prefix , receiveSpace ) ! ) ;
@@ -195,25 +215,34 @@ class Visitor extends JavaScriptVisitor<ReceiverContext> {
195215 return statementExpression ;
196216 }
197217
218+ public visitTaggedTemplateExpression ( taggedTemplateExpression : TaggedTemplateExpression , ctx : ReceiverContext ) : J {
219+ taggedTemplateExpression = taggedTemplateExpression . withId ( ctx . receiveValue ( taggedTemplateExpression . id , ValueType . UUID ) ! ) ;
220+ taggedTemplateExpression = taggedTemplateExpression . withPrefix ( ctx . receiveNode ( taggedTemplateExpression . prefix , receiveSpace ) ! ) ;
221+ taggedTemplateExpression = taggedTemplateExpression . withMarkers ( ctx . receiveNode ( taggedTemplateExpression . markers , ctx . receiveMarkers ) ! ) ;
222+ taggedTemplateExpression = taggedTemplateExpression . padding . withTag ( ctx . receiveNode ( taggedTemplateExpression . padding . tag , receiveRightPaddedTree ) ) ;
223+ taggedTemplateExpression = taggedTemplateExpression . padding . withTypeArguments ( ctx . receiveNode ( taggedTemplateExpression . padding . typeArguments , receiveContainer ) ) ;
224+ taggedTemplateExpression = taggedTemplateExpression . withTemplateExpression ( ctx . receiveNode ( taggedTemplateExpression . templateExpression , ctx . receiveTree ) ! ) ;
225+ taggedTemplateExpression = taggedTemplateExpression . withType ( ctx . receiveValue ( taggedTemplateExpression . type , ValueType . Object ) ) ;
226+ return taggedTemplateExpression ;
227+ }
228+
198229 public visitTemplateExpression ( templateExpression : TemplateExpression , ctx : ReceiverContext ) : J {
199230 templateExpression = templateExpression . withId ( ctx . receiveValue ( templateExpression . id , ValueType . UUID ) ! ) ;
200231 templateExpression = templateExpression . withPrefix ( ctx . receiveNode ( templateExpression . prefix , receiveSpace ) ! ) ;
201232 templateExpression = templateExpression . withMarkers ( ctx . receiveNode ( templateExpression . markers , ctx . receiveMarkers ) ! ) ;
202- templateExpression = templateExpression . withDelimiter ( ctx . receiveValue ( templateExpression . delimiter , ValueType . Primitive ) ! ) ;
203- templateExpression = templateExpression . padding . withTag ( ctx . receiveNode ( templateExpression . padding . tag , receiveRightPaddedTree ) ) ;
204- templateExpression = templateExpression . withStrings ( ctx . receiveNodes ( templateExpression . strings , ctx . receiveTree ) ! ) ;
233+ templateExpression = templateExpression . withHead ( ctx . receiveNode ( templateExpression . head , ctx . receiveTree ) ! ) ;
234+ templateExpression = templateExpression . padding . withTemplateSpans ( ctx . receiveNodes ( templateExpression . padding . templateSpans , receiveRightPaddedTree ) ! ) ;
205235 templateExpression = templateExpression . withType ( ctx . receiveValue ( templateExpression . type , ValueType . Object ) ) ;
206236 return templateExpression ;
207237 }
208238
209- public visitTemplateExpressionValue ( value : TemplateExpression . Value , ctx : ReceiverContext ) : J {
210- value = value . withId ( ctx . receiveValue ( value . id , ValueType . UUID ) ! ) ;
211- value = value . withPrefix ( ctx . receiveNode ( value . prefix , receiveSpace ) ! ) ;
212- value = value . withMarkers ( ctx . receiveNode ( value . markers , ctx . receiveMarkers ) ! ) ;
213- value = value . withTree ( ctx . receiveNode ( value . tree , ctx . receiveTree ) ! ) ;
214- value = value . withAfter ( ctx . receiveNode ( value . after , receiveSpace ) ! ) ;
215- value = value . withEnclosedInBraces ( ctx . receiveValue ( value . enclosedInBraces , ValueType . Primitive ) ! ) ;
216- return value ;
239+ public visitTemplateExpressionTemplateSpan ( templateSpan : TemplateExpression . TemplateSpan , ctx : ReceiverContext ) : J {
240+ templateSpan = templateSpan . withId ( ctx . receiveValue ( templateSpan . id , ValueType . UUID ) ! ) ;
241+ templateSpan = templateSpan . withPrefix ( ctx . receiveNode ( templateSpan . prefix , receiveSpace ) ! ) ;
242+ templateSpan = templateSpan . withMarkers ( ctx . receiveNode ( templateSpan . markers , ctx . receiveMarkers ) ! ) ;
243+ templateSpan = templateSpan . withExpression ( ctx . receiveNode ( templateSpan . expression , ctx . receiveTree ) ! ) ;
244+ templateSpan = templateSpan . withTail ( ctx . receiveNode ( templateSpan . tail , ctx . receiveTree ) ! ) ;
245+ return templateSpan ;
217246 }
218247
219248 public visitTuple ( tuple : Tuple , ctx : ReceiverContext ) : J {
@@ -1173,6 +1202,17 @@ class Factory implements ReceiverFactory {
11731202 ) ;
11741203 }
11751204
1205+ if ( type === "org.openrewrite.javascript.tree.JS$ConditionalType" ) {
1206+ return new ConditionalType (
1207+ ctx . receiveValue ( null , ValueType . UUID ) ! ,
1208+ ctx . receiveNode ( null , receiveSpace ) ! ,
1209+ ctx . receiveNode ( null , ctx . receiveMarkers ) ! ,
1210+ ctx . receiveNode < Expression > ( null , ctx . receiveTree ) ! ,
1211+ ctx . receiveNode < JContainer < TypedTree > > ( null , receiveContainer ) ! ,
1212+ ctx . receiveValue ( null , ValueType . Object )
1213+ ) ;
1214+ }
1215+
11761216 if ( type === "org.openrewrite.javascript.tree.JS$DefaultType" ) {
11771217 return new DefaultType (
11781218 ctx . receiveValue ( null , ValueType . UUID ) ! ,
@@ -1214,6 +1254,17 @@ class Factory implements ReceiverFactory {
12141254 ) ;
12151255 }
12161256
1257+ if ( type === "org.openrewrite.javascript.tree.JS$ExpressionWithTypeArguments" ) {
1258+ return new ExpressionWithTypeArguments (
1259+ ctx . receiveValue ( null , ValueType . UUID ) ! ,
1260+ ctx . receiveNode ( null , receiveSpace ) ! ,
1261+ ctx . receiveNode ( null , ctx . receiveMarkers ) ! ,
1262+ ctx . receiveNode < NameTree > ( null , ctx . receiveTree ) ! ,
1263+ ctx . receiveNode < JContainer < Expression > > ( null , receiveContainer ) ,
1264+ ctx . receiveValue ( null , ValueType . Object )
1265+ ) ;
1266+ }
1267+
12171268 if ( type === "org.openrewrite.javascript.tree.JS$FunctionType" ) {
12181269 return new FunctionType (
12191270 ctx . receiveValue ( null , ValueType . UUID ) ! ,
@@ -1305,26 +1356,36 @@ class Factory implements ReceiverFactory {
13051356 ) ;
13061357 }
13071358
1359+ if ( type === "org.openrewrite.javascript.tree.JS$TaggedTemplateExpression" ) {
1360+ return new TaggedTemplateExpression (
1361+ ctx . receiveValue ( null , ValueType . UUID ) ! ,
1362+ ctx . receiveNode ( null , receiveSpace ) ! ,
1363+ ctx . receiveNode ( null , ctx . receiveMarkers ) ! ,
1364+ ctx . receiveNode < JRightPadded < Expression > > ( null , receiveRightPaddedTree ) ,
1365+ ctx . receiveNode < JContainer < Expression > > ( null , receiveContainer ) ,
1366+ ctx . receiveNode < TemplateExpression > ( null , ctx . receiveTree ) ! ,
1367+ ctx . receiveValue ( null , ValueType . Object )
1368+ ) ;
1369+ }
1370+
13081371 if ( type === "org.openrewrite.javascript.tree.JS$TemplateExpression" ) {
13091372 return new TemplateExpression (
13101373 ctx . receiveValue ( null , ValueType . UUID ) ! ,
13111374 ctx . receiveNode ( null , receiveSpace ) ! ,
13121375 ctx . receiveNode ( null , ctx . receiveMarkers ) ! ,
1313- ctx . receiveValue ( null , ValueType . Primitive ) ! ,
1314- ctx . receiveNode < JRightPadded < Expression > > ( null , receiveRightPaddedTree ) ,
1315- ctx . receiveNodes < J > ( null , ctx . receiveTree ) ! ,
1376+ ctx . receiveNode < Java . Literal > ( null , ctx . receiveTree ) ! ,
1377+ ctx . receiveNodes ( null , receiveRightPaddedTree ) ! ,
13161378 ctx . receiveValue ( null , ValueType . Object )
13171379 ) ;
13181380 }
13191381
1320- if ( type === "org.openrewrite.javascript.tree.JS$TemplateExpression$Value " ) {
1321- return new TemplateExpression . Value (
1382+ if ( type === "org.openrewrite.javascript.tree.JS$TemplateExpression$TemplateSpan " ) {
1383+ return new TemplateExpression . TemplateSpan (
13221384 ctx . receiveValue ( null , ValueType . UUID ) ! ,
13231385 ctx . receiveNode ( null , receiveSpace ) ! ,
13241386 ctx . receiveNode ( null , ctx . receiveMarkers ) ! ,
13251387 ctx . receiveNode < J > ( null , ctx . receiveTree ) ! ,
1326- ctx . receiveNode ( null , receiveSpace ) ! ,
1327- ctx . receiveValue ( null , ValueType . Primitive ) !
1388+ ctx . receiveNode < Java . Literal > ( null , ctx . receiveTree ) !
13281389 ) ;
13291390 }
13301391
0 commit comments