diff --git a/tests/fixtures/commands/extract-variable/cli-location-format.expected.ts b/tests/fixtures/commands/extract-variable/cli-location-format.expected.ts index 09d7aed..016df14 100644 --- a/tests/fixtures/commands/extract-variable/cli-location-format.expected.ts +++ b/tests/fixtures/commands/extract-variable/cli-location-format.expected.ts @@ -1,6 +1,6 @@ /** * @description CLI location format fix - validation happens after location is added to options - * @command extract-variable "[cli-location-format.input.ts 6:18-6:23]" --name "sum" + * @command extract-variable "[{{CURRENT_FILE}} 6:18-6:23]" --name "sum" */ function example() { const sum = 2 + 3; diff --git a/tests/fixtures/commands/extract-variable/cli-location-format.input.ts b/tests/fixtures/commands/extract-variable/cli-location-format.input.ts index dc58b1a..c45dd46 100644 --- a/tests/fixtures/commands/extract-variable/cli-location-format.input.ts +++ b/tests/fixtures/commands/extract-variable/cli-location-format.input.ts @@ -1,6 +1,6 @@ /** * @description CLI location format fix - validation happens after location is added to options - * @command extract-variable "[cli-location-format.input.ts 6:18-6:23]" --name "sum" + * @command extract-variable "[{{CURRENT_FILE}} 6:18-6:23]" --name "sum" */ function example() { const result = 2 + 3; diff --git a/tests/fixtures/commands/extract-variable/complex-expression-first-single-occurence.expected.ts b/tests/fixtures/commands/extract-variable/complex-expression-first-single-occurence.expected.ts index da9161d..8272125 100644 --- a/tests/fixtures/commands/extract-variable/complex-expression-first-single-occurence.expected.ts +++ b/tests/fixtures/commands/extract-variable/complex-expression-first-single-occurence.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract first occurrence of a complex expression with method calls - * @command refakts extract-variable "[complex-expression-first-single-occurence.input.ts 7:9-7:32]" --name "upperName" + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:9-7:32]" --name "upperName" */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/complex-expression-first-single-occurence.input.ts b/tests/fixtures/commands/extract-variable/complex-expression-first-single-occurence.input.ts index b5931c6..8d74e05 100644 --- a/tests/fixtures/commands/extract-variable/complex-expression-first-single-occurence.input.ts +++ b/tests/fixtures/commands/extract-variable/complex-expression-first-single-occurence.input.ts @@ -1,6 +1,6 @@ /** * @description Extract first occurrence of a complex expression with method calls - * @command refakts extract-variable "[complex-expression-first-single-occurence.input.ts 7:9-7:32]" --name "upperName" + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:9-7:32]" --name "upperName" */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/complex-expression-last-selected.expected.ts b/tests/fixtures/commands/extract-variable/complex-expression-last-selected.expected.ts index c60c83d..e916ebf 100644 --- a/tests/fixtures/commands/extract-variable/complex-expression-last-selected.expected.ts +++ b/tests/fixtures/commands/extract-variable/complex-expression-last-selected.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract all occurrences when last occurrence is selected - * @command refakts extract-variable "[complex-expression-last-selected.input.ts 10:12-10:35]" --name "upperName" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 10:12-10:35]" --name "upperName" --all */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/complex-expression-last-selected.input.ts b/tests/fixtures/commands/extract-variable/complex-expression-last-selected.input.ts index 98b1d36..d7067ce 100644 --- a/tests/fixtures/commands/extract-variable/complex-expression-last-selected.input.ts +++ b/tests/fixtures/commands/extract-variable/complex-expression-last-selected.input.ts @@ -1,6 +1,6 @@ /** * @description Extract all occurrences when last occurrence is selected - * @command refakts extract-variable "[complex-expression-last-selected.input.ts 10:12-10:35]" --name "upperName" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 10:12-10:35]" --name "upperName" --all */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/complex-expression-last-single-occurence.expected.ts b/tests/fixtures/commands/extract-variable/complex-expression-last-single-occurence.expected.ts index 9a6efbf..6d10d91 100644 --- a/tests/fixtures/commands/extract-variable/complex-expression-last-single-occurence.expected.ts +++ b/tests/fixtures/commands/extract-variable/complex-expression-last-single-occurence.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract last occurrence of a complex expression with method calls - * @command refakts extract-variable "[complex-expression-last-single-occurence.input.ts 10:12-10:35]" --name "upperName" + * @command refakts extract-variable "[{{CURRENT_FILE}} 10:12-10:35]" --name "upperName" */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/complex-expression-last-single-occurence.input.ts b/tests/fixtures/commands/extract-variable/complex-expression-last-single-occurence.input.ts index d7f8029..483061c 100644 --- a/tests/fixtures/commands/extract-variable/complex-expression-last-single-occurence.input.ts +++ b/tests/fixtures/commands/extract-variable/complex-expression-last-single-occurence.input.ts @@ -1,6 +1,6 @@ /** * @description Extract last occurrence of a complex expression with method calls - * @command refakts extract-variable "[complex-expression-last-single-occurence.input.ts 10:12-10:35]" --name "upperName" + * @command refakts extract-variable "[{{CURRENT_FILE}} 10:12-10:35]" --name "upperName" */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/complex-expression.expected.ts b/tests/fixtures/commands/extract-variable/complex-expression.expected.ts index 4f3df6a..f69a718 100644 --- a/tests/fixtures/commands/extract-variable/complex-expression.expected.ts +++ b/tests/fixtures/commands/extract-variable/complex-expression.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract a complex expression with method calls - * @command refakts extract-variable "[complex-expression.input.ts 7:9-7:32]" --name "upperName" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:9-7:32]" --name "upperName" --all */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/complex-expression.input.ts b/tests/fixtures/commands/extract-variable/complex-expression.input.ts index 8af69bd..f8f1fc8 100644 --- a/tests/fixtures/commands/extract-variable/complex-expression.input.ts +++ b/tests/fixtures/commands/extract-variable/complex-expression.input.ts @@ -1,6 +1,6 @@ /** * @description Extract a complex expression with method calls - * @command refakts extract-variable "[complex-expression.input.ts 7:9-7:32]" --name "upperName" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:9-7:32]" --name "upperName" --all */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/conditional-block.expected.ts b/tests/fixtures/commands/extract-variable/conditional-block.expected.ts index c5dd90d..b88c32d 100644 --- a/tests/fixtures/commands/extract-variable/conditional-block.expected.ts +++ b/tests/fixtures/commands/extract-variable/conditional-block.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract variable from inside conditional block - * @command refakts extract-variable "[conditional-block.input.ts 7:7-7:15]" --name "userAge" + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:7-7:15]" --name "userAge" */ function checkAge(user: { age: number }) { diff --git a/tests/fixtures/commands/extract-variable/conditional-block.input.ts b/tests/fixtures/commands/extract-variable/conditional-block.input.ts index 15b796c..aa20b7f 100644 --- a/tests/fixtures/commands/extract-variable/conditional-block.input.ts +++ b/tests/fixtures/commands/extract-variable/conditional-block.input.ts @@ -1,6 +1,6 @@ /** * @description Extract variable from inside conditional block - * @command refakts extract-variable "[conditional-block.input.ts 7:7-7:15]" --name "userAge" + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:7-7:15]" --name "userAge" */ function checkAge(user: { age: number }) { diff --git a/tests/fixtures/commands/extract-variable/extract-variable-holding-function.expected.ts b/tests/fixtures/commands/extract-variable/extract-variable-holding-function.expected.ts index 80bd3d4..1ae9f56 100644 --- a/tests/fixtures/commands/extract-variable/extract-variable-holding-function.expected.ts +++ b/tests/fixtures/commands/extract-variable/extract-variable-holding-function.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract a variable holding just the function, not the return value - * @command refakts extract-variable "[extract-variable-holding-function.input.ts 7:9-7:30]" --name "toUpperCase" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:9-7:30]" --name "toUpperCase" --all */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/extract-variable-holding-function.input.ts b/tests/fixtures/commands/extract-variable/extract-variable-holding-function.input.ts index cedca4d..948bc67 100644 --- a/tests/fixtures/commands/extract-variable/extract-variable-holding-function.input.ts +++ b/tests/fixtures/commands/extract-variable/extract-variable-holding-function.input.ts @@ -1,6 +1,6 @@ /** * @description Extract a variable holding just the function, not the return value - * @command refakts extract-variable "[extract-variable-holding-function.input.ts 7:9-7:30]" --name "toUpperCase" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:9-7:30]" --name "toUpperCase" --all */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/invalid-selection.expected.ts b/tests/fixtures/commands/extract-variable/invalid-selection.expected.ts index beb7b29..d79e6a0 100644 --- a/tests/fixtures/commands/extract-variable/invalid-selection.expected.ts +++ b/tests/fixtures/commands/extract-variable/invalid-selection.expected.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for invalid selection range - * @command extract-variable "[invalid-selection.input.ts 10:1-10:5]" --name extracted + * @command extract-variable "[{{CURRENT_FILE}} 10:1-10:5]" --name extracted * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/extract-variable/invalid-selection.input.ts b/tests/fixtures/commands/extract-variable/invalid-selection.input.ts index beb7b29..d79e6a0 100644 --- a/tests/fixtures/commands/extract-variable/invalid-selection.input.ts +++ b/tests/fixtures/commands/extract-variable/invalid-selection.input.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for invalid selection range - * @command extract-variable "[invalid-selection.input.ts 10:1-10:5]" --name extracted + * @command extract-variable "[{{CURRENT_FILE}} 10:1-10:5]" --name extracted * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/extract-variable/location-simple-expression.expected.ts b/tests/fixtures/commands/extract-variable/location-simple-expression.expected.ts index ee56033..7eb5baa 100644 --- a/tests/fixtures/commands/extract-variable/location-simple-expression.expected.ts +++ b/tests/fixtures/commands/extract-variable/location-simple-expression.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract a binary expression using location format - * @command refakts extract-variable "[location-simple-expression.input.ts 7:10-7:23]" --name "result" + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:10-7:23]" --name "result" */ function calculateArea(width: number, height: number): number { diff --git a/tests/fixtures/commands/extract-variable/location-simple-expression.input.ts b/tests/fixtures/commands/extract-variable/location-simple-expression.input.ts index 542184f..5902114 100644 --- a/tests/fixtures/commands/extract-variable/location-simple-expression.input.ts +++ b/tests/fixtures/commands/extract-variable/location-simple-expression.input.ts @@ -1,6 +1,6 @@ /** * @description Extract a binary expression using location format - * @command refakts extract-variable "[location-simple-expression.input.ts 7:10-7:23]" --name "result" + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:10-7:23]" --name "result" */ function calculateArea(width: number, height: number): number { diff --git a/tests/fixtures/commands/extract-variable/missing-name-option.expected.ts b/tests/fixtures/commands/extract-variable/missing-name-option.expected.ts index 9acf436..6cabc25 100644 --- a/tests/fixtures/commands/extract-variable/missing-name-option.expected.ts +++ b/tests/fixtures/commands/extract-variable/missing-name-option.expected.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for missing --name option - * @command extract-variable "[missing-name-option.input.ts 2:17-2:25]" + * @command extract-variable "[{{CURRENT_FILE}} 2:17-2:25]" * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/extract-variable/missing-name-option.input.ts b/tests/fixtures/commands/extract-variable/missing-name-option.input.ts index 9acf436..6cabc25 100644 --- a/tests/fixtures/commands/extract-variable/missing-name-option.input.ts +++ b/tests/fixtures/commands/extract-variable/missing-name-option.input.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for missing --name option - * @command extract-variable "[missing-name-option.input.ts 2:17-2:25]" + * @command extract-variable "[{{CURRENT_FILE}} 2:17-2:25]" * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/extract-variable/multi-arg-method-call.expected.ts b/tests/fixtures/commands/extract-variable/multi-arg-method-call.expected.ts index a88922e..c5ad52d 100644 --- a/tests/fixtures/commands/extract-variable/multi-arg-method-call.expected.ts +++ b/tests/fixtures/commands/extract-variable/multi-arg-method-call.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract a multi-argument method call - * @command refakts extract-variable "[multi-arg-method-call.input.ts 7:9-7:34]" --name "formattedName" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:9-7:34]" --name "formattedName" --all */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/multi-arg-method-call.input.ts b/tests/fixtures/commands/extract-variable/multi-arg-method-call.input.ts index 180ac04..65f278d 100644 --- a/tests/fixtures/commands/extract-variable/multi-arg-method-call.input.ts +++ b/tests/fixtures/commands/extract-variable/multi-arg-method-call.input.ts @@ -1,6 +1,6 @@ /** * @description Extract a multi-argument method call - * @command refakts extract-variable "[multi-arg-method-call.input.ts 7:9-7:34]" --name "formattedName" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:9-7:34]" --name "formattedName" --all */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/multi-arg-method-reference.expected.ts b/tests/fixtures/commands/extract-variable/multi-arg-method-reference.expected.ts index 1b4044d..12a7060 100644 --- a/tests/fixtures/commands/extract-variable/multi-arg-method-reference.expected.ts +++ b/tests/fixtures/commands/extract-variable/multi-arg-method-reference.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract a multi-argument method reference (without call) - * @command refakts extract-variable "[multi-arg-method-reference.input.ts 7:9-7:28]" --name "substringMethod" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:9-7:28]" --name "substringMethod" --all */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/multi-arg-method-reference.input.ts b/tests/fixtures/commands/extract-variable/multi-arg-method-reference.input.ts index 1945721..7cfdfdb 100644 --- a/tests/fixtures/commands/extract-variable/multi-arg-method-reference.input.ts +++ b/tests/fixtures/commands/extract-variable/multi-arg-method-reference.input.ts @@ -1,6 +1,6 @@ /** * @description Extract a multi-argument method reference (without call) - * @command refakts extract-variable "[multi-arg-method-reference.input.ts 7:9-7:28]" --name "substringMethod" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:9-7:28]" --name "substringMethod" --all */ function processUser(user: { name: string }) { diff --git a/tests/fixtures/commands/extract-variable/multiple-occurrences.expected.ts b/tests/fixtures/commands/extract-variable/multiple-occurrences.expected.ts index b9bf68e..6ee9ccb 100644 --- a/tests/fixtures/commands/extract-variable/multiple-occurrences.expected.ts +++ b/tests/fixtures/commands/extract-variable/multiple-occurrences.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract all occurrences of same expression - * @command refakts extract-variable "[multiple-occurrences.input.ts 7:15-7:20]" --name "product" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:15-7:20]" --name "product" --all */ function calculate(x: number, y: number): number { diff --git a/tests/fixtures/commands/extract-variable/multiple-occurrences.input.ts b/tests/fixtures/commands/extract-variable/multiple-occurrences.input.ts index 3f354b8..f24841a 100644 --- a/tests/fixtures/commands/extract-variable/multiple-occurrences.input.ts +++ b/tests/fixtures/commands/extract-variable/multiple-occurrences.input.ts @@ -1,6 +1,6 @@ /** * @description Extract all occurrences of same expression - * @command refakts extract-variable "[multiple-occurrences.input.ts 7:15-7:20]" --name "product" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:15-7:20]" --name "product" --all */ function calculate(x: number, y: number): number { diff --git a/tests/fixtures/commands/extract-variable/name-conflict.expected.ts b/tests/fixtures/commands/extract-variable/name-conflict.expected.ts index 93c6295..012a8cb 100644 --- a/tests/fixtures/commands/extract-variable/name-conflict.expected.ts +++ b/tests/fixtures/commands/extract-variable/name-conflict.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract variable with non-conflicting name - * @command refakts extract-variable "[name-conflict.input.ts 8:19-8:24]" --name "product" + * @command refakts extract-variable "[{{CURRENT_FILE}} 8:19-8:24]" --name "product" */ function calculate(x: number, y: number): number { diff --git a/tests/fixtures/commands/extract-variable/name-conflict.input.ts b/tests/fixtures/commands/extract-variable/name-conflict.input.ts index 21ec486..ae4ae03 100644 --- a/tests/fixtures/commands/extract-variable/name-conflict.input.ts +++ b/tests/fixtures/commands/extract-variable/name-conflict.input.ts @@ -1,6 +1,6 @@ /** * @description Extract variable with non-conflicting name - * @command refakts extract-variable "[name-conflict.input.ts 8:19-8:24]" --name "product" + * @command refakts extract-variable "[{{CURRENT_FILE}} 8:19-8:24]" --name "product" */ function calculate(x: number, y: number): number { diff --git a/tests/fixtures/commands/extract-variable/nested-calls.expected.ts b/tests/fixtures/commands/extract-variable/nested-calls.expected.ts index 21869a2..cccc033 100644 --- a/tests/fixtures/commands/extract-variable/nested-calls.expected.ts +++ b/tests/fixtures/commands/extract-variable/nested-calls.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract expression from nested function calls - * @command refakts extract-variable "[nested-calls.input.ts 7:29-7:34]" --name "sum" + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:29-7:34]" --name "sum" */ function process(x: number, y: number): number { diff --git a/tests/fixtures/commands/extract-variable/nested-calls.input.ts b/tests/fixtures/commands/extract-variable/nested-calls.input.ts index 92e1af8..c64fe36 100644 --- a/tests/fixtures/commands/extract-variable/nested-calls.input.ts +++ b/tests/fixtures/commands/extract-variable/nested-calls.input.ts @@ -1,6 +1,6 @@ /** * @description Extract expression from nested function calls - * @command refakts extract-variable "[nested-calls.input.ts 7:29-7:34]" --name "sum" + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:29-7:34]" --name "sum" */ function process(x: number, y: number): number { diff --git a/tests/fixtures/commands/extract-variable/non-expression-selection.expected.ts b/tests/fixtures/commands/extract-variable/non-expression-selection.expected.ts index 3969968..4e526a7 100644 --- a/tests/fixtures/commands/extract-variable/non-expression-selection.expected.ts +++ b/tests/fixtures/commands/extract-variable/non-expression-selection.expected.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for selecting non-expression node - * @command extract-variable "[non-expression-selection.input.ts 2:1-2:8]" --name "extracted" + * @command extract-variable "[{{CURRENT_FILE}} 2:1-2:8]" --name "extracted" * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/extract-variable/non-expression-selection.input.ts b/tests/fixtures/commands/extract-variable/non-expression-selection.input.ts index 3969968..4e526a7 100644 --- a/tests/fixtures/commands/extract-variable/non-expression-selection.input.ts +++ b/tests/fixtures/commands/extract-variable/non-expression-selection.input.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for selecting non-expression node - * @command extract-variable "[non-expression-selection.input.ts 2:1-2:8]" --name "extracted" + * @command extract-variable "[{{CURRENT_FILE}} 2:1-2:8]" --name "extracted" * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/extract-variable/scope-isolation.expected.ts b/tests/fixtures/commands/extract-variable/scope-isolation.expected.ts index de99df7..a443ed2 100644 --- a/tests/fixtures/commands/extract-variable/scope-isolation.expected.ts +++ b/tests/fixtures/commands/extract-variable/scope-isolation.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract variable should respect function scope boundaries - * @command refakts extract-variable "[scope-isolation.input.ts 7:10-7:15]" --name "sum" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:10-7:15]" --name "sum" --all */ function first(a: number, b: number): number { diff --git a/tests/fixtures/commands/extract-variable/scope-isolation.input.ts b/tests/fixtures/commands/extract-variable/scope-isolation.input.ts index 014b77a..8c0320f 100644 --- a/tests/fixtures/commands/extract-variable/scope-isolation.input.ts +++ b/tests/fixtures/commands/extract-variable/scope-isolation.input.ts @@ -1,6 +1,6 @@ /** * @description Extract variable should respect function scope boundaries - * @command refakts extract-variable "[scope-isolation.input.ts 7:10-7:15]" --name "sum" --all + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:10-7:15]" --name "sum" --all */ function first(a: number, b: number): number { diff --git a/tests/fixtures/commands/extract-variable/simple-expression.expected.ts b/tests/fixtures/commands/extract-variable/simple-expression.expected.ts index 1dc66b2..e094a5c 100644 --- a/tests/fixtures/commands/extract-variable/simple-expression.expected.ts +++ b/tests/fixtures/commands/extract-variable/simple-expression.expected.ts @@ -1,6 +1,6 @@ /** * @description Extract a simple arithmetic expression - * @command refakts extract-variable "[simple-expression.input.ts 7:10-7:24]" --name "area" + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:10-7:24]" --name "area" */ function calculateArea(width: number, height: number): number { diff --git a/tests/fixtures/commands/extract-variable/simple-expression.input.ts b/tests/fixtures/commands/extract-variable/simple-expression.input.ts index d671846..39c38c3 100644 --- a/tests/fixtures/commands/extract-variable/simple-expression.input.ts +++ b/tests/fixtures/commands/extract-variable/simple-expression.input.ts @@ -1,6 +1,6 @@ /** * @description Extract a simple arithmetic expression - * @command refakts extract-variable "[simple-expression.input.ts 7:10-7:24]" --name "area" + * @command refakts extract-variable "[{{CURRENT_FILE}} 7:10-7:24]" --name "area" */ function calculateArea(width: number, height: number): number { diff --git a/tests/fixtures/commands/inline-variable/array-access.expected.ts b/tests/fixtures/commands/inline-variable/array-access.expected.ts index a25f7f4..fc45289 100644 --- a/tests/fixtures/commands/inline-variable/array-access.expected.ts +++ b/tests/fixtures/commands/inline-variable/array-access.expected.ts @@ -1,6 +1,6 @@ /** * @description Inline variable with array access - * @command refakts inline-variable "[array-access.input.ts 8:10-8:15]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:10-8:15]" */ function getFirst(arr: number[]): number { diff --git a/tests/fixtures/commands/inline-variable/array-access.input.ts b/tests/fixtures/commands/inline-variable/array-access.input.ts index ba43384..86a0cff 100644 --- a/tests/fixtures/commands/inline-variable/array-access.input.ts +++ b/tests/fixtures/commands/inline-variable/array-access.input.ts @@ -1,6 +1,6 @@ /** * @description Inline variable with array access - * @command refakts inline-variable "[array-access.input.ts 8:10-8:15]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:10-8:15]" */ function getFirst(arr: number[]): number { diff --git a/tests/fixtures/commands/inline-variable/complex-dependency.input.ts b/tests/fixtures/commands/inline-variable/complex-dependency.input.ts index 3d70e1b..50b440f 100644 --- a/tests/fixtures/commands/inline-variable/complex-dependency.input.ts +++ b/tests/fixtures/commands/inline-variable/complex-dependency.input.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for complex variable dependencies - * @command inline-variable "[complex-dependency.input.ts 7:9-7:14]" + * @command inline-variable "[{{CURRENT_FILE}} 7:9-7:14]" * @expect-error true * @skip GitHub issue #30 */ diff --git a/tests/fixtures/commands/inline-variable/complex-expression.expected.ts b/tests/fixtures/commands/inline-variable/complex-expression.expected.ts index e087a08..dfb5611 100644 --- a/tests/fixtures/commands/inline-variable/complex-expression.expected.ts +++ b/tests/fixtures/commands/inline-variable/complex-expression.expected.ts @@ -1,6 +1,6 @@ /** * @description Inline variable with complex expression - * @command refakts inline-variable "[complex-expression.input.ts 8:10-8:14]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:10-8:14]" */ function complexCalc(a: number, b: number, c: number): number { diff --git a/tests/fixtures/commands/inline-variable/complex-expression.input.ts b/tests/fixtures/commands/inline-variable/complex-expression.input.ts index 36ae24d..6bfc241 100644 --- a/tests/fixtures/commands/inline-variable/complex-expression.input.ts +++ b/tests/fixtures/commands/inline-variable/complex-expression.input.ts @@ -1,6 +1,6 @@ /** * @description Inline variable with complex expression - * @command refakts inline-variable "[complex-expression.input.ts 8:10-8:14]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:10-8:14]" */ function complexCalc(a: number, b: number, c: number): number { diff --git a/tests/fixtures/commands/inline-variable/destructuring-no-initializer.input.ts b/tests/fixtures/commands/inline-variable/destructuring-no-initializer.input.ts index 79fcefb..e83f63d 100644 --- a/tests/fixtures/commands/inline-variable/destructuring-no-initializer.input.ts +++ b/tests/fixtures/commands/inline-variable/destructuring-no-initializer.input.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for destructuring without initializer - * @command inline-variable "[destructuring-no-initializer.input.ts 7:9-7:10]" + * @command inline-variable "[{{CURRENT_FILE}} 7:9-7:10]" * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/inline-variable/destructuring.expected.ts b/tests/fixtures/commands/inline-variable/destructuring.expected.ts index 5dd5c7b..06c1c98 100644 --- a/tests/fixtures/commands/inline-variable/destructuring.expected.ts +++ b/tests/fixtures/commands/inline-variable/destructuring.expected.ts @@ -1,6 +1,6 @@ /** * @description Inline variable using destructuring assignment - * @command refakts inline-variable "[destructuring.input.ts 8:10-8:11]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:10-8:11]" */ function getCoordinate(point: { x: number; y: number }): number { diff --git a/tests/fixtures/commands/inline-variable/destructuring.input.ts b/tests/fixtures/commands/inline-variable/destructuring.input.ts index 9f0d12a..e7d4a51 100644 --- a/tests/fixtures/commands/inline-variable/destructuring.input.ts +++ b/tests/fixtures/commands/inline-variable/destructuring.input.ts @@ -1,6 +1,6 @@ /** * @description Inline variable using destructuring assignment - * @command refakts inline-variable "[destructuring.input.ts 8:10-8:11]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:10-8:11]" */ function getCoordinate(point: { x: number; y: number }): number { diff --git a/tests/fixtures/commands/inline-variable/function-call.expected.ts b/tests/fixtures/commands/inline-variable/function-call.expected.ts index eeeb7e1..f3b2b8d 100644 --- a/tests/fixtures/commands/inline-variable/function-call.expected.ts +++ b/tests/fixtures/commands/inline-variable/function-call.expected.ts @@ -1,6 +1,6 @@ /** * @description Inline variable containing function call - * @command refakts inline-variable "[function-call.input.ts 8:10-8:17]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:10-8:17]" */ function processString(text: string): string { diff --git a/tests/fixtures/commands/inline-variable/function-call.input.ts b/tests/fixtures/commands/inline-variable/function-call.input.ts index 196aa73..ef043a3 100644 --- a/tests/fixtures/commands/inline-variable/function-call.input.ts +++ b/tests/fixtures/commands/inline-variable/function-call.input.ts @@ -1,6 +1,6 @@ /** * @description Inline variable containing function call - * @command refakts inline-variable "[function-call.input.ts 8:10-8:17]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:10-8:17]" */ function processString(text: string): string { diff --git a/tests/fixtures/commands/inline-variable/location-simple-case.expected.ts b/tests/fixtures/commands/inline-variable/location-simple-case.expected.ts index a8bf948..95cd5e4 100644 --- a/tests/fixtures/commands/inline-variable/location-simple-case.expected.ts +++ b/tests/fixtures/commands/inline-variable/location-simple-case.expected.ts @@ -1,6 +1,6 @@ /** * @description Inline a single variable using location format - * @command refakts inline-variable "[location-simple-case.input.ts 8:9-8:12]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:9-8:12]" */ function calculateArea(width: number, height: number): number { diff --git a/tests/fixtures/commands/inline-variable/location-simple-case.input.ts b/tests/fixtures/commands/inline-variable/location-simple-case.input.ts index ee145e2..f477c4c 100644 --- a/tests/fixtures/commands/inline-variable/location-simple-case.input.ts +++ b/tests/fixtures/commands/inline-variable/location-simple-case.input.ts @@ -1,6 +1,6 @@ /** * @description Inline a single variable using location format - * @command refakts inline-variable "[location-simple-case.input.ts 8:9-8:12]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:9-8:12]" */ function calculateArea(width: number, height: number): number { diff --git a/tests/fixtures/commands/inline-variable/method-call-initializer.expected.ts b/tests/fixtures/commands/inline-variable/method-call-initializer.expected.ts index 5285c11..8a96003 100644 --- a/tests/fixtures/commands/inline-variable/method-call-initializer.expected.ts +++ b/tests/fixtures/commands/inline-variable/method-call-initializer.expected.ts @@ -1,6 +1,6 @@ /** * @description Inline variable with method call initializer when same variable name exists in different scopes - * @command refakts inline-variable "[method-call-initializer.input.ts 12:11-12:17]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 12:11-12:17]" */ class TestClass { method1() { diff --git a/tests/fixtures/commands/inline-variable/method-call-initializer.input.ts b/tests/fixtures/commands/inline-variable/method-call-initializer.input.ts index 757b55a..e7f313c 100644 --- a/tests/fixtures/commands/inline-variable/method-call-initializer.input.ts +++ b/tests/fixtures/commands/inline-variable/method-call-initializer.input.ts @@ -1,6 +1,6 @@ /** * @description Inline variable with method call initializer when same variable name exists in different scopes - * @command refakts inline-variable "[method-call-initializer.input.ts 12:11-12:17]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 12:11-12:17]" */ class TestClass { method1() { diff --git a/tests/fixtures/commands/inline-variable/multiple-usages.expected.ts b/tests/fixtures/commands/inline-variable/multiple-usages.expected.ts index 205a92a..5103d1d 100644 --- a/tests/fixtures/commands/inline-variable/multiple-usages.expected.ts +++ b/tests/fixtures/commands/inline-variable/multiple-usages.expected.ts @@ -1,6 +1,6 @@ /** * @description Inline variable with multiple usages - * @command refakts inline-variable "[multiple-usages.input.ts 8:18-8:21]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:18-8:21]" */ function processData(x: number, y: number): number { diff --git a/tests/fixtures/commands/inline-variable/multiple-usages.input.ts b/tests/fixtures/commands/inline-variable/multiple-usages.input.ts index 44facea..b7f3fec 100644 --- a/tests/fixtures/commands/inline-variable/multiple-usages.input.ts +++ b/tests/fixtures/commands/inline-variable/multiple-usages.input.ts @@ -1,6 +1,6 @@ /** * @description Inline variable with multiple usages - * @command refakts inline-variable "[multiple-usages.input.ts 8:18-8:21]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:18-8:21]" */ function processData(x: number, y: number): number { diff --git a/tests/fixtures/commands/inline-variable/nonexistent-variable.expected.ts b/tests/fixtures/commands/inline-variable/nonexistent-variable.expected.ts index 90b0dd8..fbefaa5 100644 --- a/tests/fixtures/commands/inline-variable/nonexistent-variable.expected.ts +++ b/tests/fixtures/commands/inline-variable/nonexistent-variable.expected.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for non-existent variable - * @command inline-variable "[nonexistent-variable.input.ts 5:1-5:5]" + * @command inline-variable "[{{CURRENT_FILE}} 5:1-5:5]" * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/inline-variable/nonexistent-variable.input.ts b/tests/fixtures/commands/inline-variable/nonexistent-variable.input.ts index 90b0dd8..fbefaa5 100644 --- a/tests/fixtures/commands/inline-variable/nonexistent-variable.input.ts +++ b/tests/fixtures/commands/inline-variable/nonexistent-variable.input.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for non-existent variable - * @command inline-variable "[nonexistent-variable.input.ts 5:1-5:5]" + * @command inline-variable "[{{CURRENT_FILE}} 5:1-5:5]" * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/inline-variable/object-property.expected.ts b/tests/fixtures/commands/inline-variable/object-property.expected.ts index 2b31648..54e2891 100644 --- a/tests/fixtures/commands/inline-variable/object-property.expected.ts +++ b/tests/fixtures/commands/inline-variable/object-property.expected.ts @@ -1,6 +1,6 @@ /** * @description Inline variable containing object property access - * @command refakts inline-variable "[object-property.input.ts 8:10-8:15]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:10-8:15]" */ function getFullName(person: { firstName: string; lastName: string }): string { diff --git a/tests/fixtures/commands/inline-variable/object-property.input.ts b/tests/fixtures/commands/inline-variable/object-property.input.ts index bb15bd3..fdf924e 100644 --- a/tests/fixtures/commands/inline-variable/object-property.input.ts +++ b/tests/fixtures/commands/inline-variable/object-property.input.ts @@ -1,6 +1,6 @@ /** * @description Inline variable containing object property access - * @command refakts inline-variable "[object-property.input.ts 8:10-8:15]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:10-8:15]" */ function getFullName(person: { firstName: string; lastName: string }): string { diff --git a/tests/fixtures/commands/inline-variable/simple-case.expected.ts b/tests/fixtures/commands/inline-variable/simple-case.expected.ts index e067a1d..e4fb82a 100644 --- a/tests/fixtures/commands/inline-variable/simple-case.expected.ts +++ b/tests/fixtures/commands/inline-variable/simple-case.expected.ts @@ -1,6 +1,6 @@ /** * @description Inline a single variable - * @command refakts inline-variable "[simple-case.input.ts 8:10-8:14]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:10-8:14]" */ function calculateArea(width: number, height: number): number { diff --git a/tests/fixtures/commands/inline-variable/simple-case.input.ts b/tests/fixtures/commands/inline-variable/simple-case.input.ts index 591444f..31c4c88 100644 --- a/tests/fixtures/commands/inline-variable/simple-case.input.ts +++ b/tests/fixtures/commands/inline-variable/simple-case.input.ts @@ -1,6 +1,6 @@ /** * @description Inline a single variable - * @command refakts inline-variable "[simple-case.input.ts 8:10-8:14]" + * @command refakts inline-variable "[{{CURRENT_FILE}} 8:10-8:14]" */ function calculateArea(width: number, height: number): number { diff --git a/tests/fixtures/commands/inline-variable/variable-no-initializer.expected.ts b/tests/fixtures/commands/inline-variable/variable-no-initializer.expected.ts index 44a42fe..73a2c24 100644 --- a/tests/fixtures/commands/inline-variable/variable-no-initializer.expected.ts +++ b/tests/fixtures/commands/inline-variable/variable-no-initializer.expected.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for variable without initializer - * @command inline-variable "[variable-no-initializer.input.ts 7:7-7:8]" + * @command inline-variable "[{{CURRENT_FILE}} 7:7-7:8]" * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/inline-variable/variable-no-initializer.input.ts b/tests/fixtures/commands/inline-variable/variable-no-initializer.input.ts index 44a42fe..73a2c24 100644 --- a/tests/fixtures/commands/inline-variable/variable-no-initializer.input.ts +++ b/tests/fixtures/commands/inline-variable/variable-no-initializer.input.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for variable without initializer - * @command inline-variable "[variable-no-initializer.input.ts 7:7-7:8]" + * @command inline-variable "[{{CURRENT_FILE}} 7:7-7:8]" * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/rename/arrow-function.expected.ts b/tests/fixtures/commands/rename/arrow-function.expected.ts index a9323cf..e5ad566 100644 --- a/tests/fixtures/commands/rename/arrow-function.expected.ts +++ b/tests/fixtures/commands/rename/arrow-function.expected.ts @@ -1,6 +1,6 @@ /** * @description Rename parameter in arrow function - * @command refakts rename "[arrow-function.input.ts 6:20-6:21]" --to "value" + * @command refakts rename "[{{CURRENT_FILE}} 6:20-6:21]" --to "value" */ const transform = (value: number) => { diff --git a/tests/fixtures/commands/rename/arrow-function.input.ts b/tests/fixtures/commands/rename/arrow-function.input.ts index a20deb3..9e875cb 100644 --- a/tests/fixtures/commands/rename/arrow-function.input.ts +++ b/tests/fixtures/commands/rename/arrow-function.input.ts @@ -1,6 +1,6 @@ /** * @description Rename parameter in arrow function - * @command refakts rename "[arrow-function.input.ts 6:20-6:21]" --to "value" + * @command refakts rename "[{{CURRENT_FILE}} 6:20-6:21]" --to "value" */ const transform = (x: number) => { diff --git a/tests/fixtures/commands/rename/block-scope.expected.ts b/tests/fixtures/commands/rename/block-scope.expected.ts index 654782f..902abf6 100644 --- a/tests/fixtures/commands/rename/block-scope.expected.ts +++ b/tests/fixtures/commands/rename/block-scope.expected.ts @@ -1,6 +1,6 @@ /** * @description Rename variable in block scope - * @command refakts rename "[block-scope.input.ts 10:11-10:15]" --to "temporaryValue" + * @command refakts rename "[{{CURRENT_FILE}} 10:11-10:15]" --to "temporaryValue" */ function processValue(condition: boolean, input: number): number { diff --git a/tests/fixtures/commands/rename/block-scope.input.ts b/tests/fixtures/commands/rename/block-scope.input.ts index 64ba2ba..8199c2f 100644 --- a/tests/fixtures/commands/rename/block-scope.input.ts +++ b/tests/fixtures/commands/rename/block-scope.input.ts @@ -1,6 +1,6 @@ /** * @description Rename variable in block scope - * @command refakts rename "[block-scope.input.ts 10:11-10:15]" --to "temporaryValue" + * @command refakts rename "[{{CURRENT_FILE}} 10:11-10:15]" --to "temporaryValue" */ function processValue(condition: boolean, input: number): number { diff --git a/tests/fixtures/commands/rename/child-scope-conflict.expected.ts b/tests/fixtures/commands/rename/child-scope-conflict.expected.ts index d25b755..d274923 100644 --- a/tests/fixtures/commands/rename/child-scope-conflict.expected.ts +++ b/tests/fixtures/commands/rename/child-scope-conflict.expected.ts @@ -1,6 +1,6 @@ /** * @description Test rename with child scope conflict - renaming y to x should fail - * @command refakts rename "[child-scope-conflict.input.ts 9:15-9:16]" --to "x" + * @command refakts rename "[{{CURRENT_FILE}} 9:15-9:16]" --to "x" * @expect-error true */ function f() { diff --git a/tests/fixtures/commands/rename/child-scope-conflict.input.ts b/tests/fixtures/commands/rename/child-scope-conflict.input.ts index d25b755..d274923 100644 --- a/tests/fixtures/commands/rename/child-scope-conflict.input.ts +++ b/tests/fixtures/commands/rename/child-scope-conflict.input.ts @@ -1,6 +1,6 @@ /** * @description Test rename with child scope conflict - renaming y to x should fail - * @command refakts rename "[child-scope-conflict.input.ts 9:15-9:16]" --to "x" + * @command refakts rename "[{{CURRENT_FILE}} 9:15-9:16]" --to "x" * @expect-error true */ function f() { diff --git a/tests/fixtures/commands/rename/function-argument.expected.ts b/tests/fixtures/commands/rename/function-argument.expected.ts index ef8b73a..4c0ead1 100644 --- a/tests/fixtures/commands/rename/function-argument.expected.ts +++ b/tests/fixtures/commands/rename/function-argument.expected.ts @@ -1,6 +1,6 @@ /** * @description Rename a function argument - * @command refakts rename "[function-argument.input.ts 6:22-6:30]" --to "newParam" + * @command refakts rename "[{{CURRENT_FILE}} 6:22-6:30]" --to "newParam" */ function processData(newParam: string, other: number): string { diff --git a/tests/fixtures/commands/rename/function-argument.input.ts b/tests/fixtures/commands/rename/function-argument.input.ts index 2c693b0..cc2a129 100644 --- a/tests/fixtures/commands/rename/function-argument.input.ts +++ b/tests/fixtures/commands/rename/function-argument.input.ts @@ -1,6 +1,6 @@ /** * @description Rename a function argument - * @command refakts rename "[function-argument.input.ts 6:22-6:30]" --to "newParam" + * @command refakts rename "[{{CURRENT_FILE}} 6:22-6:30]" --to "newParam" */ function processData(oldParam: string, other: number): string { diff --git a/tests/fixtures/commands/rename/invalid-identifier.expected.ts b/tests/fixtures/commands/rename/invalid-identifier.expected.ts index 1063739..3d44e89 100644 --- a/tests/fixtures/commands/rename/invalid-identifier.expected.ts +++ b/tests/fixtures/commands/rename/invalid-identifier.expected.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for invalid identifier location - * @command rename "[invalid-identifier.input.ts 3:1-3:5]" --to newName + * @command rename "[{{CURRENT_FILE}} 3:1-3:5]" --to newName * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/rename/invalid-identifier.input.ts b/tests/fixtures/commands/rename/invalid-identifier.input.ts index 1063739..3d44e89 100644 --- a/tests/fixtures/commands/rename/invalid-identifier.input.ts +++ b/tests/fixtures/commands/rename/invalid-identifier.input.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for invalid identifier location - * @command rename "[invalid-identifier.input.ts 3:1-3:5]" --to newName + * @command rename "[{{CURRENT_FILE}} 3:1-3:5]" --to newName * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/rename/location-simple-variable.expected.ts b/tests/fixtures/commands/rename/location-simple-variable.expected.ts index 4d4cf45..70acfc4 100644 --- a/tests/fixtures/commands/rename/location-simple-variable.expected.ts +++ b/tests/fixtures/commands/rename/location-simple-variable.expected.ts @@ -1,6 +1,6 @@ /** * @description Rename a variable using location format - * @command refakts rename "[location-simple-variable.input.ts 7:8-7:11]" --to "newName" + * @command refakts rename "[{{CURRENT_FILE}} 7:8-7:11]" --to "newName" */ function test() { diff --git a/tests/fixtures/commands/rename/location-simple-variable.input.ts b/tests/fixtures/commands/rename/location-simple-variable.input.ts index e8f5ba6..f0e186e 100644 --- a/tests/fixtures/commands/rename/location-simple-variable.input.ts +++ b/tests/fixtures/commands/rename/location-simple-variable.input.ts @@ -1,6 +1,6 @@ /** * @description Rename a variable using location format - * @command refakts rename "[location-simple-variable.input.ts 7:8-7:11]" --to "newName" + * @command refakts rename "[{{CURRENT_FILE}} 7:8-7:11]" --to "newName" */ function test() { diff --git a/tests/fixtures/commands/rename/missing-to-option.expected.ts b/tests/fixtures/commands/rename/missing-to-option.expected.ts index e30877a..f2026c1 100644 --- a/tests/fixtures/commands/rename/missing-to-option.expected.ts +++ b/tests/fixtures/commands/rename/missing-to-option.expected.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for missing --to option - * @command rename "[missing-to-option.input.ts 2:9-2:15]" + * @command rename "[{{CURRENT_FILE}} 2:9-2:15]" * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/rename/missing-to-option.input.ts b/tests/fixtures/commands/rename/missing-to-option.input.ts index e30877a..f2026c1 100644 --- a/tests/fixtures/commands/rename/missing-to-option.input.ts +++ b/tests/fixtures/commands/rename/missing-to-option.input.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for missing --to option - * @command rename "[missing-to-option.input.ts 2:9-2:15]" + * @command rename "[{{CURRENT_FILE}} 2:9-2:15]" * @expect-error true */ function example() { diff --git a/tests/fixtures/commands/rename/nested-scopes.expected.ts b/tests/fixtures/commands/rename/nested-scopes.expected.ts index 599cc67..266125e 100644 --- a/tests/fixtures/commands/rename/nested-scopes.expected.ts +++ b/tests/fixtures/commands/rename/nested-scopes.expected.ts @@ -1,6 +1,6 @@ /** * @description Rename variable in nested scopes with multiple usages - * @command refakts rename "[nested-scopes.input.ts 6:23-6:28]" --to "itemList" + * @command refakts rename "[{{CURRENT_FILE}} 6:23-6:28]" --to "itemList" */ function processItems(itemList: string[]): string[] { diff --git a/tests/fixtures/commands/rename/nested-scopes.input.ts b/tests/fixtures/commands/rename/nested-scopes.input.ts index badfc01..9a04fd1 100644 --- a/tests/fixtures/commands/rename/nested-scopes.input.ts +++ b/tests/fixtures/commands/rename/nested-scopes.input.ts @@ -1,6 +1,6 @@ /** * @description Rename variable in nested scopes with multiple usages - * @command refakts rename "[nested-scopes.input.ts 6:23-6:28]" --to "itemList" + * @command refakts rename "[{{CURRENT_FILE}} 6:23-6:28]" --to "itemList" */ function processItems(items: string[]): string[] { diff --git a/tests/fixtures/commands/rename/parameter-conflict.expected.ts b/tests/fixtures/commands/rename/parameter-conflict.expected.ts index 9cd4c36..a68507e 100644 --- a/tests/fixtures/commands/rename/parameter-conflict.expected.ts +++ b/tests/fixtures/commands/rename/parameter-conflict.expected.ts @@ -1,6 +1,6 @@ /** * @description Test rename with parameter conflict - * @command refakts rename "[parameter-conflict.input.ts 7:11-7:12]" --to "param" + * @command refakts rename "[{{CURRENT_FILE}} 7:11-7:12]" --to "param" * @expect-error true */ function f(param: number) { diff --git a/tests/fixtures/commands/rename/parameter-conflict.input.ts b/tests/fixtures/commands/rename/parameter-conflict.input.ts index 9cd4c36..a68507e 100644 --- a/tests/fixtures/commands/rename/parameter-conflict.input.ts +++ b/tests/fixtures/commands/rename/parameter-conflict.input.ts @@ -1,6 +1,6 @@ /** * @description Test rename with parameter conflict - * @command refakts rename "[parameter-conflict.input.ts 7:11-7:12]" --to "param" + * @command refakts rename "[{{CURRENT_FILE}} 7:11-7:12]" --to "param" * @expect-error true */ function f(param: number) { diff --git a/tests/fixtures/commands/rename/parent-scope-conflict.expected.ts b/tests/fixtures/commands/rename/parent-scope-conflict.expected.ts index 6cad157..0d6a635 100644 --- a/tests/fixtures/commands/rename/parent-scope-conflict.expected.ts +++ b/tests/fixtures/commands/rename/parent-scope-conflict.expected.ts @@ -1,6 +1,6 @@ /** * @description Test rename with parent scope conflict - * @command refakts rename "[parent-scope-conflict.input.ts 7:11-7:12]" --to "y" + * @command refakts rename "[{{CURRENT_FILE}} 7:11-7:12]" --to "y" * @expect-error true */ function f() { diff --git a/tests/fixtures/commands/rename/parent-scope-conflict.input.ts b/tests/fixtures/commands/rename/parent-scope-conflict.input.ts index 6cad157..0d6a635 100644 --- a/tests/fixtures/commands/rename/parent-scope-conflict.input.ts +++ b/tests/fixtures/commands/rename/parent-scope-conflict.input.ts @@ -1,6 +1,6 @@ /** * @description Test rename with parent scope conflict - * @command refakts rename "[parent-scope-conflict.input.ts 7:11-7:12]" --to "y" + * @command refakts rename "[{{CURRENT_FILE}} 7:11-7:12]" --to "y" * @expect-error true */ function f() { diff --git a/tests/fixtures/commands/rename/reserved-keyword.input.ts b/tests/fixtures/commands/rename/reserved-keyword.input.ts index b50b154..84096d4 100644 --- a/tests/fixtures/commands/rename/reserved-keyword.input.ts +++ b/tests/fixtures/commands/rename/reserved-keyword.input.ts @@ -1,6 +1,6 @@ /** * @description Test error handling for renaming to reserved keyword - * @command rename "[reserved-keyword.input.ts 7:9-7:15]" --to "class" + * @command rename "[{{CURRENT_FILE}} 7:9-7:15]" --to "class" * @expect-error true * @skip GitHub issue #32 */ diff --git a/tests/fixtures/commands/rename/same-scope-conflict.expected.ts b/tests/fixtures/commands/rename/same-scope-conflict.expected.ts index 0bfa9ea..4995373 100644 --- a/tests/fixtures/commands/rename/same-scope-conflict.expected.ts +++ b/tests/fixtures/commands/rename/same-scope-conflict.expected.ts @@ -1,6 +1,6 @@ /** * @description Test rename with same scope conflict - * @command refakts rename "[same-scope-conflict.input.ts 7:11-7:12]" --to "y" + * @command refakts rename "[{{CURRENT_FILE}} 7:11-7:12]" --to "y" * @expect-error true */ function f() { diff --git a/tests/fixtures/commands/rename/same-scope-conflict.input.ts b/tests/fixtures/commands/rename/same-scope-conflict.input.ts index 0bfa9ea..4995373 100644 --- a/tests/fixtures/commands/rename/same-scope-conflict.input.ts +++ b/tests/fixtures/commands/rename/same-scope-conflict.input.ts @@ -1,6 +1,6 @@ /** * @description Test rename with same scope conflict - * @command refakts rename "[same-scope-conflict.input.ts 7:11-7:12]" --to "y" + * @command refakts rename "[{{CURRENT_FILE}} 7:11-7:12]" --to "y" * @expect-error true */ function f() { diff --git a/tests/fixtures/commands/rename/scope-isolation.expected.ts b/tests/fixtures/commands/rename/scope-isolation.expected.ts index 93154b7..15d6b64 100644 --- a/tests/fixtures/commands/rename/scope-isolation.expected.ts +++ b/tests/fixtures/commands/rename/scope-isolation.expected.ts @@ -1,6 +1,6 @@ /** * @description Rename variable should only affect the targeted scope, not same-named variables in other scopes - * @command refakts rename "[scope-isolation.input.ts 7:9-7:13]" --to "processedData" + * @command refakts rename "[{{CURRENT_FILE}} 7:9-7:13]" --to "processedData" */ function outerFunction() { diff --git a/tests/fixtures/commands/rename/scope-isolation.input.ts b/tests/fixtures/commands/rename/scope-isolation.input.ts index 1d117c0..ee51dc7 100644 --- a/tests/fixtures/commands/rename/scope-isolation.input.ts +++ b/tests/fixtures/commands/rename/scope-isolation.input.ts @@ -1,6 +1,6 @@ /** * @description Rename variable should only affect the targeted scope, not same-named variables in other scopes - * @command refakts rename "[scope-isolation.input.ts 7:9-7:13]" --to "processedData" + * @command refakts rename "[{{CURRENT_FILE}} 7:9-7:13]" --to "processedData" */ function outerFunction() { diff --git a/tests/fixtures/commands/rename/simple-variable.expected.ts b/tests/fixtures/commands/rename/simple-variable.expected.ts index 4add994..a1c0449 100644 --- a/tests/fixtures/commands/rename/simple-variable.expected.ts +++ b/tests/fixtures/commands/rename/simple-variable.expected.ts @@ -1,6 +1,6 @@ /** * @description Rename a simple local variable - * @command refakts rename "[simple-variable.input.ts 7:9-7:16]" --to "newName" + * @command refakts rename "[{{CURRENT_FILE}} 7:9-7:16]" --to "newName" */ function calculateArea(width: number, height: number): number { diff --git a/tests/fixtures/commands/rename/simple-variable.input.ts b/tests/fixtures/commands/rename/simple-variable.input.ts index f873d1a..8e42d21 100644 --- a/tests/fixtures/commands/rename/simple-variable.input.ts +++ b/tests/fixtures/commands/rename/simple-variable.input.ts @@ -1,6 +1,6 @@ /** * @description Rename a simple local variable - * @command refakts rename "[simple-variable.input.ts 7:9-7:16]" --to "newName" + * @command refakts rename "[{{CURRENT_FILE}} 7:9-7:16]" --to "newName" */ function calculateArea(width: number, height: number): number { diff --git a/tests/fixtures/commands/sort-methods/recursive-methods.expected.ts b/tests/fixtures/commands/sort-methods/recursive-methods.expected.ts index a08fe0b..38c960d 100644 --- a/tests/fixtures/commands/sort-methods/recursive-methods.expected.ts +++ b/tests/fixtures/commands/sort-methods/recursive-methods.expected.ts @@ -1,6 +1,6 @@ /** * @description Class with recursive method calls that need proper entry point detection - * @command sort-methods "[recursive-methods.input.ts 5:1-5:18]" + * @command sort-methods "[{{CURRENT_FILE}} 5:1-5:18]" */ export class MathProcessor { private cache = new Map(); diff --git a/tests/fixtures/commands/sort-methods/recursive-methods.input.ts b/tests/fixtures/commands/sort-methods/recursive-methods.input.ts index eeb78a2..43f28b2 100644 --- a/tests/fixtures/commands/sort-methods/recursive-methods.input.ts +++ b/tests/fixtures/commands/sort-methods/recursive-methods.input.ts @@ -1,6 +1,6 @@ /** * @description Class with recursive method calls that need proper entry point detection - * @command sort-methods "[recursive-methods.input.ts 5:1-5:18]" + * @command sort-methods "[{{CURRENT_FILE}} 5:1-5:18]" */ export class MathProcessor { private cache = new Map(); diff --git a/tests/fixtures/commands/sort-methods/simple-class.expected.ts b/tests/fixtures/commands/sort-methods/simple-class.expected.ts index 8791522..b726e54 100644 --- a/tests/fixtures/commands/sort-methods/simple-class.expected.ts +++ b/tests/fixtures/commands/sort-methods/simple-class.expected.ts @@ -1,6 +1,6 @@ /** * @description Basic class with methods out of order that need sorting by step down rule - * @command sort-methods "[simple-class.input.ts 5:1-5:10]" + * @command sort-methods "[{{CURRENT_FILE}} 5:1-5:10]" */ export class Calculator { private baseValue = 10; diff --git a/tests/fixtures/commands/sort-methods/simple-class.input.ts b/tests/fixtures/commands/sort-methods/simple-class.input.ts index 27c8ce2..837baf6 100644 --- a/tests/fixtures/commands/sort-methods/simple-class.input.ts +++ b/tests/fixtures/commands/sort-methods/simple-class.input.ts @@ -1,6 +1,6 @@ /** * @description Basic class with methods out of order that need sorting by step down rule - * @command sort-methods "[simple-class.input.ts 5:1-5:10]" + * @command sort-methods "[{{CURRENT_FILE}} 5:1-5:10]" */ export class Calculator { private baseValue = 10; diff --git a/tests/utils/single-file-validator.ts b/tests/utils/single-file-validator.ts index fdc881b..5af98c4 100644 --- a/tests/utils/single-file-validator.ts +++ b/tests/utils/single-file-validator.ts @@ -118,6 +118,7 @@ export class SingleFileValidator implements TestValidator { } private replaceInputFileReference(command: string, receivedFile: string): string { + command = command.replace(/\{\{CURRENT_FILE\}\}/g, receivedFile); const inputFileName = path.basename(receivedFile).replace('.received.ts', '.input.ts'); return command.replace(inputFileName, receivedFile); }