MCPcopy
hub / github.com/continuedev/continue / createDiff

Function createDiff

core/nextEdit/context/diffFormatting.ts:25–46  ·  view source on GitHub ↗
({
  beforeContent,
  afterContent,
  filePath,
  diffType,
  contextLines,
  workspaceDir,
}: CreateDiffArgs)

Source from the content-addressed store, hash-verified

23}
24
25export const createDiff = ({
26 beforeContent,
27 afterContent,
28 filePath,
29 diffType,
30 contextLines,
31 workspaceDir,
32}: CreateDiffArgs) => {
33 switch (diffType) {
34 case DiffFormatType.Unified:
35 return createUnifiedDiff(
36 beforeContent,
37 afterContent,
38 filePath,
39 contextLines,
40 workspaceDir,
41 );
42 case DiffFormatType.TokenLineDiff:
43 return createTokenLineDiff(beforeContent, afterContent, filePath);
44 }
45 return "";
46};
47
48const createUnifiedDiff = (
49 beforeContent: string,

Callers 6

processSmallEditFunction · 0.90
finalizeClusterMethod · 0.90
getInProgressDiffMethod · 0.90
processNextEditDataFunction · 0.90
_generatePromptsMethod · 0.85

Calls 2

createUnifiedDiffFunction · 0.85
createTokenLineDiffFunction · 0.85

Tested by

no test coverage detected