feat: fix engine (Phase 1.6) + git-aware mv + windows-safe path output
- Edit engine: generic span edits (replace/insert/delete) with stale-index guard; mv and fix share one atomic apply/rollback/diff/--json pipeline - jmove mv|check|fix commands; java rules: unused-import, missing-import (unique-FQN insert, ambiguous -> candidates for agents), import-order (google style; cross-rule byte conflicts prune by severity and converge) - mv of tracked files goes through git mv (staged rename, --no-git opt-out, moved_via/would_move_via in --json, GIT_ERROR code) - fix java extract_package losing single-segment packages (bare identifier, not scoped_identifier) — broke the FQN index for 'package p;' projects - core::rel_str: project-relative paths rendered with '/' on every platform (human/JSON/diff headers/git pathspecs), Path::display() no longer used for output; e2e fixtures: java/fix, java/fix_missing, java/order
This commit is contained in:
parent
0216fd6523
commit
9dda5f4562
37 changed files with 2521 additions and 234 deletions
7
tests/java/fix/src/main/java/com/example/Text.java
Normal file
7
tests/java/fix/src/main/java/com/example/Text.java
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
package com.example;
|
||||
|
||||
public class Text {
|
||||
public static String shout(String s) {
|
||||
return s.toUpperCase() + "!";
|
||||
}
|
||||
}
|
||||
14
tests/java/fix/src/main/java/com/example/app/App.java
Normal file
14
tests/java/fix/src/main/java/com/example/app/App.java
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package com.example.app;
|
||||
|
||||
import com.example.Text;
|
||||
import com.example.unused.Ghost;
|
||||
import java.util.List;
|
||||
import static com.example.Text.shout;
|
||||
|
||||
public class App {
|
||||
public static void main(String[] args) {
|
||||
System.out.println(Text.shout("hi"));
|
||||
String topic = "java.util.List";
|
||||
System.out.println(topic);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.example.a;
|
||||
|
||||
public class Config {}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.example.app;
|
||||
|
||||
public class Calc {
|
||||
int v = Maths.compute();
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.example.app;
|
||||
|
||||
import com.example.gone.Gone;
|
||||
|
||||
public class Dual {
|
||||
int v = Maths.compute();
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.example.b;
|
||||
|
||||
public class Config {}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.example.c;
|
||||
|
||||
public class Refer {
|
||||
Config field;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.example.util;
|
||||
|
||||
public class Maths {
|
||||
public static int compute() {
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
12
tests/java/order/src/main/java/com/example/app/App.java
Normal file
12
tests/java/order/src/main/java/com/example/app/App.java
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
package com.example.app;
|
||||
|
||||
import java.util.List;
|
||||
import com.example.util.Maths;
|
||||
import com.example.gone.Unneeded;
|
||||
import java.util.Map;
|
||||
|
||||
public class App {
|
||||
List<String> a;
|
||||
Map<String, String> b;
|
||||
int v = Maths.compute();
|
||||
}
|
||||
10
tests/java/order/src/main/java/com/example/app/C.java
Normal file
10
tests/java/order/src/main/java/com/example/app/C.java
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package com.example.app;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
public class C {
|
||||
List<String> a;
|
||||
Map<String, String> b;
|
||||
int v = Maths.compute();
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.example.util;
|
||||
|
||||
public class Maths {
|
||||
public static int compute() {
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue