@openrewrite/rewrite 8.63.0 → 8.63.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/java/index.d.ts +1 -0
- package/dist/java/index.d.ts.map +1 -1
- package/dist/java/index.js +1 -0
- package/dist/java/index.js.map +1 -1
- package/dist/java/rpc.d.ts +2 -0
- package/dist/java/rpc.d.ts.map +1 -1
- package/dist/java/rpc.js +749 -410
- package/dist/java/rpc.js.map +1 -1
- package/dist/java/tree.d.ts +1 -1
- package/dist/java/tree.d.ts.map +1 -1
- package/dist/java/type-visitor.d.ts +48 -0
- package/dist/java/type-visitor.d.ts.map +1 -0
- package/dist/java/type-visitor.js +260 -0
- package/dist/java/type-visitor.js.map +1 -0
- package/dist/java/type.d.ts +2 -0
- package/dist/java/type.d.ts.map +1 -1
- package/dist/java/type.js +0 -317
- package/dist/java/type.js.map +1 -1
- package/dist/java/visitor.d.ts.map +1 -1
- package/dist/java/visitor.js +579 -363
- package/dist/java/visitor.js.map +1 -1
- package/dist/javascript/preconditions.d.ts +1 -1
- package/dist/javascript/preconditions.d.ts.map +1 -1
- package/dist/javascript/preconditions.js +7 -6
- package/dist/javascript/preconditions.js.map +1 -1
- package/dist/javascript/rpc.js +430 -350
- package/dist/javascript/rpc.js.map +1 -1
- package/dist/javascript/tree.d.ts +1 -1
- package/dist/javascript/tree.d.ts.map +1 -1
- package/dist/javascript/type-mapping.d.ts.map +1 -1
- package/dist/javascript/type-mapping.js +7 -0
- package/dist/javascript/type-mapping.js.map +1 -1
- package/dist/javascript/visitor.d.ts.map +1 -1
- package/dist/javascript/visitor.js +504 -309
- package/dist/javascript/visitor.js.map +1 -1
- package/dist/json/visitor.d.ts.map +1 -1
- package/dist/json/visitor.js +46 -21
- package/dist/json/visitor.js.map +1 -1
- package/dist/rpc/queue.d.ts +7 -4
- package/dist/rpc/queue.d.ts.map +1 -1
- package/dist/rpc/queue.js +22 -32
- package/dist/rpc/queue.js.map +1 -1
- package/dist/rpc/request/generate.d.ts.map +1 -1
- package/dist/rpc/request/generate.js +2 -3
- package/dist/rpc/request/generate.js.map +1 -1
- package/dist/rpc/request/get-languages.d.ts.map +1 -1
- package/dist/rpc/request/get-languages.js +4 -3
- package/dist/rpc/request/get-languages.js.map +1 -1
- package/dist/rpc/request/get-object.d.ts +1 -1
- package/dist/rpc/request/get-object.d.ts.map +1 -1
- package/dist/rpc/request/get-object.js +8 -7
- package/dist/rpc/request/get-object.js.map +1 -1
- package/dist/rpc/request/get-recipes.d.ts.map +1 -1
- package/dist/rpc/request/get-recipes.js +2 -2
- package/dist/rpc/request/get-recipes.js.map +1 -1
- package/dist/rpc/request/index.d.ts +1 -0
- package/dist/rpc/request/index.d.ts.map +1 -1
- package/dist/rpc/request/index.js +1 -0
- package/dist/rpc/request/index.js.map +1 -1
- package/dist/rpc/request/install-recipes.d.ts.map +1 -1
- package/dist/rpc/request/install-recipes.js +30 -21
- package/dist/rpc/request/install-recipes.js.map +1 -1
- package/dist/rpc/request/metrics.d.ts +10 -10
- package/dist/rpc/request/metrics.d.ts.map +1 -1
- package/dist/rpc/request/metrics.js +38 -31
- package/dist/rpc/request/metrics.js.map +1 -1
- package/dist/rpc/request/parse.d.ts.map +1 -1
- package/dist/rpc/request/parse.js +10 -12
- package/dist/rpc/request/parse.js.map +1 -1
- package/dist/rpc/request/prepare-recipe.d.ts.map +1 -1
- package/dist/rpc/request/prepare-recipe.js +4 -4
- package/dist/rpc/request/prepare-recipe.js.map +1 -1
- package/dist/rpc/request/print.d.ts +1 -1
- package/dist/rpc/request/print.d.ts.map +1 -1
- package/dist/rpc/request/print.js +10 -6
- package/dist/rpc/request/print.js.map +1 -1
- package/dist/rpc/request/trace-get-object.d.ts +5 -0
- package/dist/rpc/request/trace-get-object.d.ts.map +1 -0
- package/dist/rpc/request/trace-get-object.js +3 -0
- package/dist/rpc/request/trace-get-object.js.map +1 -0
- package/dist/rpc/request/visit.d.ts.map +1 -1
- package/dist/rpc/request/visit.js +2 -3
- package/dist/rpc/request/visit.js.map +1 -1
- package/dist/rpc/rewrite-rpc.d.ts +2 -3
- package/dist/rpc/rewrite-rpc.d.ts.map +1 -1
- package/dist/rpc/rewrite-rpc.js +14 -5
- package/dist/rpc/rewrite-rpc.js.map +1 -1
- package/dist/rpc/server.d.ts.map +1 -1
- package/dist/rpc/server.js +15 -44
- package/dist/rpc/server.js.map +1 -1
- package/dist/rpc/trace.d.ts +1 -1
- package/dist/rpc/trace.d.ts.map +1 -1
- package/dist/rpc/trace.js +3 -3
- package/dist/rpc/trace.js.map +1 -1
- package/dist/util.d.ts +6 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +14 -0
- package/dist/util.js.map +1 -1
- package/dist/version.txt +1 -1
- package/package.json +1 -1
- package/src/java/index.ts +1 -0
- package/src/java/rpc.ts +726 -537
- package/src/java/tree.ts +1 -1
- package/src/java/type-visitor.ts +241 -0
- package/src/java/type.ts +13 -277
- package/src/java/visitor.ts +581 -378
- package/src/javascript/preconditions.ts +7 -6
- package/src/javascript/rpc.ts +431 -360
- package/src/javascript/tree.ts +1 -1
- package/src/javascript/type-mapping.ts +7 -0
- package/src/javascript/visitor.ts +505 -310
- package/src/json/visitor.ts +47 -22
- package/src/rpc/queue.ts +20 -17
- package/src/rpc/request/generate.ts +31 -25
- package/src/rpc/request/get-languages.ts +18 -10
- package/src/rpc/request/get-object.ts +42 -34
- package/src/rpc/request/get-recipes.ts +15 -8
- package/src/rpc/request/index.ts +1 -0
- package/src/rpc/request/install-recipes.ts +96 -79
- package/src/rpc/request/metrics.ts +54 -48
- package/src/rpc/request/parse.ts +31 -25
- package/src/rpc/request/prepare-recipe.ts +31 -23
- package/src/rpc/request/print.ts +28 -14
- package/src/rpc/request/trace-get-object.ts +4 -0
- package/src/rpc/request/visit.ts +22 -16
- package/src/rpc/rewrite-rpc.ts +23 -10
- package/src/rpc/server.ts +17 -52
- package/src/rpc/trace.ts +3 -3
- package/src/util.ts +14 -0
- package/dist/rpc/chrome-profiler.d.ts +0 -25
- package/dist/rpc/chrome-profiler.d.ts.map +0 -1
- package/dist/rpc/chrome-profiler.js +0 -405
- package/dist/rpc/chrome-profiler.js.map +0 -1
- package/src/rpc/chrome-profiler.ts +0 -373
package/src/javascript/rpc.ts
CHANGED
|
@@ -17,17 +17,17 @@ import {JavaScriptVisitor} from "./visitor";
|
|
|
17
17
|
import {asRef, RpcCodec, RpcCodecs, RpcReceiveQueue, RpcSendQueue} from "../rpc";
|
|
18
18
|
import {isJavaScript, JS, JSX} from "./tree";
|
|
19
19
|
import {Expression, J, Statement, Type, TypedTree, TypeTree} from "../java";
|
|
20
|
-
import {createDraft, finishDraft} from "immer";
|
|
21
20
|
import {JavaReceiver, JavaSender, registerJLanguageCodecs} from "../java/rpc";
|
|
22
21
|
import {Cursor, Tree} from "../tree";
|
|
22
|
+
import {updateIfChanged} from "../util";
|
|
23
23
|
import ComputedPropertyName = JS.ComputedPropertyName;
|
|
24
24
|
|
|
25
25
|
class JavaScriptSender extends JavaScriptVisitor<RpcSendQueue> {
|
|
26
|
-
private
|
|
26
|
+
private delegate: JavaScriptDelegateSender;
|
|
27
27
|
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
this.
|
|
30
|
+
this.delegate = new JavaScriptDelegateSender(this);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
override async visit<R extends J>(tree: Tree, p: RpcSendQueue, parent?: Cursor): Promise<R | undefined> {
|
|
@@ -35,7 +35,7 @@ class JavaScriptSender extends JavaScriptVisitor<RpcSendQueue> {
|
|
|
35
35
|
return super.visit(tree, p, parent);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
return this.
|
|
38
|
+
return this.delegate.visit(tree, p, parent);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
override async preVisit(j: JS, q: RpcSendQueue): Promise<J | undefined> {
|
|
@@ -507,27 +507,27 @@ class JavaScriptSender extends JavaScriptVisitor<RpcSendQueue> {
|
|
|
507
507
|
}
|
|
508
508
|
|
|
509
509
|
override async visitRightPadded<T extends J | boolean>(right: J.RightPadded<T>, q: RpcSendQueue): Promise<J.RightPadded<T>> {
|
|
510
|
-
return this.
|
|
510
|
+
return this.delegate.visitRightPadded(right, q);
|
|
511
511
|
}
|
|
512
512
|
|
|
513
513
|
override async visitLeftPadded<T extends J | J.Space | number | string | boolean>(left: J.LeftPadded<T>, q: RpcSendQueue): Promise<J.LeftPadded<T>> {
|
|
514
|
-
return this.
|
|
514
|
+
return this.delegate.visitLeftPadded(left, q);
|
|
515
515
|
}
|
|
516
516
|
|
|
517
517
|
override async visitContainer<T extends J>(container: J.Container<T>, q: RpcSendQueue): Promise<J.Container<T>> {
|
|
518
|
-
return this.
|
|
518
|
+
return this.delegate.visitContainer(container, q);
|
|
519
519
|
}
|
|
520
520
|
|
|
521
521
|
override async visitSpace(space: J.Space, q: RpcSendQueue): Promise<J.Space> {
|
|
522
|
-
return this.
|
|
522
|
+
return this.delegate.visitSpace(space, q);
|
|
523
523
|
}
|
|
524
524
|
|
|
525
525
|
override async visitType(javaType: Type | undefined, q: RpcSendQueue): Promise<Type | undefined> {
|
|
526
|
-
return this.
|
|
526
|
+
return this.delegate.visitType(javaType, q);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
529
|
|
|
530
|
-
class
|
|
530
|
+
class JavaScriptDelegateSender extends JavaSender {
|
|
531
531
|
private javascriptSender: JavaScriptSender;
|
|
532
532
|
|
|
533
533
|
constructor(javascriptSender: JavaScriptSender) {
|
|
@@ -547,583 +547,654 @@ class JavaScriptSenderDelegate extends JavaSender {
|
|
|
547
547
|
}
|
|
548
548
|
|
|
549
549
|
class JavaScriptReceiver extends JavaScriptVisitor<RpcReceiveQueue> {
|
|
550
|
-
private
|
|
550
|
+
private delegate: JavaReceiver;
|
|
551
551
|
|
|
552
552
|
constructor() {
|
|
553
553
|
super();
|
|
554
|
-
this.
|
|
554
|
+
this.delegate = new JavaScriptDelegateReceiver(this);
|
|
555
555
|
}
|
|
556
556
|
|
|
557
557
|
async visit<R extends J>(tree: Tree, p: RpcReceiveQueue, parent?: Cursor): Promise<R | undefined> {
|
|
558
558
|
if (isJavaScript(tree)) {
|
|
559
559
|
return super.visit(tree, p, parent);
|
|
560
560
|
}
|
|
561
|
-
return this.
|
|
561
|
+
return this.delegate.visit(tree, p, parent);
|
|
562
562
|
}
|
|
563
563
|
|
|
564
564
|
override async preVisit(j: JS, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
565
|
-
const
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
return finishDraft(draft);
|
|
565
|
+
const updates = {
|
|
566
|
+
id: await q.receive(j.id),
|
|
567
|
+
prefix: await q.receive(j.prefix, space => this.visitSpace(space, q)),
|
|
568
|
+
markers: await q.receive(j.markers)
|
|
569
|
+
};
|
|
570
|
+
return updateIfChanged(j, updates);
|
|
572
571
|
}
|
|
573
572
|
|
|
574
573
|
override async visitJsCompilationUnit(cu: JS.CompilationUnit, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
return finishDraft(draft);
|
|
574
|
+
const updates = {
|
|
575
|
+
sourcePath: await q.receive(cu.sourcePath),
|
|
576
|
+
charsetName: await q.receive(cu.charsetName),
|
|
577
|
+
charsetBomMarked: await q.receive(cu.charsetBomMarked),
|
|
578
|
+
checksum: await q.receive(cu.checksum),
|
|
579
|
+
fileAttributes: await q.receive(cu.fileAttributes),
|
|
580
|
+
statements: await q.receiveListDefined(cu.statements, stmt => this.visitRightPadded(stmt, q)),
|
|
581
|
+
eof: await q.receive(cu.eof, space => this.visitSpace(space, q))
|
|
582
|
+
};
|
|
583
|
+
return updateIfChanged(cu, updates);
|
|
586
584
|
}
|
|
587
585
|
|
|
588
586
|
override async visitAlias(alias: JS.Alias, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
587
|
+
const updates = {
|
|
588
|
+
propertyName: await q.receive(alias.propertyName, el => this.visitRightPadded(el, q)),
|
|
589
|
+
alias: await q.receive(alias.alias, el => this.visitDefined<Expression>(el, q))
|
|
590
|
+
};
|
|
591
|
+
return updateIfChanged(alias, updates);
|
|
593
592
|
}
|
|
594
593
|
|
|
595
594
|
override async visitArrowFunction(arrowFunction: JS.ArrowFunction, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
595
|
+
const updates = {
|
|
596
|
+
leadingAnnotations: await q.receiveListDefined(arrowFunction.leadingAnnotations, el => this.visitDefined<J.Annotation>(el, q)),
|
|
597
|
+
modifiers: await q.receiveListDefined(arrowFunction.modifiers, el => this.visitDefined<J.Modifier>(el, q)),
|
|
598
|
+
typeParameters: await q.receive(arrowFunction.typeParameters, el => this.visitDefined<J.TypeParameters>(el, q)),
|
|
599
|
+
lambda: await q.receive(arrowFunction.lambda, el => this.visitDefined<J.Lambda>(el, q)),
|
|
600
|
+
returnTypeExpression: await q.receive(arrowFunction.returnTypeExpression, el => this.visitDefined<TypeTree>(el, q))
|
|
601
|
+
};
|
|
602
|
+
return updateIfChanged(arrowFunction, updates);
|
|
603
603
|
}
|
|
604
604
|
|
|
605
|
-
override async visitAwait(
|
|
606
|
-
const
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
605
|
+
override async visitAwait(anAwait: JS.Await, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
606
|
+
const updates = {
|
|
607
|
+
expression: await q.receive(anAwait.expression, el => this.visitDefined<Expression>(el, q)),
|
|
608
|
+
type: await q.receive(anAwait.type, el => this.visitType(el, q))
|
|
609
|
+
};
|
|
610
|
+
return updateIfChanged(anAwait, updates);
|
|
610
611
|
}
|
|
611
612
|
|
|
612
613
|
override async visitConditionalType(conditionalType: JS.ConditionalType, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
613
|
-
const
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
614
|
+
const updates = {
|
|
615
|
+
checkType: await q.receive(conditionalType.checkType, el => this.visitDefined<Expression>(el, q)),
|
|
616
|
+
condition: await q.receive(conditionalType.condition, el => this.visitLeftPadded(el, q)),
|
|
617
|
+
type: await q.receive(conditionalType.type, el => this.visitType(el, q))
|
|
618
|
+
};
|
|
619
|
+
return updateIfChanged(conditionalType, updates);
|
|
618
620
|
}
|
|
619
621
|
|
|
620
622
|
override async visitDelete(delete_: JS.Delete, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
|
|
623
|
+
const updates = {
|
|
624
|
+
expression: await q.receive(delete_.expression, el => this.visitDefined<Expression>(el, q))
|
|
625
|
+
};
|
|
626
|
+
return updateIfChanged(delete_, updates);
|
|
624
627
|
}
|
|
625
628
|
|
|
626
629
|
override async visitExpressionStatement(expressionStatement: JS.ExpressionStatement, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
627
|
-
const
|
|
628
|
-
|
|
629
|
-
|
|
630
|
+
const updates = {
|
|
631
|
+
expression: await q.receive(expressionStatement.expression, el => this.visitDefined<Expression>(el, q))
|
|
632
|
+
};
|
|
633
|
+
return updateIfChanged(expressionStatement, updates);
|
|
630
634
|
}
|
|
631
635
|
|
|
632
636
|
override async visitExpressionWithTypeArguments(expressionWithTypeArguments: JS.ExpressionWithTypeArguments, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
633
|
-
const
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
637
|
+
const updates = {
|
|
638
|
+
clazz: await q.receive(expressionWithTypeArguments.clazz, el => this.visitDefined<J>(el, q)),
|
|
639
|
+
typeArguments: await q.receive(expressionWithTypeArguments.typeArguments, el => this.visitContainer(el, q)),
|
|
640
|
+
type: await q.receive(expressionWithTypeArguments.type, el => this.visitType(el, q))
|
|
641
|
+
};
|
|
642
|
+
return updateIfChanged(expressionWithTypeArguments, updates);
|
|
638
643
|
}
|
|
639
644
|
|
|
640
645
|
override async visitFunctionCall(functionCall: JS.FunctionCall, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
return finishDraft(draft);
|
|
646
|
+
const updates = {
|
|
647
|
+
function: await q.receive(functionCall.function, select => this.visitRightPadded(select, q)),
|
|
648
|
+
typeParameters: await q.receive(functionCall.typeParameters, typeParams => this.visitContainer(typeParams, q)),
|
|
649
|
+
arguments: await q.receive(functionCall.arguments, args => this.visitContainer(args, q)),
|
|
650
|
+
methodType: await q.receive(functionCall.methodType, type => this.visitType(type, q) as unknown as Type.Method)
|
|
651
|
+
};
|
|
652
|
+
return updateIfChanged(functionCall, updates);
|
|
649
653
|
}
|
|
650
654
|
|
|
651
655
|
override async visitFunctionType(functionType: JS.FunctionType, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
652
|
-
const
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
656
|
+
const updates = {
|
|
657
|
+
modifiers: await q.receiveListDefined(functionType.modifiers, el => this.visitDefined<J.Modifier>(el, q)),
|
|
658
|
+
constructorType: await q.receive(functionType.constructorType, el => this.visitLeftPadded(el, q)),
|
|
659
|
+
typeParameters: await q.receive(functionType.typeParameters, el => this.visitDefined<J.TypeParameters>(el, q)),
|
|
660
|
+
parameters: await q.receive(functionType.parameters, el => this.visitContainer(el, q)),
|
|
661
|
+
returnType: await q.receive(functionType.returnType, el => this.visitLeftPadded(el, q))
|
|
662
|
+
};
|
|
663
|
+
return updateIfChanged(functionType, updates);
|
|
659
664
|
}
|
|
660
665
|
|
|
661
666
|
override async visitInferType(inferType: JS.InferType, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
662
|
-
const
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
667
|
+
const updates = {
|
|
668
|
+
typeParameter: await q.receive(inferType.typeParameter, el => this.visitLeftPadded(el, q)),
|
|
669
|
+
type: await q.receive(inferType.type, el => this.visitType(el, q))
|
|
670
|
+
};
|
|
671
|
+
return updateIfChanged(inferType, updates);
|
|
666
672
|
}
|
|
667
673
|
|
|
668
674
|
override async visitImportType(importType: JS.ImportType, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
669
|
-
const
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
675
|
+
const updates = {
|
|
676
|
+
hasTypeof: await q.receive(importType.hasTypeof, el => this.visitRightPadded(el, q)),
|
|
677
|
+
argumentAndAttributes: await q.receive(importType.argumentAndAttributes, el => this.visitContainer(el, q)),
|
|
678
|
+
qualifier: await q.receive(importType.qualifier, el => this.visitLeftPadded(el, q)),
|
|
679
|
+
typeArguments: await q.receive(importType.typeArguments, el => this.visitContainer(el, q)),
|
|
680
|
+
type: await q.receive(importType.type, el => this.visitType(el, q))
|
|
681
|
+
};
|
|
682
|
+
return updateIfChanged(importType, updates);
|
|
676
683
|
}
|
|
677
684
|
|
|
678
685
|
override async visitImportDeclaration(jsImport: JS.Import, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
+
const updates = {
|
|
687
|
+
modifiers: await q.receiveListDefined(jsImport.modifiers, el => this.visitDefined<J.Modifier>(el, q)),
|
|
688
|
+
importClause: await q.receive(jsImport.importClause, el => this.visitDefined<JS.ImportClause>(el, q)),
|
|
689
|
+
moduleSpecifier: await q.receive(jsImport.moduleSpecifier, el => this.visitLeftPadded(el, q)),
|
|
690
|
+
attributes: await q.receive(jsImport.attributes, el => this.visitDefined<JS.ImportAttributes>(el, q)),
|
|
691
|
+
initializer: await q.receive(jsImport.initializer, el => this.visitLeftPadded(el, q))
|
|
692
|
+
};
|
|
693
|
+
return updateIfChanged(jsImport, updates);
|
|
686
694
|
}
|
|
687
695
|
|
|
688
696
|
override async visitImportClause(jsImportClause: JS.ImportClause, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
697
|
+
const updates = {
|
|
698
|
+
typeOnly: await q.receive(jsImportClause.typeOnly),
|
|
699
|
+
name: await q.receive(jsImportClause.name, el => this.visitRightPadded(el, q)),
|
|
700
|
+
namedBindings: await q.receive(jsImportClause.namedBindings, el => this.visitDefined<Expression>(el, q))
|
|
701
|
+
};
|
|
702
|
+
return updateIfChanged(jsImportClause, updates);
|
|
694
703
|
}
|
|
695
704
|
|
|
696
705
|
override async visitNamedImports(namedImports: JS.NamedImports, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
706
|
+
const updates = {
|
|
707
|
+
elements: await q.receive(namedImports.elements, el => this.visitContainer(el, q)),
|
|
708
|
+
type: await q.receive(namedImports.type, el => this.visitType(el, q))
|
|
709
|
+
};
|
|
710
|
+
return updateIfChanged(namedImports, updates);
|
|
701
711
|
}
|
|
702
712
|
|
|
703
713
|
override async visitImportSpecifier(jsImportSpecifier: JS.ImportSpecifier, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
714
|
+
const updates = {
|
|
715
|
+
importType: await q.receive(jsImportSpecifier.importType, el => this.visitLeftPadded(el, q)),
|
|
716
|
+
specifier: await q.receive(jsImportSpecifier.specifier, el => this.visitDefined<JS.Alias | J.Identifier>(el, q)),
|
|
717
|
+
type: await q.receive(jsImportSpecifier.type, el => this.visitType(el, q))
|
|
718
|
+
};
|
|
719
|
+
return updateIfChanged(jsImportSpecifier, updates);
|
|
709
720
|
}
|
|
710
721
|
|
|
711
722
|
override async visitImportAttributes(importAttributes: JS.ImportAttributes, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
723
|
+
const updates = {
|
|
724
|
+
token: await q.receive(importAttributes.token),
|
|
725
|
+
elements: await q.receive(importAttributes.elements, el => this.visitContainer(el, q))
|
|
726
|
+
};
|
|
727
|
+
return updateIfChanged(importAttributes, updates);
|
|
716
728
|
}
|
|
717
729
|
|
|
718
730
|
override async visitImportTypeAttributes(importTypeAttributes: JS.ImportTypeAttributes, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
731
|
+
const updates = {
|
|
732
|
+
token: await q.receive(importTypeAttributes.token, el => this.visitRightPadded(el, q)),
|
|
733
|
+
elements: await q.receive(importTypeAttributes.elements, el => this.visitContainer(el, q)),
|
|
734
|
+
end: await q.receive(importTypeAttributes.end, el => this.visitSpace(el, q))
|
|
735
|
+
};
|
|
736
|
+
return updateIfChanged(importTypeAttributes, updates);
|
|
724
737
|
}
|
|
725
738
|
|
|
726
739
|
override async visitImportAttribute(importAttribute: JS.ImportAttribute, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
740
|
+
const updates = {
|
|
741
|
+
name: await q.receive(importAttribute.name, el => this.visitDefined<Expression>(el, q)),
|
|
742
|
+
value: await q.receive(importAttribute.value, el => this.visitLeftPadded(el, q))
|
|
743
|
+
};
|
|
744
|
+
return updateIfChanged(importAttribute, updates);
|
|
731
745
|
}
|
|
732
746
|
|
|
733
747
|
override async visitBinaryExtensions(binary: JS.Binary, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
734
|
-
const
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
748
|
+
const updates = {
|
|
749
|
+
left: await q.receive(binary.left, el => this.visitDefined<Expression>(el, q)),
|
|
750
|
+
operator: await q.receive(binary.operator, el => this.visitLeftPadded(el, q)),
|
|
751
|
+
right: await q.receive(binary.right, el => this.visitDefined<Expression>(el, q)),
|
|
752
|
+
type: await q.receive(binary.type, el => this.visitType(el, q))
|
|
753
|
+
};
|
|
754
|
+
return updateIfChanged(binary, updates);
|
|
740
755
|
}
|
|
741
756
|
|
|
742
757
|
override async visitLiteralType(literalType: JS.LiteralType, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
758
|
+
const updates = {
|
|
759
|
+
literal: await q.receive(literalType.literal, el => this.visitDefined<Expression>(el, q)),
|
|
760
|
+
type: await q.receive(literalType.type, el => this.visitType(el, q))
|
|
761
|
+
};
|
|
762
|
+
return updateIfChanged(literalType, updates);
|
|
747
763
|
}
|
|
748
764
|
|
|
749
765
|
override async visitMappedType(mappedType: JS.MappedType, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
750
|
-
const
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
766
|
+
const updates = {
|
|
767
|
+
prefixToken: await q.receive(mappedType.prefixToken, el => this.visitLeftPadded(el, q)),
|
|
768
|
+
hasReadonly: await q.receive(mappedType.hasReadonly, el => this.visitLeftPadded(el, q)),
|
|
769
|
+
keysRemapping: await q.receive(mappedType.keysRemapping, el => this.visitDefined<JS.MappedType.KeysRemapping>(el, q)),
|
|
770
|
+
suffixToken: await q.receive(mappedType.suffixToken, el => this.visitLeftPadded(el, q)),
|
|
771
|
+
hasQuestionToken: await q.receive(mappedType.hasQuestionToken, el => this.visitLeftPadded(el, q)),
|
|
772
|
+
valueType: await q.receive(mappedType.valueType, el => this.visitContainer(el, q)),
|
|
773
|
+
type: await q.receive(mappedType.type, el => this.visitType(el, q))
|
|
774
|
+
};
|
|
775
|
+
return updateIfChanged(mappedType, updates);
|
|
759
776
|
}
|
|
760
777
|
|
|
761
778
|
override async visitMappedTypeKeysRemapping(keysRemapping: JS.MappedType.KeysRemapping, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
779
|
+
const updates = {
|
|
780
|
+
typeParameter: await q.receive(keysRemapping.typeParameter, el => this.visitRightPadded(el, q)),
|
|
781
|
+
nameType: await q.receive(keysRemapping.nameType, el => this.visitRightPadded(el, q))
|
|
782
|
+
};
|
|
783
|
+
return updateIfChanged(keysRemapping, updates);
|
|
766
784
|
}
|
|
767
785
|
|
|
768
786
|
override async visitMappedTypeParameter(mappedTypeParameter: JS.MappedType.Parameter, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
769
|
-
const
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
787
|
+
const updates = {
|
|
788
|
+
name: await q.receive(mappedTypeParameter.name, el => this.visitDefined<Expression>(el, q)),
|
|
789
|
+
iterateType: await q.receive(mappedTypeParameter.iterateType, el => this.visitLeftPadded(el, q))
|
|
790
|
+
};
|
|
791
|
+
return updateIfChanged(mappedTypeParameter, updates);
|
|
773
792
|
}
|
|
774
793
|
|
|
775
794
|
override async visitObjectBindingPattern(objectBindingPattern: JS.ObjectBindingPattern, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
795
|
+
const updates = {
|
|
796
|
+
leadingAnnotations: await q.receiveListDefined(objectBindingPattern.leadingAnnotations, el => this.visitDefined<J.Annotation>(el, q)),
|
|
797
|
+
modifiers: await q.receiveListDefined(objectBindingPattern.modifiers, el => this.visitDefined<J.Modifier>(el, q)),
|
|
798
|
+
typeExpression: await q.receive(objectBindingPattern.typeExpression, el => this.visitDefined<TypeTree>(el, q)),
|
|
799
|
+
bindings: await q.receive(objectBindingPattern.bindings, el => this.visitContainer(el, q)),
|
|
800
|
+
initializer: await q.receive(objectBindingPattern.initializer, el => this.visitLeftPadded(el, q))
|
|
801
|
+
};
|
|
802
|
+
return updateIfChanged(objectBindingPattern, updates);
|
|
783
803
|
}
|
|
784
804
|
|
|
785
805
|
override async visitPropertyAssignment(propertyAssignment: JS.PropertyAssignment, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
786
|
-
const
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
806
|
+
const updates = {
|
|
807
|
+
name: await q.receive(propertyAssignment.name, el => this.visitRightPadded(el, q)),
|
|
808
|
+
assigmentToken: await q.receive(propertyAssignment.assigmentToken),
|
|
809
|
+
initializer: await q.receive(propertyAssignment.initializer, el => this.visitDefined<Expression>(el, q))
|
|
810
|
+
};
|
|
811
|
+
return updateIfChanged(propertyAssignment, updates);
|
|
791
812
|
}
|
|
792
813
|
|
|
793
814
|
override async visitSatisfiesExpression(satisfiesExpression: JS.SatisfiesExpression, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
815
|
+
const updates = {
|
|
816
|
+
expression: await q.receive(satisfiesExpression.expression, el => this.visitDefined<J>(el, q)),
|
|
817
|
+
satisfiesType: await q.receive(satisfiesExpression.satisfiesType, el => this.visitLeftPadded(el, q)),
|
|
818
|
+
type: await q.receive(satisfiesExpression.type, el => this.visitType(el, q))
|
|
819
|
+
};
|
|
820
|
+
return updateIfChanged(satisfiesExpression, updates);
|
|
799
821
|
}
|
|
800
822
|
|
|
801
823
|
override async visitScopedVariableDeclarations(scopedVariableDeclarations: JS.ScopedVariableDeclarations, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
802
|
-
const
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
824
|
+
const updates = {
|
|
825
|
+
modifiers: await q.receiveListDefined(scopedVariableDeclarations.modifiers, el => this.visitDefined<J.Modifier>(el, q)),
|
|
826
|
+
variables: await q.receiveListDefined(scopedVariableDeclarations.variables, el => this.visitRightPadded(el, q))
|
|
827
|
+
};
|
|
828
|
+
return updateIfChanged(scopedVariableDeclarations, updates);
|
|
806
829
|
}
|
|
807
830
|
|
|
808
831
|
override async visitStatementExpression(statementExpression: JS.StatementExpression, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
|
|
832
|
+
const updates = {
|
|
833
|
+
statement: await q.receive(statementExpression.statement, el => this.visitDefined<Statement>(el, q))
|
|
834
|
+
};
|
|
835
|
+
return updateIfChanged(statementExpression, updates);
|
|
812
836
|
}
|
|
813
837
|
|
|
814
838
|
override async visitTaggedTemplateExpression(taggedTemplateExpression: JS.TaggedTemplateExpression, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
815
|
-
const
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
839
|
+
const updates = {
|
|
840
|
+
tag: await q.receive(taggedTemplateExpression.tag, el => this.visitRightPadded(el, q)),
|
|
841
|
+
typeArguments: await q.receive(taggedTemplateExpression.typeArguments, el => this.visitContainer(el, q)),
|
|
842
|
+
templateExpression: await q.receive(taggedTemplateExpression.templateExpression, el => this.visitDefined<Expression>(el, q)),
|
|
843
|
+
type: await q.receive(taggedTemplateExpression.type, el => this.visitType(el, q))
|
|
844
|
+
};
|
|
845
|
+
return updateIfChanged(taggedTemplateExpression, updates);
|
|
821
846
|
}
|
|
822
847
|
|
|
823
848
|
override async visitTemplateExpression(templateExpression: JS.TemplateExpression, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
824
|
-
const
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
849
|
+
const updates = {
|
|
850
|
+
head: await q.receive(templateExpression.head, el => this.visitDefined<J.Literal>(el, q)),
|
|
851
|
+
spans: await q.receiveListDefined(templateExpression.spans, el => this.visitRightPadded(el, q)),
|
|
852
|
+
type: await q.receive(templateExpression.type, el => this.visitType(el, q))
|
|
853
|
+
};
|
|
854
|
+
return updateIfChanged(templateExpression, updates);
|
|
829
855
|
}
|
|
830
856
|
|
|
831
857
|
override async visitTemplateExpressionSpan(span: JS.TemplateExpression.Span, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
832
|
-
const
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
858
|
+
const updates = {
|
|
859
|
+
expression: await q.receive(span.expression, el => this.visitDefined<J>(el, q)),
|
|
860
|
+
tail: await q.receive(span.tail, el => this.visitDefined<J.Literal>(el, q))
|
|
861
|
+
};
|
|
862
|
+
return updateIfChanged(span, updates);
|
|
836
863
|
}
|
|
837
864
|
|
|
838
865
|
override async visitTuple(tuple: JS.Tuple, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
839
|
-
const
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
866
|
+
const updates = {
|
|
867
|
+
elements: await q.receive(tuple.elements, el => this.visitContainer(el, q)),
|
|
868
|
+
type: await q.receive(tuple.type, el => this.visitType(el, q))
|
|
869
|
+
};
|
|
870
|
+
return updateIfChanged(tuple, updates);
|
|
843
871
|
}
|
|
844
872
|
|
|
845
873
|
override async visitTypeDeclaration(typeDeclaration: JS.TypeDeclaration, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
846
|
-
const
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
874
|
+
const updates = {
|
|
875
|
+
modifiers: await q.receiveListDefined(typeDeclaration.modifiers, el => this.visitDefined<J.Modifier>(el, q)),
|
|
876
|
+
name: await q.receive(typeDeclaration.name, el => this.visitLeftPadded(el, q)),
|
|
877
|
+
typeParameters: await q.receive(typeDeclaration.typeParameters, el => this.visitDefined<J.TypeParameters>(el, q)),
|
|
878
|
+
initializer: await q.receive(typeDeclaration.initializer, el => this.visitLeftPadded(el, q)),
|
|
879
|
+
type: await q.receive(typeDeclaration.type, el => this.visitType(el, q))
|
|
880
|
+
};
|
|
881
|
+
return updateIfChanged(typeDeclaration, updates);
|
|
853
882
|
}
|
|
854
883
|
|
|
855
884
|
override async visitTypeOf(typeOf: JS.TypeOf, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
856
|
-
const
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
885
|
+
const updates = {
|
|
886
|
+
expression: await q.receive(typeOf.expression, el => this.visitDefined<Expression>(el, q)),
|
|
887
|
+
type: await q.receive(typeOf.type, el => this.visitType(el, q))
|
|
888
|
+
};
|
|
889
|
+
return updateIfChanged(typeOf, updates);
|
|
860
890
|
}
|
|
861
891
|
|
|
862
892
|
override async visitTypeTreeExpression(typeTreeExpression: JS.TypeTreeExpression, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
863
|
-
const
|
|
864
|
-
|
|
865
|
-
|
|
893
|
+
const updates = {
|
|
894
|
+
expression: await q.receive(typeTreeExpression.expression, el => this.visitDefined<Expression>(el, q))
|
|
895
|
+
};
|
|
896
|
+
return updateIfChanged(typeTreeExpression, updates);
|
|
866
897
|
}
|
|
867
898
|
|
|
868
899
|
override async visitAs(as_: JS.As, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
869
|
-
const
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
900
|
+
const updates = {
|
|
901
|
+
left: await q.receive(as_.left, el => this.visitRightPadded<Expression>(el, q)),
|
|
902
|
+
right: await q.receive(as_.right, el => this.visitDefined<Expression>(el, q)),
|
|
903
|
+
type: await q.receive(as_.type, el => this.visitType(el, q))
|
|
904
|
+
};
|
|
905
|
+
return updateIfChanged(as_, updates);
|
|
874
906
|
}
|
|
875
907
|
|
|
876
908
|
override async visitAssignmentOperationExtensions(assignmentOperation: JS.AssignmentOperation, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
909
|
+
const updates = {
|
|
910
|
+
variable: await q.receive(assignmentOperation.variable, el => this.visitDefined<Expression>(el, q)),
|
|
911
|
+
operator: await q.receive(assignmentOperation.operator, el => this.visitLeftPadded(el, q)),
|
|
912
|
+
assignment: await q.receive(assignmentOperation.assignment, el => this.visitDefined<Expression>(el, q)),
|
|
913
|
+
type: await q.receive(assignmentOperation.type, el => this.visitType(el, q))
|
|
914
|
+
};
|
|
915
|
+
return updateIfChanged(assignmentOperation, updates);
|
|
883
916
|
}
|
|
884
917
|
|
|
885
918
|
override async visitIndexedAccessType(indexedAccessType: JS.IndexedAccessType, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
886
|
-
const
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
919
|
+
const updates = {
|
|
920
|
+
objectType: await q.receive(indexedAccessType.objectType, el => this.visitDefined<TypeTree>(el, q)),
|
|
921
|
+
indexType: await q.receive(indexedAccessType.indexType, el => this.visitDefined<TypeTree>(el, q)),
|
|
922
|
+
type: await q.receive(indexedAccessType.type, el => this.visitType(el, q))
|
|
923
|
+
};
|
|
924
|
+
return updateIfChanged(indexedAccessType, updates);
|
|
891
925
|
}
|
|
892
926
|
|
|
893
927
|
override async visitIndexedAccessTypeIndexType(indexType: JS.IndexedAccessType.IndexType, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
928
|
+
const updates = {
|
|
929
|
+
element: await q.receive(indexType.element, el => this.visitRightPadded(el, q)),
|
|
930
|
+
type: await q.receive(indexType.type, el => this.visitType(el, q))
|
|
931
|
+
};
|
|
932
|
+
return updateIfChanged(indexType, updates);
|
|
898
933
|
}
|
|
899
934
|
|
|
900
935
|
override async visitTypeQuery(typeQuery: JS.TypeQuery, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
936
|
+
const updates = {
|
|
937
|
+
typeExpression: await q.receive(typeQuery.typeExpression, el => this.visitDefined<TypeTree>(el, q)),
|
|
938
|
+
typeArguments: await q.receive(typeQuery.typeArguments, el => this.visitContainer(el, q)),
|
|
939
|
+
type: await q.receive(typeQuery.type, el => this.visitType(el, q))
|
|
940
|
+
};
|
|
941
|
+
return updateIfChanged(typeQuery, updates);
|
|
906
942
|
}
|
|
907
943
|
|
|
908
944
|
override async visitTypeInfo(typeInfo: JS.TypeInfo, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
|
|
945
|
+
const updates = {
|
|
946
|
+
typeIdentifier: await q.receive(typeInfo.typeIdentifier, el => this.visitDefined<TypeTree>(el, q))
|
|
947
|
+
};
|
|
948
|
+
return updateIfChanged(typeInfo, updates);
|
|
912
949
|
}
|
|
913
950
|
|
|
914
951
|
override async visitComputedPropertyName(computedPropertyName: JS.ComputedPropertyName, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
915
|
-
const
|
|
916
|
-
|
|
917
|
-
|
|
952
|
+
const updates = {
|
|
953
|
+
expression: await q.receive(computedPropertyName.expression, el => this.visitRightPadded(el, q))
|
|
954
|
+
};
|
|
955
|
+
return updateIfChanged(computedPropertyName, updates);
|
|
918
956
|
}
|
|
919
957
|
|
|
920
958
|
override async visitTypeOperator(typeOperator: JS.TypeOperator, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
959
|
+
const updates = {
|
|
960
|
+
operator: await q.receive(typeOperator.operator),
|
|
961
|
+
expression: await q.receive(typeOperator.expression, el => this.visitLeftPadded(el, q))
|
|
962
|
+
};
|
|
963
|
+
return updateIfChanged(typeOperator, updates);
|
|
925
964
|
}
|
|
926
965
|
|
|
927
966
|
override async visitTypePredicate(typePredicate: JS.TypePredicate, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
967
|
+
const updates = {
|
|
968
|
+
asserts: await q.receive(typePredicate.asserts, el => this.visitLeftPadded(el, q)),
|
|
969
|
+
parameterName: await q.receive(typePredicate.parameterName, el => this.visitDefined<J.Identifier>(el, q)),
|
|
970
|
+
expression: await q.receive(typePredicate.expression, el => this.visitLeftPadded(el, q)),
|
|
971
|
+
type: await q.receive(typePredicate.type, el => this.visitType(el, q))
|
|
972
|
+
};
|
|
973
|
+
return updateIfChanged(typePredicate, updates);
|
|
934
974
|
}
|
|
935
975
|
|
|
936
976
|
override async visitUnion(union: JS.Union, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
937
|
-
const
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
977
|
+
const updates = {
|
|
978
|
+
types: await q.receiveListDefined(union.types, el => this.visitRightPadded(el, q)),
|
|
979
|
+
type: await q.receive(union.type, el => this.visitType(el, q))
|
|
980
|
+
};
|
|
981
|
+
return updateIfChanged(union, updates);
|
|
941
982
|
}
|
|
942
983
|
|
|
943
984
|
override async visitIntersection(intersection: JS.Intersection, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
985
|
+
const updates = {
|
|
986
|
+
types: await q.receiveListDefined(intersection.types, el => this.visitRightPadded(el, q)),
|
|
987
|
+
type: await q.receive(intersection.type, el => this.visitType(el, q))
|
|
988
|
+
};
|
|
989
|
+
return updateIfChanged(intersection, updates);
|
|
948
990
|
}
|
|
949
991
|
|
|
950
992
|
override async visitVoid(void_: JS.Void, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
951
|
-
const
|
|
952
|
-
|
|
953
|
-
|
|
993
|
+
const updates = {
|
|
994
|
+
expression: await q.receive(void_.expression, el => this.visitDefined<Expression>(el, q))
|
|
995
|
+
};
|
|
996
|
+
return updateIfChanged(void_, updates);
|
|
954
997
|
}
|
|
955
998
|
|
|
956
999
|
override async visitWithStatement(withStatement: JS.WithStatement, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
957
|
-
const
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
1000
|
+
const updates = {
|
|
1001
|
+
expression: await q.receive(withStatement.expression, el => this.visitDefined<J.ControlParentheses<Expression>>(el, q)),
|
|
1002
|
+
body: await q.receive(withStatement.body, el => this.visitRightPadded(el, q))
|
|
1003
|
+
};
|
|
1004
|
+
return updateIfChanged(withStatement, updates);
|
|
961
1005
|
}
|
|
962
1006
|
|
|
963
1007
|
override async visitJsxTag(tag: JSX.Tag, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
1008
|
+
if ('selfClosing' in tag) {
|
|
1009
|
+
// Self-closing tag
|
|
1010
|
+
const updates = {
|
|
1011
|
+
openName: await q.receive(tag.openName, el => this.visitLeftPadded(el, q)),
|
|
1012
|
+
typeArguments: await q.receive(tag.typeArguments, el => this.visitContainer(el, q)),
|
|
1013
|
+
afterName: await q.receive(tag.afterName, space => this.visitSpace(space, q)),
|
|
1014
|
+
attributes: await q.receiveListDefined(tag.attributes, attr => this.visitRightPadded(attr, q)),
|
|
1015
|
+
selfClosing: await q.receive(tag.selfClosing, space => this.visitSpace(space, q))
|
|
1016
|
+
};
|
|
1017
|
+
return updateIfChanged(tag, updates);
|
|
1018
|
+
} else {
|
|
1019
|
+
// Tag with children
|
|
1020
|
+
const updates = {
|
|
1021
|
+
openName: await q.receive(tag.openName, el => this.visitLeftPadded(el, q)),
|
|
1022
|
+
typeArguments: await q.receive(tag.typeArguments, el => this.visitContainer(el, q)),
|
|
1023
|
+
afterName: await q.receive(tag.afterName, space => this.visitSpace(space, q)),
|
|
1024
|
+
attributes: await q.receiveListDefined(tag.attributes, attr => this.visitRightPadded(attr, q)),
|
|
1025
|
+
children: await q.receiveListDefined(tag.children, child => this.visit(child, q)),
|
|
1026
|
+
closingName: await q.receive(tag.closingName, el => this.visitLeftPadded(el, q)),
|
|
1027
|
+
afterClosingName: await q.receive(tag.afterClosingName, el => this.visitSpace(el, q))
|
|
1028
|
+
};
|
|
1029
|
+
return updateIfChanged(tag, updates);
|
|
1030
|
+
}
|
|
976
1031
|
}
|
|
977
1032
|
|
|
978
1033
|
override async visitJsxAttribute(attribute: JSX.Attribute, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
979
|
-
const
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
1034
|
+
const updates = {
|
|
1035
|
+
key: await q.receive(attribute.key, el => this.visitDefined<J.Identifier | JSX.NamespacedName>(el, q)),
|
|
1036
|
+
value: await q.receive(attribute.value, el => this.visitLeftPadded(el, q))
|
|
1037
|
+
};
|
|
1038
|
+
return updateIfChanged(attribute, updates);
|
|
983
1039
|
}
|
|
984
1040
|
|
|
985
1041
|
override async visitJsxSpreadAttribute(spreadAttribute: JSX.SpreadAttribute, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
986
|
-
const
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1042
|
+
const updates = {
|
|
1043
|
+
dots: await q.receive(spreadAttribute.dots, space => this.visitSpace(space, q)),
|
|
1044
|
+
expression: await q.receive(spreadAttribute.expression, el => this.visitRightPadded(el, q))
|
|
1045
|
+
};
|
|
1046
|
+
return updateIfChanged(spreadAttribute, updates);
|
|
990
1047
|
}
|
|
991
1048
|
|
|
992
1049
|
override async visitJsxEmbeddedExpression(embeddedExpression: JSX.EmbeddedExpression, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
993
|
-
const
|
|
994
|
-
|
|
995
|
-
|
|
1050
|
+
const updates = {
|
|
1051
|
+
expression: await q.receive(embeddedExpression.expression, el => this.visitRightPadded(el, q))
|
|
1052
|
+
};
|
|
1053
|
+
return updateIfChanged(embeddedExpression, updates);
|
|
996
1054
|
}
|
|
997
1055
|
|
|
998
1056
|
override async visitJsxNamespacedName(namespacedName: JSX.NamespacedName, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
999
|
-
const
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1057
|
+
const updates = {
|
|
1058
|
+
namespace: await q.receive(namespacedName.namespace, el => this.visitDefined<J.Identifier>(el, q)),
|
|
1059
|
+
name: await q.receive(namespacedName.name, el => this.visitLeftPadded(el, q))
|
|
1060
|
+
};
|
|
1061
|
+
return updateIfChanged(namespacedName, updates);
|
|
1003
1062
|
}
|
|
1004
1063
|
|
|
1005
1064
|
override async visitIndexSignatureDeclaration(indexSignatureDeclaration: JS.IndexSignatureDeclaration, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
1006
|
-
const
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1065
|
+
const updates = {
|
|
1066
|
+
modifiers: await q.receiveListDefined(indexSignatureDeclaration.modifiers, el => this.visitDefined<J.Modifier>(el, q)),
|
|
1067
|
+
parameters: await q.receive(indexSignatureDeclaration.parameters, el => this.visitContainer(el, q)),
|
|
1068
|
+
typeExpression: await q.receive(indexSignatureDeclaration.typeExpression, el => this.visitLeftPadded(el, q)),
|
|
1069
|
+
type: await q.receive(indexSignatureDeclaration.type, el => this.visitType(el, q))
|
|
1070
|
+
};
|
|
1071
|
+
return updateIfChanged(indexSignatureDeclaration, updates);
|
|
1012
1072
|
}
|
|
1013
1073
|
|
|
1014
1074
|
override async visitComputedPropertyMethodDeclaration(computedPropMethod: JS.ComputedPropertyMethodDeclaration, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
1015
|
-
const
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1075
|
+
const updates = {
|
|
1076
|
+
leadingAnnotations: await q.receiveListDefined(computedPropMethod.leadingAnnotations, el => this.visitDefined<J.Annotation>(el, q)),
|
|
1077
|
+
modifiers: await q.receiveListDefined(computedPropMethod.modifiers, el => this.visitDefined<J.Modifier>(el, q)),
|
|
1078
|
+
typeParameters: await q.receive(computedPropMethod.typeParameters, el => this.visitDefined<J.TypeParameters>(el, q)),
|
|
1079
|
+
returnTypeExpression: await q.receive(computedPropMethod.returnTypeExpression, el => this.visitDefined<TypeTree>(el, q)),
|
|
1080
|
+
name: await q.receive(computedPropMethod.name, el => this.visitDefined<ComputedPropertyName>(el, q)),
|
|
1081
|
+
parameters: await q.receive(computedPropMethod.parameters, el => this.visitContainer(el, q)),
|
|
1082
|
+
body: await q.receive(computedPropMethod.body, el => this.visitDefined<J.Block>(el, q)),
|
|
1083
|
+
methodType: await q.receive(computedPropMethod.methodType, el => this.visitType(el, q) as any as Type.Method)
|
|
1084
|
+
};
|
|
1085
|
+
return updateIfChanged(computedPropMethod, updates);
|
|
1025
1086
|
}
|
|
1026
1087
|
|
|
1027
1088
|
override async visitForOfLoop(forOfLoop: JS.ForOfLoop, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1089
|
+
const updates = {
|
|
1090
|
+
await: await q.receive(forOfLoop.await, space => this.visitSpace(space, q)),
|
|
1091
|
+
loop: await q.receive(forOfLoop.loop, el => this.visitDefined<J.ForEachLoop>(el, q))
|
|
1092
|
+
};
|
|
1093
|
+
return updateIfChanged(forOfLoop, updates);
|
|
1032
1094
|
}
|
|
1033
1095
|
|
|
1034
1096
|
override async visitForInLoop(forInLoop: JS.ForInLoop, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1097
|
+
const updates = {
|
|
1098
|
+
control: await q.receive(forInLoop.control, el => this.visitDefined<JS.ForInLoop.Control>(el, q)),
|
|
1099
|
+
body: await q.receive(forInLoop.body, el => this.visitRightPadded(el, q))
|
|
1100
|
+
};
|
|
1101
|
+
return updateIfChanged(forInLoop, updates);
|
|
1039
1102
|
}
|
|
1040
1103
|
|
|
1041
1104
|
override async visitNamespaceDeclaration(namespaceDeclaration: JS.NamespaceDeclaration, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1105
|
+
const updates = {
|
|
1106
|
+
modifiers: await q.receiveListDefined(namespaceDeclaration.modifiers, el => this.visitDefined<J.Modifier>(el, q)),
|
|
1107
|
+
keywordType: await q.receive(namespaceDeclaration.keywordType, el => this.visitLeftPadded(el, q)),
|
|
1108
|
+
name: await q.receive(namespaceDeclaration.name, el => this.visitRightPadded(el, q)),
|
|
1109
|
+
body: await q.receive(namespaceDeclaration.body, el => this.visitDefined<J.Block>(el, q))
|
|
1110
|
+
};
|
|
1111
|
+
return updateIfChanged(namespaceDeclaration, updates);
|
|
1048
1112
|
}
|
|
1049
1113
|
|
|
1050
1114
|
override async visitTypeLiteral(typeLiteral: JS.TypeLiteral, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
1051
|
-
const
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1115
|
+
const updates = {
|
|
1116
|
+
members: await q.receive(typeLiteral.members, el => this.visitDefined<J.Block>(el, q)),
|
|
1117
|
+
type: await q.receive(typeLiteral.type, el => this.visitType(el, q))
|
|
1118
|
+
};
|
|
1119
|
+
return updateIfChanged(typeLiteral, updates);
|
|
1055
1120
|
}
|
|
1056
1121
|
|
|
1057
1122
|
override async visitArrayBindingPattern(arrayBindingPattern: JS.ArrayBindingPattern, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
1058
|
-
const
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1123
|
+
const updates = {
|
|
1124
|
+
elements: await q.receive(arrayBindingPattern.elements, el => this.visitContainer(el, q)),
|
|
1125
|
+
type: await q.receive(arrayBindingPattern.type, el => this.visitType(el, q))
|
|
1126
|
+
};
|
|
1127
|
+
return updateIfChanged(arrayBindingPattern, updates);
|
|
1062
1128
|
}
|
|
1063
1129
|
|
|
1064
1130
|
override async visitBindingElement(bindingElement: JS.BindingElement, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1131
|
+
const updates = {
|
|
1132
|
+
propertyName: await q.receive(bindingElement.propertyName, el => this.visitRightPadded(el, q)),
|
|
1133
|
+
name: await q.receive(bindingElement.name, el => this.visitDefined<TypedTree>(el, q)),
|
|
1134
|
+
initializer: await q.receive(bindingElement.initializer, el => this.visitLeftPadded(el, q)),
|
|
1135
|
+
variableType: await q.receive(bindingElement.variableType, el => this.visitType(el, q) as any as Type.Variable)
|
|
1136
|
+
};
|
|
1137
|
+
return updateIfChanged(bindingElement, updates);
|
|
1071
1138
|
}
|
|
1072
1139
|
|
|
1073
1140
|
override async visitExportDeclaration(exportDeclaration: JS.ExportDeclaration, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1141
|
+
const updates = {
|
|
1142
|
+
modifiers: await q.receiveListDefined(exportDeclaration.modifiers, el => this.visitDefined<J.Modifier>(el, q)),
|
|
1143
|
+
typeOnly: await q.receive(exportDeclaration.typeOnly, el => this.visitLeftPadded(el, q)),
|
|
1144
|
+
exportClause: await q.receive(exportDeclaration.exportClause, el => this.visitDefined<Expression>(el, q)),
|
|
1145
|
+
moduleSpecifier: await q.receive(exportDeclaration.moduleSpecifier, el => this.visitLeftPadded(el, q)),
|
|
1146
|
+
attributes: await q.receive(exportDeclaration.attributes, el => this.visitDefined<JS.ImportAttributes>(el, q))
|
|
1147
|
+
};
|
|
1148
|
+
return updateIfChanged(exportDeclaration, updates);
|
|
1081
1149
|
}
|
|
1082
1150
|
|
|
1083
1151
|
override async visitExportAssignment(exportAssignment: JS.ExportAssignment, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
1084
|
-
const
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1152
|
+
const updates = {
|
|
1153
|
+
exportEquals: await q.receive(exportAssignment.exportEquals),
|
|
1154
|
+
expression: await q.receive(exportAssignment.expression, el => this.visitLeftPadded(el, q))
|
|
1155
|
+
};
|
|
1156
|
+
return updateIfChanged(exportAssignment, updates);
|
|
1088
1157
|
}
|
|
1089
1158
|
|
|
1090
1159
|
override async visitNamedExports(namedExports: JS.NamedExports, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1160
|
+
const updates = {
|
|
1161
|
+
elements: await q.receive(namedExports.elements, el => this.visitContainer(el, q)),
|
|
1162
|
+
type: await q.receive(namedExports.type, el => this.visitType(el, q))
|
|
1163
|
+
};
|
|
1164
|
+
return updateIfChanged(namedExports, updates);
|
|
1095
1165
|
}
|
|
1096
1166
|
|
|
1097
1167
|
override async visitExportSpecifier(exportSpecifier: JS.ExportSpecifier, q: RpcReceiveQueue): Promise<J | undefined> {
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1168
|
+
const updates = {
|
|
1169
|
+
typeOnly: await q.receive(exportSpecifier.typeOnly, el => this.visitLeftPadded(el, q)),
|
|
1170
|
+
specifier: await q.receive(exportSpecifier.specifier, el => this.visitDefined<Expression>(el, q)),
|
|
1171
|
+
type: await q.receive(exportSpecifier.type, el => this.visitType(el, q))
|
|
1172
|
+
};
|
|
1173
|
+
return updateIfChanged(exportSpecifier, updates);
|
|
1103
1174
|
}
|
|
1104
1175
|
|
|
1105
1176
|
override async visitRightPadded<T extends J | boolean>(right: J.RightPadded<T>, q: RpcReceiveQueue): Promise<J.RightPadded<T>> {
|
|
1106
|
-
return this.
|
|
1177
|
+
return this.delegate.visitRightPadded(right, q)
|
|
1107
1178
|
}
|
|
1108
1179
|
|
|
1109
1180
|
async visitLeftPadded<T extends J | J.Space | number | string | boolean>(left: J.LeftPadded<T>, q: RpcReceiveQueue): Promise<J.LeftPadded<T>> {
|
|
1110
|
-
return this.
|
|
1181
|
+
return this.delegate.visitLeftPadded(left, q);
|
|
1111
1182
|
}
|
|
1112
1183
|
|
|
1113
1184
|
async visitContainer<T extends J>(container: J.Container<T>, q: RpcReceiveQueue): Promise<J.Container<T>> {
|
|
1114
|
-
return this.
|
|
1185
|
+
return this.delegate.visitContainer(container, q);
|
|
1115
1186
|
}
|
|
1116
1187
|
|
|
1117
1188
|
override async visitSpace(space: J.Space, q: RpcReceiveQueue): Promise<J.Space> {
|
|
1118
|
-
return this.
|
|
1189
|
+
return this.delegate.visitSpace(space, q);
|
|
1119
1190
|
}
|
|
1120
1191
|
|
|
1121
1192
|
override async visitType(javaType: Type | undefined, q: RpcReceiveQueue): Promise<Type | undefined> {
|
|
1122
|
-
return this.
|
|
1193
|
+
return this.delegate.visitType(javaType, q);
|
|
1123
1194
|
}
|
|
1124
1195
|
}
|
|
1125
1196
|
|
|
1126
|
-
class
|
|
1197
|
+
class JavaScriptDelegateReceiver extends JavaReceiver {
|
|
1127
1198
|
private javascriptReceiver: JavaScriptReceiver;
|
|
1128
1199
|
|
|
1129
1200
|
constructor(javascriptReceiver: JavaScriptReceiver) {
|