@openrewrite/rewrite 8.66.1 → 8.66.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/tree.d.ts +10 -1
- package/dist/java/tree.d.ts.map +1 -1
- package/dist/java/tree.js +21 -5
- package/dist/java/tree.js.map +1 -1
- package/dist/java/type-visitor.d.ts +1 -1
- package/dist/java/type-visitor.d.ts.map +1 -1
- package/dist/java/visitor.d.ts +2 -2
- package/dist/java/visitor.d.ts.map +1 -1
- package/dist/java/visitor.js +8 -2
- package/dist/java/visitor.js.map +1 -1
- package/dist/javascript/assertions.d.ts +6 -0
- package/dist/javascript/assertions.d.ts.map +1 -1
- package/dist/javascript/assertions.js +14 -6
- package/dist/javascript/assertions.js.map +1 -1
- package/dist/javascript/comparator.d.ts +154 -7
- package/dist/javascript/comparator.d.ts.map +1 -1
- package/dist/javascript/comparator.js +623 -180
- package/dist/javascript/comparator.js.map +1 -1
- package/dist/javascript/format.d.ts +5 -3
- package/dist/javascript/format.d.ts.map +1 -1
- package/dist/javascript/format.js +85 -43
- package/dist/javascript/format.js.map +1 -1
- package/dist/javascript/index.d.ts +1 -0
- package/dist/javascript/index.d.ts.map +1 -1
- package/dist/javascript/index.js +1 -0
- package/dist/javascript/index.js.map +1 -1
- package/dist/javascript/parser.d.ts +2 -1
- package/dist/javascript/parser.d.ts.map +1 -1
- package/dist/javascript/parser.js +39 -30
- package/dist/javascript/parser.js.map +1 -1
- package/dist/javascript/templating/capture.d.ts +81 -14
- package/dist/javascript/templating/capture.d.ts.map +1 -1
- package/dist/javascript/templating/capture.js +98 -8
- package/dist/javascript/templating/capture.js.map +1 -1
- package/dist/javascript/templating/comparator.d.ts +125 -15
- package/dist/javascript/templating/comparator.d.ts.map +1 -1
- package/dist/javascript/templating/comparator.js +946 -118
- package/dist/javascript/templating/comparator.js.map +1 -1
- package/dist/javascript/templating/engine.d.ts +58 -25
- package/dist/javascript/templating/engine.d.ts.map +1 -1
- package/dist/javascript/templating/engine.js +527 -94
- package/dist/javascript/templating/engine.js.map +1 -1
- package/dist/javascript/templating/index.d.ts +3 -3
- package/dist/javascript/templating/index.d.ts.map +1 -1
- package/dist/javascript/templating/index.js +3 -1
- package/dist/javascript/templating/index.js.map +1 -1
- package/dist/javascript/templating/pattern.d.ts +121 -16
- package/dist/javascript/templating/pattern.d.ts.map +1 -1
- package/dist/javascript/templating/pattern.js +528 -257
- package/dist/javascript/templating/pattern.js.map +1 -1
- package/dist/javascript/templating/placeholder-replacement.d.ts +30 -5
- package/dist/javascript/templating/placeholder-replacement.d.ts.map +1 -1
- package/dist/javascript/templating/placeholder-replacement.js +183 -81
- package/dist/javascript/templating/placeholder-replacement.js.map +1 -1
- package/dist/javascript/templating/rewrite.d.ts +56 -11
- package/dist/javascript/templating/rewrite.d.ts.map +1 -1
- package/dist/javascript/templating/rewrite.js +143 -16
- package/dist/javascript/templating/rewrite.js.map +1 -1
- package/dist/javascript/templating/template.d.ts +31 -5
- package/dist/javascript/templating/template.d.ts.map +1 -1
- package/dist/javascript/templating/template.js +89 -15
- package/dist/javascript/templating/template.js.map +1 -1
- package/dist/javascript/templating/types.d.ts +359 -12
- package/dist/javascript/templating/types.d.ts.map +1 -1
- package/dist/javascript/templating/utils.d.ts +52 -35
- package/dist/javascript/templating/utils.d.ts.map +1 -1
- package/dist/javascript/templating/utils.js +107 -109
- package/dist/javascript/templating/utils.js.map +1 -1
- package/dist/javascript/type-mapping.d.ts.map +1 -1
- package/dist/javascript/type-mapping.js +21 -11
- package/dist/javascript/type-mapping.js.map +1 -1
- package/dist/json/rpc.js +2 -2
- package/dist/json/rpc.js.map +1 -1
- package/dist/recipe/order-imports.js.map +1 -1
- package/dist/test/rewrite-test.d.ts.map +1 -1
- package/dist/test/rewrite-test.js +10 -6
- package/dist/test/rewrite-test.js.map +1 -1
- package/dist/version.txt +1 -1
- package/dist/visitor.d.ts +4 -4
- package/dist/visitor.d.ts.map +1 -1
- package/dist/visitor.js +8 -3
- package/dist/visitor.js.map +1 -1
- package/package.json +4 -2
- package/src/java/tree.ts +10 -3
- package/src/java/type-visitor.ts +1 -1
- package/src/java/visitor.ts +11 -5
- package/src/javascript/assertions.ts +9 -3
- package/src/javascript/comparator.ts +676 -185
- package/src/javascript/format.ts +72 -34
- package/src/javascript/index.ts +1 -0
- package/src/javascript/parser.ts +51 -31
- package/src/javascript/templating/capture.ts +107 -15
- package/src/javascript/templating/comparator.ts +1087 -134
- package/src/javascript/templating/engine.ts +601 -103
- package/src/javascript/templating/index.ts +9 -2
- package/src/javascript/templating/pattern.ts +655 -281
- package/src/javascript/templating/placeholder-replacement.ts +183 -80
- package/src/javascript/templating/rewrite.ts +152 -18
- package/src/javascript/templating/template.ts +110 -22
- package/src/javascript/templating/types.ts +386 -12
- package/src/javascript/templating/utils.ts +116 -102
- package/src/javascript/type-mapping.ts +20 -11
- package/src/json/rpc.ts +2 -2
- package/src/recipe/order-imports.ts +1 -1
- package/src/test/rewrite-test.ts +12 -7
- package/src/visitor.ts +14 -6
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Cursor } from '../..';
|
|
2
|
+
import { J, Type } from '../../java';
|
|
3
|
+
import { Any, Capture, CaptureOptions, ConstraintFunction, TemplateParam, VariadicOptions } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* Combines multiple constraints with AND logic.
|
|
5
6
|
* All constraints must return true for the combined constraint to pass.
|
|
@@ -13,7 +14,7 @@ import { Capture, Any, TemplateParam, CaptureOptions, VariadicOptions } from './
|
|
|
13
14
|
* )
|
|
14
15
|
* });
|
|
15
16
|
*/
|
|
16
|
-
export declare function and<T>(...constraints: ((node: T) => boolean)[]): (node: T) => boolean;
|
|
17
|
+
export declare function and<T>(...constraints: ((node: T, cursor?: Cursor) => boolean)[]): (node: T, cursor?: Cursor) => boolean;
|
|
17
18
|
/**
|
|
18
19
|
* Combines multiple constraints with OR logic.
|
|
19
20
|
* At least one constraint must return true for the combined constraint to pass.
|
|
@@ -26,7 +27,7 @@ export declare function and<T>(...constraints: ((node: T) => boolean)[]): (node:
|
|
|
26
27
|
* )
|
|
27
28
|
* });
|
|
28
29
|
*/
|
|
29
|
-
export declare function or<T>(...constraints: ((node: T) => boolean)[]): (node: T) => boolean;
|
|
30
|
+
export declare function or<T>(...constraints: ((node: T, cursor?: Cursor) => boolean)[]): (node: T, cursor?: Cursor) => boolean;
|
|
30
31
|
/**
|
|
31
32
|
* Negates a constraint.
|
|
32
33
|
* Returns true when the constraint returns false, and vice versa.
|
|
@@ -36,23 +37,27 @@ export declare function or<T>(...constraints: ((node: T) => boolean)[]): (node:
|
|
|
36
37
|
* constraint: not((node) => typeof node.value === 'string')
|
|
37
38
|
* });
|
|
38
39
|
*/
|
|
39
|
-
export declare function not<T>(constraint: (node: T) => boolean): (node: T) => boolean;
|
|
40
|
+
export declare function not<T>(constraint: (node: T, cursor?: Cursor) => boolean): (node: T, cursor?: Cursor) => boolean;
|
|
40
41
|
export declare const CAPTURE_NAME_SYMBOL: unique symbol;
|
|
41
42
|
export declare const CAPTURE_VARIADIC_SYMBOL: unique symbol;
|
|
42
43
|
export declare const CAPTURE_CONSTRAINT_SYMBOL: unique symbol;
|
|
43
44
|
export declare const CAPTURE_CAPTURING_SYMBOL: unique symbol;
|
|
45
|
+
export declare const CAPTURE_TYPE_SYMBOL: unique symbol;
|
|
46
|
+
export declare const RAW_CODE_SYMBOL: unique symbol;
|
|
44
47
|
export declare class CaptureImpl<T = any> implements Capture<T> {
|
|
45
48
|
readonly name: string;
|
|
46
49
|
[CAPTURE_NAME_SYMBOL]: string;
|
|
47
50
|
[CAPTURE_VARIADIC_SYMBOL]: VariadicOptions | undefined;
|
|
48
|
-
[CAPTURE_CONSTRAINT_SYMBOL]:
|
|
51
|
+
[CAPTURE_CONSTRAINT_SYMBOL]: ConstraintFunction<T> | undefined;
|
|
49
52
|
[CAPTURE_CAPTURING_SYMBOL]: boolean;
|
|
53
|
+
[CAPTURE_TYPE_SYMBOL]: string | Type | undefined;
|
|
50
54
|
constructor(name: string, options?: CaptureOptions<T>, capturing?: boolean);
|
|
51
55
|
getName(): string;
|
|
52
56
|
isVariadic(): boolean;
|
|
53
57
|
getVariadicOptions(): VariadicOptions | undefined;
|
|
54
|
-
getConstraint():
|
|
58
|
+
getConstraint(): ConstraintFunction<T> | undefined;
|
|
55
59
|
isCapturing(): boolean;
|
|
60
|
+
getType(): string | Type | undefined;
|
|
56
61
|
}
|
|
57
62
|
export declare class TemplateParamImpl<T = any> implements TemplateParam<T> {
|
|
58
63
|
readonly name: string;
|
|
@@ -85,16 +90,13 @@ export declare class CaptureValue {
|
|
|
85
90
|
*/
|
|
86
91
|
isArrayExpansion(): boolean;
|
|
87
92
|
}
|
|
88
|
-
export declare function capture<T = any>(options: {
|
|
89
|
-
name?: string;
|
|
90
|
-
constraint: (node: T) => boolean;
|
|
91
|
-
} & {
|
|
93
|
+
export declare function capture<T = any>(options: CaptureOptions<T> & {
|
|
92
94
|
variadic?: never;
|
|
93
95
|
}): Capture<T> & T;
|
|
94
96
|
export declare function capture<T = any>(options: {
|
|
95
97
|
name?: string;
|
|
96
98
|
variadic: true | VariadicOptions;
|
|
97
|
-
constraint?:
|
|
99
|
+
constraint?: ConstraintFunction<T[]>;
|
|
98
100
|
min?: number;
|
|
99
101
|
max?: number;
|
|
100
102
|
}): Capture<T[]> & T[];
|
|
@@ -153,13 +155,13 @@ export declare namespace capture {
|
|
|
153
155
|
* const pat = pattern`sum(${numericArgs})`;
|
|
154
156
|
*/
|
|
155
157
|
export declare function any<T = any>(options: {
|
|
156
|
-
constraint:
|
|
158
|
+
constraint: ConstraintFunction<T>;
|
|
157
159
|
} & {
|
|
158
160
|
variadic?: never;
|
|
159
161
|
}): Any<T> & T;
|
|
160
162
|
export declare function any<T = any>(options: {
|
|
161
163
|
variadic: true | VariadicOptions;
|
|
162
|
-
constraint?:
|
|
164
|
+
constraint?: ConstraintFunction<T[]>;
|
|
163
165
|
min?: number;
|
|
164
166
|
max?: number;
|
|
165
167
|
}): Any<T[]> & T[];
|
|
@@ -211,6 +213,71 @@ export declare namespace any {
|
|
|
211
213
|
* template`console.log(${node.name})` // Error! Use capture() for property access
|
|
212
214
|
*/
|
|
213
215
|
export declare function param<T = any>(name?: string): TemplateParam<T>;
|
|
216
|
+
/**
|
|
217
|
+
* Represents raw code that should be inserted verbatim into templates at construction time.
|
|
218
|
+
* This is useful for dynamic code generation where the code structure is determined at runtime.
|
|
219
|
+
*/
|
|
220
|
+
export declare class RawCode {
|
|
221
|
+
readonly code: string;
|
|
222
|
+
[RAW_CODE_SYMBOL]: boolean;
|
|
223
|
+
constructor(code: string);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Creates a raw code specification for inserting literal code strings into templates.
|
|
227
|
+
*
|
|
228
|
+
* Use `raw()` when you need to insert code that is generated dynamically (e.g., from recipe options,
|
|
229
|
+
* computed field names, or programmatic string manipulation) directly into a template at construction time.
|
|
230
|
+
*
|
|
231
|
+
* The string is spliced into the template before parsing, so it becomes part of the template's AST.
|
|
232
|
+
* This is different from `param()` or `capture()` which are placeholders replaced during application.
|
|
233
|
+
*
|
|
234
|
+
* @param code The code string to insert verbatim into the template
|
|
235
|
+
* @returns A RawCode object that will be spliced into the template
|
|
236
|
+
*
|
|
237
|
+
* @remarks
|
|
238
|
+
* **When to use `raw()` vs `param()` vs `capture()`:**
|
|
239
|
+
*
|
|
240
|
+
* - Use `raw()` when you have a **code string** to insert at **template construction time**
|
|
241
|
+
* - Use `param()` when you have an **AST node** to substitute at **template application time**
|
|
242
|
+
* - Use `capture()` when working with **pattern matching** and need to reference matched values
|
|
243
|
+
*
|
|
244
|
+
* **Safety Considerations:**
|
|
245
|
+
* - No validation is performed on the code string
|
|
246
|
+
* - The code must be syntactically valid at the position where it's inserted
|
|
247
|
+
* - Recipe authors are trusted to provide valid code
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* // Recipe option determines the log level
|
|
251
|
+
* class MyRecipe extends Recipe {
|
|
252
|
+
* @Option
|
|
253
|
+
* logLevel: string = "info";
|
|
254
|
+
*
|
|
255
|
+
* getVisitor() {
|
|
256
|
+
* // Template constructed with dynamic method name
|
|
257
|
+
* const replacement = template`logger.${raw(this.logLevel)}(${_('msg')})`;
|
|
258
|
+
* // Produces: logger.info(...) or logger.warn(...) etc.
|
|
259
|
+
* }
|
|
260
|
+
* }
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* // Build object literal from collected field names
|
|
264
|
+
* const fields = ["userId", "timestamp", "status"];
|
|
265
|
+
* template`{ ${raw(fields.join(', '))} }`
|
|
266
|
+
* // Produces: { userId, timestamp, status }
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* // Dynamic import path
|
|
270
|
+
* const modulePath = "./utils";
|
|
271
|
+
* template`import { helper } from ${raw(`'${modulePath}'`)}`
|
|
272
|
+
* // Produces: import { helper } from './utils'
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* // Configurable operator
|
|
276
|
+
* const operator = ">=";
|
|
277
|
+
* template`${_('value')} ${raw(operator)} threshold`
|
|
278
|
+
* // Produces: value >= threshold
|
|
279
|
+
*/
|
|
280
|
+
export declare function raw(code: string): RawCode;
|
|
214
281
|
/**
|
|
215
282
|
* Concise alias for `capture`. Works well for inline captures in patterns and templates.
|
|
216
283
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../src/javascript/templating/capture.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../src/javascript/templating/capture.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,MAAM,EAAC,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAC,CAAC,EAAE,IAAI,EAAC,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,GAAG,EAAE,OAAO,EAA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,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAChH,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;AAGlB,wBAAgB,GAAG,CAAC,CAAC,GAAG,GAAG,EACvB,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GAC5B,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;yBAFE,GAAG;;;AAenB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,KAAK,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAG9D;AAED;;;GAGG;AACH,qBAAa,OAAO;aAGY,IAAI,EAAE,MAAM;IAFxC,CAAC,eAAe,CAAC,UAAQ;gBAEG,IAAI,EAAE,MAAM;CAC3C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,CAAC,gBAAU,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._ = exports.CaptureValue = exports.TemplateParamImpl = exports.CaptureImpl = exports.CAPTURE_CAPTURING_SYMBOL = exports.CAPTURE_CONSTRAINT_SYMBOL = exports.CAPTURE_VARIADIC_SYMBOL = exports.CAPTURE_NAME_SYMBOL = void 0;
|
|
4
|
+
exports._ = exports.RawCode = exports.CaptureValue = exports.TemplateParamImpl = exports.CaptureImpl = exports.RAW_CODE_SYMBOL = exports.CAPTURE_TYPE_SYMBOL = exports.CAPTURE_CAPTURING_SYMBOL = exports.CAPTURE_CONSTRAINT_SYMBOL = exports.CAPTURE_VARIADIC_SYMBOL = exports.CAPTURE_NAME_SYMBOL = void 0;
|
|
4
5
|
exports.and = and;
|
|
5
6
|
exports.or = or;
|
|
6
7
|
exports.not = not;
|
|
7
8
|
exports.capture = capture;
|
|
8
9
|
exports.any = any;
|
|
9
10
|
exports.param = param;
|
|
11
|
+
exports.raw = raw;
|
|
10
12
|
/**
|
|
11
13
|
* Combines multiple constraints with AND logic.
|
|
12
14
|
* All constraints must return true for the combined constraint to pass.
|
|
@@ -21,7 +23,7 @@ exports.param = param;
|
|
|
21
23
|
* });
|
|
22
24
|
*/
|
|
23
25
|
function and(...constraints) {
|
|
24
|
-
return (node) => constraints.every(c => c(node));
|
|
26
|
+
return (node, cursor) => constraints.every(c => c(node, cursor));
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* Combines multiple constraints with OR logic.
|
|
@@ -36,7 +38,7 @@ function and(...constraints) {
|
|
|
36
38
|
* });
|
|
37
39
|
*/
|
|
38
40
|
function or(...constraints) {
|
|
39
|
-
return (node) => constraints.some(c => c(node));
|
|
41
|
+
return (node, cursor) => constraints.some(c => c(node, cursor));
|
|
40
42
|
}
|
|
41
43
|
/**
|
|
42
44
|
* Negates a constraint.
|
|
@@ -48,7 +50,7 @@ function or(...constraints) {
|
|
|
48
50
|
* });
|
|
49
51
|
*/
|
|
50
52
|
function not(constraint) {
|
|
51
|
-
return (node) => !constraint(node);
|
|
53
|
+
return (node, cursor) => !constraint(node, cursor);
|
|
52
54
|
}
|
|
53
55
|
// Symbol to access the internal capture name without triggering Proxy
|
|
54
56
|
exports.CAPTURE_NAME_SYMBOL = Symbol('captureName');
|
|
@@ -58,6 +60,10 @@ exports.CAPTURE_VARIADIC_SYMBOL = Symbol('captureVariadic');
|
|
|
58
60
|
exports.CAPTURE_CONSTRAINT_SYMBOL = Symbol('captureConstraint');
|
|
59
61
|
// Symbol to access capturing flag without triggering Proxy
|
|
60
62
|
exports.CAPTURE_CAPTURING_SYMBOL = Symbol('captureCapturing');
|
|
63
|
+
// Symbol to access type information without triggering Proxy
|
|
64
|
+
exports.CAPTURE_TYPE_SYMBOL = Symbol('captureType');
|
|
65
|
+
// Symbol to identify RawCode instances
|
|
66
|
+
exports.RAW_CODE_SYMBOL = Symbol('rawCode');
|
|
61
67
|
class CaptureImpl {
|
|
62
68
|
constructor(name, options, capturing = true) {
|
|
63
69
|
this.name = name;
|
|
@@ -79,6 +85,10 @@ class CaptureImpl {
|
|
|
79
85
|
if (options === null || options === void 0 ? void 0 : options.constraint) {
|
|
80
86
|
this[exports.CAPTURE_CONSTRAINT_SYMBOL] = options.constraint;
|
|
81
87
|
}
|
|
88
|
+
// Store type if provided
|
|
89
|
+
if (options === null || options === void 0 ? void 0 : options.type) {
|
|
90
|
+
this[exports.CAPTURE_TYPE_SYMBOL] = options.type;
|
|
91
|
+
}
|
|
82
92
|
}
|
|
83
93
|
getName() {
|
|
84
94
|
return this[exports.CAPTURE_NAME_SYMBOL];
|
|
@@ -95,6 +105,9 @@ class CaptureImpl {
|
|
|
95
105
|
isCapturing() {
|
|
96
106
|
return this[exports.CAPTURE_CAPTURING_SYMBOL];
|
|
97
107
|
}
|
|
108
|
+
getType() {
|
|
109
|
+
return this[exports.CAPTURE_TYPE_SYMBOL];
|
|
110
|
+
}
|
|
98
111
|
}
|
|
99
112
|
exports.CaptureImpl = CaptureImpl;
|
|
100
113
|
class TemplateParamImpl {
|
|
@@ -151,11 +164,11 @@ class CaptureValue {
|
|
|
151
164
|
* Checks if this CaptureValue will resolve to an array that should be expanded.
|
|
152
165
|
*/
|
|
153
166
|
isArrayExpansion() {
|
|
154
|
-
var
|
|
167
|
+
var _b, _c, _d;
|
|
155
168
|
// Only slice operations and the root variadic capture return arrays
|
|
156
|
-
return ((
|
|
169
|
+
return ((_b = this.arrayOperation) === null || _b === void 0 ? void 0 : _b.type) === 'slice' ||
|
|
157
170
|
(this.arrayOperation === undefined && this.propertyPath.length === 0 &&
|
|
158
|
-
((
|
|
171
|
+
((_d = (_c = this.rootCapture).isVariadic) === null || _d === void 0 ? void 0 : _d.call(_c)));
|
|
159
172
|
}
|
|
160
173
|
}
|
|
161
174
|
exports.CaptureValue = CaptureValue;
|
|
@@ -251,8 +264,15 @@ function createCaptureProxy(impl) {
|
|
|
251
264
|
if (prop === exports.CAPTURE_CAPTURING_SYMBOL) {
|
|
252
265
|
return target[exports.CAPTURE_CAPTURING_SYMBOL];
|
|
253
266
|
}
|
|
267
|
+
if (prop === exports.CAPTURE_TYPE_SYMBOL) {
|
|
268
|
+
return target[exports.CAPTURE_TYPE_SYMBOL];
|
|
269
|
+
}
|
|
270
|
+
// Support using Capture as object key via computed properties {[x]: value}
|
|
271
|
+
if (prop === Symbol.toPrimitive || prop === 'toString' || prop === 'valueOf') {
|
|
272
|
+
return () => target[exports.CAPTURE_NAME_SYMBOL];
|
|
273
|
+
}
|
|
254
274
|
// Allow methods to be called directly on the target
|
|
255
|
-
if (prop === 'getName' || prop === 'isVariadic' || prop === 'getVariadicOptions' || prop === 'getConstraint' || prop === 'isCapturing') {
|
|
275
|
+
if (prop === 'getName' || prop === 'isVariadic' || prop === 'getVariadicOptions' || prop === 'getConstraint' || prop === 'isCapturing' || prop === 'getType') {
|
|
256
276
|
return target[prop].bind(target);
|
|
257
277
|
}
|
|
258
278
|
// For variadic captures, support array-like operations
|
|
@@ -356,6 +376,76 @@ function param(name) {
|
|
|
356
376
|
const paramName = name || `unnamed_${capture.nextUnnamedId++}`;
|
|
357
377
|
return new TemplateParamImpl(paramName);
|
|
358
378
|
}
|
|
379
|
+
/**
|
|
380
|
+
* Represents raw code that should be inserted verbatim into templates at construction time.
|
|
381
|
+
* This is useful for dynamic code generation where the code structure is determined at runtime.
|
|
382
|
+
*/
|
|
383
|
+
class RawCode {
|
|
384
|
+
constructor(code) {
|
|
385
|
+
this.code = code;
|
|
386
|
+
this[_a] = true;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
exports.RawCode = RawCode;
|
|
390
|
+
_a = exports.RAW_CODE_SYMBOL;
|
|
391
|
+
/**
|
|
392
|
+
* Creates a raw code specification for inserting literal code strings into templates.
|
|
393
|
+
*
|
|
394
|
+
* Use `raw()` when you need to insert code that is generated dynamically (e.g., from recipe options,
|
|
395
|
+
* computed field names, or programmatic string manipulation) directly into a template at construction time.
|
|
396
|
+
*
|
|
397
|
+
* The string is spliced into the template before parsing, so it becomes part of the template's AST.
|
|
398
|
+
* This is different from `param()` or `capture()` which are placeholders replaced during application.
|
|
399
|
+
*
|
|
400
|
+
* @param code The code string to insert verbatim into the template
|
|
401
|
+
* @returns A RawCode object that will be spliced into the template
|
|
402
|
+
*
|
|
403
|
+
* @remarks
|
|
404
|
+
* **When to use `raw()` vs `param()` vs `capture()`:**
|
|
405
|
+
*
|
|
406
|
+
* - Use `raw()` when you have a **code string** to insert at **template construction time**
|
|
407
|
+
* - Use `param()` when you have an **AST node** to substitute at **template application time**
|
|
408
|
+
* - Use `capture()` when working with **pattern matching** and need to reference matched values
|
|
409
|
+
*
|
|
410
|
+
* **Safety Considerations:**
|
|
411
|
+
* - No validation is performed on the code string
|
|
412
|
+
* - The code must be syntactically valid at the position where it's inserted
|
|
413
|
+
* - Recipe authors are trusted to provide valid code
|
|
414
|
+
*
|
|
415
|
+
* @example
|
|
416
|
+
* // Recipe option determines the log level
|
|
417
|
+
* class MyRecipe extends Recipe {
|
|
418
|
+
* @Option
|
|
419
|
+
* logLevel: string = "info";
|
|
420
|
+
*
|
|
421
|
+
* getVisitor() {
|
|
422
|
+
* // Template constructed with dynamic method name
|
|
423
|
+
* const replacement = template`logger.${raw(this.logLevel)}(${_('msg')})`;
|
|
424
|
+
* // Produces: logger.info(...) or logger.warn(...) etc.
|
|
425
|
+
* }
|
|
426
|
+
* }
|
|
427
|
+
*
|
|
428
|
+
* @example
|
|
429
|
+
* // Build object literal from collected field names
|
|
430
|
+
* const fields = ["userId", "timestamp", "status"];
|
|
431
|
+
* template`{ ${raw(fields.join(', '))} }`
|
|
432
|
+
* // Produces: { userId, timestamp, status }
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* // Dynamic import path
|
|
436
|
+
* const modulePath = "./utils";
|
|
437
|
+
* template`import { helper } from ${raw(`'${modulePath}'`)}`
|
|
438
|
+
* // Produces: import { helper } from './utils'
|
|
439
|
+
*
|
|
440
|
+
* @example
|
|
441
|
+
* // Configurable operator
|
|
442
|
+
* const operator = ">=";
|
|
443
|
+
* template`${_('value')} ${raw(operator)} threshold`
|
|
444
|
+
* // Produces: value >= threshold
|
|
445
|
+
*/
|
|
446
|
+
function raw(code) {
|
|
447
|
+
return new RawCode(code);
|
|
448
|
+
}
|
|
359
449
|
/**
|
|
360
450
|
* Concise alias for `capture`. Works well for inline captures in patterns and templates.
|
|
361
451
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../../src/javascript/templating/capture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../../src/javascript/templating/capture.ts"],"names":[],"mappings":";;;;AAgCA,kBAEC;AAcD,gBAEC;AAWD,kBAEC;AAgTD,0BAkBC;AAuED,kBAKC;AAgDD,sBAGC;AAmED,kBAEC;AAljBD;;;;;;;;;;;;GAYG;AACH,SAAgB,GAAG,CAAI,GAAG,WAAsD;IAC5E,OAAO,CAAC,IAAO,EAAE,MAAe,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AACjF,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,EAAE,CAAI,GAAG,WAAsD;IAC3E,OAAO,CAAC,IAAO,EAAE,MAAe,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AAChF,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,GAAG,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AQ,GAAG,QAAQ,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC;IAC5C,MAAM,IAAI,GAAG,IAAI,WAAW,CAAI,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,oBAAoB;IAE/E,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,kFAAkF;AAClF,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,SAAgB,KAAK,CAAU,IAAa;IACxC,MAAM,SAAS,GAAG,IAAI,IAAI,WAAW,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;IAC/D,OAAO,IAAI,iBAAiB,CAAI,SAAS,CAAC,CAAC;AAC/C,CAAC;AAED;;;GAGG;AACH,MAAa,OAAO;IAGhB,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;QAFxC,QAAiB,GAAG,IAAI,CAAC;IAEkB,CAAC;CAC/C;AAJD,0BAIC;KAHI,uBAAe;AAKpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,SAAgB,GAAG,CAAC,IAAY;IAC5B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;;;;;GAUG;AACU,QAAA,CAAC,GAAG,OAAO,CAAC"}
|
|
@@ -2,27 +2,76 @@ import { Cursor, Tree } from '../..';
|
|
|
2
2
|
import { J } from '../../java';
|
|
3
3
|
import { JS } from '../index';
|
|
4
4
|
import { JavaScriptSemanticComparatorVisitor } from '../comparator';
|
|
5
|
-
import { CaptureStorageValue } from './utils';
|
|
5
|
+
import { CaptureMarker, CaptureStorageValue } from './utils';
|
|
6
|
+
import { DebugLogEntry, MatchExplanation } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* Debug callbacks for pattern matching.
|
|
9
|
+
* These are always used together - either all present or all absent.
|
|
10
|
+
* Part of Layer 1 (Core Instrumentation).
|
|
11
|
+
*/
|
|
12
|
+
export interface DebugCallbacks {
|
|
13
|
+
log: (level: DebugLogEntry['level'], scope: DebugLogEntry['scope'], message: string, data?: any) => void;
|
|
14
|
+
setExplanation: (reason: MatchExplanation['reason'], expected: string, actual: string, details?: string) => void;
|
|
15
|
+
getExplanation: () => MatchExplanation | undefined;
|
|
16
|
+
restoreExplanation: (explanation: MatchExplanation) => void;
|
|
17
|
+
clearExplanation: () => void;
|
|
18
|
+
pushPath: (name: string) => void;
|
|
19
|
+
popPath: () => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Snapshot of matcher state for backtracking.
|
|
23
|
+
* Includes both capture storage and debug state.
|
|
24
|
+
*/
|
|
25
|
+
export interface MatcherState {
|
|
26
|
+
storage: Map<string, CaptureStorageValue>;
|
|
27
|
+
debugState?: {
|
|
28
|
+
explanation?: MatchExplanation;
|
|
29
|
+
logLength: number;
|
|
30
|
+
path: string[];
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Callbacks for the matcher (debug and capture handling).
|
|
35
|
+
* Part of Layer 1 (Core Instrumentation).
|
|
36
|
+
*/
|
|
37
|
+
export interface MatcherCallbacks {
|
|
38
|
+
handleCapture: (capture: CaptureMarker, target: J, wrapper?: J.RightPadded<J>) => boolean;
|
|
39
|
+
handleVariadicCapture: (capture: CaptureMarker, targets: J[], wrappers?: J.RightPadded<J>[]) => boolean;
|
|
40
|
+
saveState: () => MatcherState;
|
|
41
|
+
restoreState: (state: MatcherState) => void;
|
|
42
|
+
debug?: DebugCallbacks;
|
|
43
|
+
}
|
|
6
44
|
/**
|
|
7
45
|
* A comparator for pattern matching that is lenient about optional properties.
|
|
8
46
|
* Allows patterns without type annotations to match actual code with type annotations.
|
|
9
47
|
* Uses semantic comparison to match semantically equivalent code (e.g., isDate() and util.isDate()).
|
|
10
48
|
*/
|
|
11
49
|
export declare class PatternMatchingComparator extends JavaScriptSemanticComparatorVisitor {
|
|
12
|
-
|
|
13
|
-
constructor(matcher:
|
|
14
|
-
handleCapture: (pattern: J, target: J, wrapper?: J.RightPadded<J>) => boolean;
|
|
15
|
-
handleVariadicCapture: (pattern: J, targets: J[], wrappers?: J.RightPadded<J>[]) => boolean;
|
|
16
|
-
saveState: () => Map<string, CaptureStorageValue>;
|
|
17
|
-
restoreState: (state: Map<string, CaptureStorageValue>) => void;
|
|
18
|
-
}, lenientTypeMatching?: boolean);
|
|
19
|
-
/**
|
|
20
|
-
* Extracts the wrapper from the cursor if the parent is a RightPadded.
|
|
21
|
-
*/
|
|
22
|
-
private getWrapperFromCursor;
|
|
50
|
+
protected readonly matcher: MatcherCallbacks;
|
|
51
|
+
constructor(matcher: MatcherCallbacks, lenientTypeMatching?: boolean);
|
|
23
52
|
visit<R extends J>(j: Tree, p: J, parent?: Cursor): Promise<R | undefined>;
|
|
24
53
|
protected hasSameKind(j: J, other: J): boolean;
|
|
25
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Additional specialized abort methods for pattern matching scenarios.
|
|
56
|
+
*/
|
|
57
|
+
protected constraintFailed(captureName: string, targetKind: string): any;
|
|
58
|
+
protected captureConflict(captureName: string): any;
|
|
59
|
+
/**
|
|
60
|
+
* Override visitRightPadded to check if this wrapper has a CaptureMarker.
|
|
61
|
+
* If so, capture the entire wrapper (to preserve markers like semicolons).
|
|
62
|
+
*/
|
|
63
|
+
visitRightPadded<T extends J | boolean>(right: J.RightPadded<T>, p: J): Promise<J.RightPadded<T>>;
|
|
64
|
+
visitContainer<T extends J>(container: J.Container<T>, p: J): Promise<J.Container<T>>;
|
|
65
|
+
/**
|
|
66
|
+
* Visit a single element in a container (for non-variadic matching).
|
|
67
|
+
* Extracted to allow debug subclass to add path tracking.
|
|
68
|
+
*
|
|
69
|
+
* @param element The pattern element
|
|
70
|
+
* @param otherElement The target element
|
|
71
|
+
* @param index The index in the container
|
|
72
|
+
* @returns true if matching should continue, false if it failed
|
|
73
|
+
*/
|
|
74
|
+
protected visitContainerElement<T extends J>(element: J.RightPadded<T>, otherElement: J.RightPadded<T>, index: number): Promise<boolean>;
|
|
26
75
|
visitMethodInvocation(methodInvocation: J.MethodInvocation, other: J): Promise<J | undefined>;
|
|
27
76
|
visitBlock(block: J.Block, other: J): Promise<J | undefined>;
|
|
28
77
|
visitJsCompilationUnit(compilationUnit: JS.CompilationUnit, other: J): Promise<J | undefined>;
|
|
@@ -43,7 +92,7 @@ export declare class PatternMatchingComparator extends JavaScriptSemanticCompara
|
|
|
43
92
|
* @param filterEmpty Whether to filter out J.Empty elements when capturing (true for arguments, false for statements)
|
|
44
93
|
* @returns true if the sequence matches, false otherwise
|
|
45
94
|
*/
|
|
46
|
-
|
|
95
|
+
protected matchSequence(patternElements: J.RightPadded<J>[], targetElements: J.RightPadded<J>[], filterEmpty: boolean): Promise<boolean>;
|
|
47
96
|
/**
|
|
48
97
|
* Optimized sequence matcher with pivot detection and backtracking.
|
|
49
98
|
* For variadic patterns, tries to detect pivots (where next pattern matches) to avoid
|
|
@@ -56,6 +105,67 @@ export declare class PatternMatchingComparator extends JavaScriptSemanticCompara
|
|
|
56
105
|
* @param filterEmpty Whether to filter out J.Empty elements when capturing
|
|
57
106
|
* @returns true if the remaining sequence matches, false otherwise
|
|
58
107
|
*/
|
|
59
|
-
|
|
108
|
+
protected matchSequenceOptimized(patternElements: J.RightPadded<J>[], targetElements: J.RightPadded<J>[], patternIdx: number, targetIdx: number, filterEmpty: boolean): Promise<boolean>;
|
|
109
|
+
/**
|
|
110
|
+
* Visit a single element in a sequence during non-variadic matching.
|
|
111
|
+
* Extracted to allow debug subclass to add path tracking.
|
|
112
|
+
*
|
|
113
|
+
* @param patternWrapper The pattern element
|
|
114
|
+
* @param targetWrapper The target element
|
|
115
|
+
* @param targetIdx The index in the target sequence
|
|
116
|
+
* @returns true if matching succeeded, false otherwise
|
|
117
|
+
*/
|
|
118
|
+
protected visitSequenceElement(patternWrapper: J.RightPadded<J>, targetWrapper: J.RightPadded<J>, targetIdx: number): Promise<boolean>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Debug-instrumented version of PatternMatchingComparator.
|
|
122
|
+
* Overrides methods to add path tracking, logging, and explanation capture.
|
|
123
|
+
* Zero cost when not instantiated - production code uses the base class.
|
|
124
|
+
*/
|
|
125
|
+
export declare class DebugPatternMatchingComparator extends PatternMatchingComparator {
|
|
126
|
+
private get debug();
|
|
127
|
+
/**
|
|
128
|
+
* Extracts the last segment of a kind string (after the last dot).
|
|
129
|
+
* For example: "org.openrewrite.java.tree.J.MethodInvocation" -> "MethodInvocation"
|
|
130
|
+
*/
|
|
131
|
+
private formatKind;
|
|
132
|
+
/**
|
|
133
|
+
* Formats a value for display in error messages.
|
|
134
|
+
*/
|
|
135
|
+
private formatValue;
|
|
136
|
+
/**
|
|
137
|
+
* Override abort to capture explanation when debug is enabled.
|
|
138
|
+
* Only sets explanation on the first abort call (when this.match is still true).
|
|
139
|
+
* This preserves the most specific explanation closest to the actual mismatch.
|
|
140
|
+
*/
|
|
141
|
+
protected abort<T>(t: T, reason?: string, propertyName?: string, expected?: any, actual?: any): T;
|
|
142
|
+
/**
|
|
143
|
+
* Override helper methods to extract detailed context from cursors.
|
|
144
|
+
*/
|
|
145
|
+
protected kindMismatch(): any;
|
|
146
|
+
protected structuralMismatch(propertyName: string): any;
|
|
147
|
+
protected arrayLengthMismatch(propertyName: string): any;
|
|
148
|
+
protected valueMismatch(propertyName?: string, expected?: any, actual?: any): any;
|
|
149
|
+
visit<R extends J>(j: Tree, p: J, parent?: Cursor): Promise<R | undefined>;
|
|
150
|
+
protected visitElement<T extends J>(j: T, other: T): Promise<T>;
|
|
151
|
+
visitRightPadded<T extends J | boolean>(right: J.RightPadded<T>, p: J): Promise<J.RightPadded<T>>;
|
|
152
|
+
visitContainer<T extends J>(container: J.Container<T>, p: J): Promise<J.Container<T>>;
|
|
153
|
+
/**
|
|
154
|
+
* Override visitContainerProperty to add path tracking with property context.
|
|
155
|
+
*/
|
|
156
|
+
protected visitContainerProperty<T extends J>(propertyName: string, container: J.Container<T>, otherContainer: J.Container<T>): Promise<J.Container<T>>;
|
|
157
|
+
/**
|
|
158
|
+
* Override visitRightPaddedProperty to add path tracking with property context.
|
|
159
|
+
*/
|
|
160
|
+
protected visitRightPaddedProperty<T extends J | boolean>(propertyName: string, rightPadded: J.RightPadded<T>, otherRightPadded: J.RightPadded<T>): Promise<J.RightPadded<T>>;
|
|
161
|
+
/**
|
|
162
|
+
* Override visitLeftPaddedProperty to add path tracking with property context.
|
|
163
|
+
*/
|
|
164
|
+
protected visitLeftPaddedProperty<T extends J | J.Space | number | string | boolean>(propertyName: string, leftPadded: J.LeftPadded<T>, otherLeftPadded: J.LeftPadded<T>): Promise<J.LeftPadded<T>>;
|
|
165
|
+
protected visitContainerElement<T extends J>(element: J.RightPadded<T>, otherElement: J.RightPadded<T>, index: number): Promise<boolean>;
|
|
166
|
+
protected visitArrayProperty<T>(parent: J, propertyName: string, array1: T[], array2: T[], visitor: (item1: T, item2: T, index: number) => Promise<void>): Promise<void>;
|
|
167
|
+
protected matchSequence(patternElements: J.RightPadded<J>[], targetElements: J.RightPadded<J>[], filterEmpty: boolean): Promise<boolean>;
|
|
168
|
+
protected visitSequenceElement(patternWrapper: J.RightPadded<J>, targetWrapper: J.RightPadded<J>, targetIdx: number): Promise<boolean>;
|
|
169
|
+
protected matchSequenceOptimized(patternElements: J.RightPadded<J>[], targetElements: J.RightPadded<J>[], patternIdx: number, targetIdx: number, filterEmpty: boolean): Promise<boolean>;
|
|
60
170
|
}
|
|
61
171
|
//# sourceMappingURL=comparator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comparator.d.ts","sourceRoot":"","sources":["../../../src/javascript/templating/comparator.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,OAAO,CAAC;AACnC,OAAO,EAAC,CAAC,E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