MCPcopy Index your code
hub / github.com/continuedev/continue / processSmallEdit

Function processSmallEdit

core/nextEdit/context/processSmallEdit.ts:10–53  ·  view source on GitHub ↗
(
  beforeAfterdiff: BeforeAfterDiff,
  cursorPosBeforeEdit: Position,
  cursorPosAfterPrevEdit: Position,
  configHandler: ConfigHandler,
  getDefsFromLspFunction: GetLspDefinitionsFunction,
  ide: IDE,
)

Source from the content-addressed store, hash-verified

8import { processNextEditData } from "./processNextEditData";
9
10export const processSmallEdit = async (
11 beforeAfterdiff: BeforeAfterDiff,
12 cursorPosBeforeEdit: Position,
13 cursorPosAfterPrevEdit: Position,
14 configHandler: ConfigHandler,
15 getDefsFromLspFunction: GetLspDefinitionsFunction,
16 ide: IDE,
17) => {
18 // Get the current context data from the most recent message
19 const currentData = (EditAggregator.getInstance() as any)
20 .latestContextData || {
21 configHandler: configHandler,
22 getDefsFromLspFunction: getDefsFromLspFunction,
23 recentlyEditedRanges: [],
24 recentlyVisitedRanges: [],
25 };
26
27 if (!isSecurityConcern(beforeAfterdiff.filePath)) {
28 NextEditProvider.getInstance().addDiffToContext(
29 createDiff({
30 beforeContent: beforeAfterdiff.beforeContent,
31 afterContent: beforeAfterdiff.afterContent,
32 filePath: beforeAfterdiff.filePath,
33 diffType: DiffFormatType.Unified,
34 contextLines: 3, // NOTE: This can change depending on experiments!
35 workspaceDir: currentData.workspaceDir,
36 }),
37 );
38 }
39
40 void processNextEditData({
41 filePath: beforeAfterdiff.filePath,
42 beforeContent: beforeAfterdiff.beforeContent,
43 afterContent: beforeAfterdiff.afterContent,
44 cursorPosBeforeEdit: cursorPosBeforeEdit,
45 cursorPosAfterPrevEdit: cursorPosAfterPrevEdit,
46 ide: ide,
47 configHandler: currentData.configHandler,
48 getDefinitionsFromLsp: currentData.getDefsFromLspFunction,
49 recentlyEditedRanges: currentData.recentlyEditedRanges,
50 recentlyVisitedRanges: currentData.recentlyVisitedRanges,
51 workspaceDir: currentData.workspaceDir,
52 });
53};

Callers 1

Calls 5

createDiffFunction · 0.90
processNextEditDataFunction · 0.90
isSecurityConcernFunction · 0.85
addDiffToContextMethod · 0.80
getInstanceMethod · 0.45

Tested by

no test coverage detected