MCPcopy Index your code
hub / github.com/coder/coder / endingShapeEqual

Function endingShapeEqual

agent/agentfiles/files.go:924–929  ·  view source on GitHub ↗

endingShapeEqual reports whether two line endings occupy the same "position class" for the splice substitution: both empty, or both in the newline class ({"\n", "\r\n"}). When this is true and the pair matched during matching, the splice uses the file's ending. When false, the splice keeps the repla

(a, b string)

Source from the content-addressed store, hash-verified

922// lines don't silently pick up a missing EOF terminator from the
923// reference content.
924func endingShapeEqual(a, b string) bool {
925 if a == b {
926 return true
927 }
928 return isNewlineEnding(a) && isNewlineEnding(b)
929}
930
931// buildReplacementLines emits the splice for a fuzzy match by
932// per-position substitution at leading-ws, body, trailing-ws, and

Callers 1

buildReplacementLinesFunction · 0.85

Calls 1

isNewlineEndingFunction · 0.85

Tested by

no test coverage detected