@@ -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 , ConditionalType , DefaultType , Delete , Export , ExpressionStatement , TrailingTokenStatement , ExpressionWithTypeArguments , FunctionType , InferType , ImportType , JsImport , JsImportSpecifier , JsBinary , LiteralType , MappedType , ObjectBindingDeclarations , PropertyAssignment , SatisfiesExpression , ScopedVariableDeclarations , StatementExpression , TaggedTemplateExpression , TemplateExpression , Tuple , TypeDeclaration , TypeOf , TypeQuery , TypeOperator , TypePredicate , Unary , Union , Intersection , Void , Yield , TypeInfo , JSVariableDeclarations , JSMethodDeclaration , JSForOfLoop , JSForInLoop , JSForInOfLoopControl , NamespaceDeclaration , FunctionDeclaration , TypeLiteral , IndexSignatureDeclaration , ArrayBindingPattern , BindingElement , ExportDeclaration , ExportAssignment , NamedExports , ExportSpecifier , IndexedAccessType , JsAssignmentOperation , TypeTreeExpression } from '../tree' ;
5+ import { JS , JsLeftPadded , JsRightPadded , JsContainer , JsSpace , CompilationUnit , Alias , ArrowFunction , Await , ConditionalType , DefaultType , Delete , Export , ExpressionStatement , TrailingTokenStatement , ExpressionWithTypeArguments , FunctionType , InferType , ImportType , JsImport , JsImportSpecifier , JsBinary , LiteralType , MappedType , ObjectBindingDeclarations , PropertyAssignment , SatisfiesExpression , ScopedVariableDeclarations , StatementExpression , WithStatement , TaggedTemplateExpression , TemplateExpression , Tuple , TypeDeclaration , TypeOf , TypeQuery , TypeOperator , TypePredicate , Unary , Union , Intersection , Void , Yield , TypeInfo , JSVariableDeclarations , JSMethodDeclaration , JSForOfLoop , JSForInLoop , JSForInOfLoopControl , JSTry , NamespaceDeclaration , FunctionDeclaration , TypeLiteral , IndexSignatureDeclaration , ArrayBindingPattern , BindingElement , ExportDeclaration , ExportAssignment , NamedExports , ExportSpecifier , IndexedAccessType , JsAssignmentOperation , TypeTreeExpression } from '../tree' ;
66import { Expression , J , JContainer , JLeftPadded , JRightPadded , NameTree , Space , Statement , TypeTree , TypedTree } from "../../java" ;
77import * as Java from "../../java/tree" ;
88
@@ -298,6 +298,15 @@ class Visitor extends JavaScriptVisitor<ReceiverContext> {
298298 return statementExpression ;
299299 }
300300
301+ public visitWithStatement ( withStatement : WithStatement , ctx : ReceiverContext ) : J {
302+ withStatement = withStatement . withId ( ctx . receiveValue ( withStatement . id , ValueType . UUID ) ! ) ;
303+ withStatement = withStatement . withPrefix ( ctx . receiveNode ( withStatement . prefix , receiveSpace ) ! ) ;
304+ withStatement = withStatement . withMarkers ( ctx . receiveNode ( withStatement . markers , ctx . receiveMarkers ) ! ) ;
305+ withStatement = withStatement . withExpression ( ctx . receiveNode ( withStatement . expression , ctx . receiveTree ) ! ) ;
306+ withStatement = withStatement . padding . withBody ( ctx . receiveNode ( withStatement . padding . body , receiveRightPaddedTree ) ! ) ;
307+ return withStatement ;
308+ }
309+
301310 public visitTaggedTemplateExpression ( taggedTemplateExpression : TaggedTemplateExpression , ctx : ReceiverContext ) : J {
302311 taggedTemplateExpression = taggedTemplateExpression . withId ( ctx . receiveValue ( taggedTemplateExpression . id , ValueType . UUID ) ! ) ;
303312 taggedTemplateExpression = taggedTemplateExpression . withPrefix ( ctx . receiveNode ( taggedTemplateExpression . prefix , receiveSpace ) ! ) ;
@@ -510,6 +519,25 @@ class Visitor extends JavaScriptVisitor<ReceiverContext> {
510519 return jSForInOfLoopControl ;
511520 }
512521
522+ public visitJSTry ( jSTry : JSTry , ctx : ReceiverContext ) : J {
523+ jSTry = jSTry . withId ( ctx . receiveValue ( jSTry . id , ValueType . UUID ) ! ) ;
524+ jSTry = jSTry . withPrefix ( ctx . receiveNode ( jSTry . prefix , receiveSpace ) ! ) ;
525+ jSTry = jSTry . withMarkers ( ctx . receiveNode ( jSTry . markers , ctx . receiveMarkers ) ! ) ;
526+ jSTry = jSTry . withBody ( ctx . receiveNode ( jSTry . body , ctx . receiveTree ) ! ) ;
527+ jSTry = jSTry . withCatches ( ctx . receiveNode ( jSTry . catches , ctx . receiveTree ) ! ) ;
528+ jSTry = jSTry . padding . withFinallie ( ctx . receiveNode ( jSTry . padding . finallie , receiveLeftPaddedTree ) ) ;
529+ return jSTry ;
530+ }
531+
532+ public visitJSTryJSCatch ( jSCatch : JSTry . JSCatch , ctx : ReceiverContext ) : J {
533+ jSCatch = jSCatch . withId ( ctx . receiveValue ( jSCatch . id , ValueType . UUID ) ! ) ;
534+ jSCatch = jSCatch . withPrefix ( ctx . receiveNode ( jSCatch . prefix , receiveSpace ) ! ) ;
535+ jSCatch = jSCatch . withMarkers ( ctx . receiveNode ( jSCatch . markers , ctx . receiveMarkers ) ! ) ;
536+ jSCatch = jSCatch . withParameter ( ctx . receiveNode ( jSCatch . parameter , ctx . receiveTree ) ! ) ;
537+ jSCatch = jSCatch . withBody ( ctx . receiveNode ( jSCatch . body , ctx . receiveTree ) ! ) ;
538+ return jSCatch ;
539+ }
540+
513541 public visitNamespaceDeclaration ( namespaceDeclaration : NamespaceDeclaration , ctx : ReceiverContext ) : J {
514542 namespaceDeclaration = namespaceDeclaration . withId ( ctx . receiveValue ( namespaceDeclaration . id , ValueType . UUID ) ! ) ;
515543 namespaceDeclaration = namespaceDeclaration . withPrefix ( ctx . receiveNode ( namespaceDeclaration . prefix , receiveSpace ) ! ) ;
@@ -1629,6 +1657,16 @@ class Factory implements ReceiverFactory {
16291657 ) ;
16301658 }
16311659
1660+ if ( type === "org.openrewrite.javascript.tree.JS$WithStatement" ) {
1661+ return new WithStatement (
1662+ ctx . receiveValue ( null , ValueType . UUID ) ! ,
1663+ ctx . receiveNode ( null , receiveSpace ) ! ,
1664+ ctx . receiveNode ( null , ctx . receiveMarkers ) ! ,
1665+ ctx . receiveNode < Java . ControlParentheses < Expression > > ( null , ctx . receiveTree ) ! ,
1666+ ctx . receiveNode < JRightPadded < Statement > > ( null , receiveRightPaddedTree ) !
1667+ ) ;
1668+ }
1669+
16321670 if ( type === "org.openrewrite.javascript.tree.JS$TaggedTemplateExpression" ) {
16331671 return new TaggedTemplateExpression (
16341672 ctx . receiveValue ( null , ValueType . UUID ) ! ,
@@ -1862,6 +1900,27 @@ class Factory implements ReceiverFactory {
18621900 ) ;
18631901 }
18641902
1903+ if ( type === "org.openrewrite.javascript.tree.JS$JSTry" ) {
1904+ return new JSTry (
1905+ ctx . receiveValue ( null , ValueType . UUID ) ! ,
1906+ ctx . receiveNode ( null , receiveSpace ) ! ,
1907+ ctx . receiveNode ( null , ctx . receiveMarkers ) ! ,
1908+ ctx . receiveNode < Java . Block > ( null , ctx . receiveTree ) ! ,
1909+ ctx . receiveNode < JSTry . JSCatch > ( null , ctx . receiveTree ) ! ,
1910+ ctx . receiveNode < JLeftPadded < Java . Block > > ( null , receiveLeftPaddedTree )
1911+ ) ;
1912+ }
1913+
1914+ if ( type === "org.openrewrite.javascript.tree.JS$JSTry$JSCatch" ) {
1915+ return new JSTry . JSCatch (
1916+ ctx . receiveValue ( null , ValueType . UUID ) ! ,
1917+ ctx . receiveNode ( null , receiveSpace ) ! ,
1918+ ctx . receiveNode ( null , ctx . receiveMarkers ) ! ,
1919+ ctx . receiveNode < Java . ControlParentheses < JSVariableDeclarations > > ( null , ctx . receiveTree ) ! ,
1920+ ctx . receiveNode < Java . Block > ( null , ctx . receiveTree ) !
1921+ ) ;
1922+ }
1923+
18651924 if ( type === "org.openrewrite.javascript.tree.JS$NamespaceDeclaration" ) {
18661925 return new NamespaceDeclaration (
18671926 ctx . receiveValue ( null , ValueType . UUID ) ! ,
0 commit comments