fix(hashline): address Cubic review comments
- P2: Change replace edit sorting from POSITIVE_INFINITY to NEGATIVE_INFINITY so replace edits run LAST after line-based edits, preventing line number shifts that would invalidate subsequent anchors - P3: Update tool description from SHA-256 to xxHash32 to match actual implementation in hash-computation.ts
This commit is contained in:
parent
51dde4d43f
commit
359c6b6655
@ -62,7 +62,7 @@ function getEditLineNumber(edit: HashlineEdit): number {
|
|||||||
case "insert_after":
|
case "insert_after":
|
||||||
return parseLineRef(edit.line).line
|
return parseLineRef(edit.line).line
|
||||||
case "replace":
|
case "replace":
|
||||||
return Number.POSITIVE_INFINITY
|
return Number.NEGATIVE_INFINITY
|
||||||
default:
|
default:
|
||||||
return Number.POSITIVE_INFINITY
|
return Number.POSITIVE_INFINITY
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export function createHashlineEditTool(): ToolDefinition {
|
|||||||
LINE:HASH FORMAT:
|
LINE:HASH FORMAT:
|
||||||
Each line reference must be in "LINE:HASH" format where:
|
Each line reference must be in "LINE:HASH" format where:
|
||||||
- LINE: 1-based line number
|
- LINE: 1-based line number
|
||||||
- HASH: First 2 characters of SHA-256 hash of line content (computed with computeLineHash)
|
- HASH: First 2 characters of xxHash32 hash of line content (computed with computeLineHash)
|
||||||
- Example: "5:a3|const x = 1" means line 5 with hash "a3"
|
- Example: "5:a3|const x = 1" means line 5 with hash "a3"
|
||||||
|
|
||||||
GETTING HASHES:
|
GETTING HASHES:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user