MCPcopy Create free account
hub / github.com/continuedev/continue / getPreEditContent

Function getPreEditContent

extensions/vscode/src/util/editLoggingUtils.ts:16–26  ·  view source on GitHub ↗
(document: vscode.TextDocument)

Source from the content-addressed store, hash-verified

14 * This should be called BEFORE processing the edit to get the pre-edit state.
15 */
16export const getPreEditContent = (document: vscode.TextDocument): string => {
17 const uri = document.uri.toString();
18 const cached = documentContentCache.get(uri);
19 if (cached !== undefined) {
20 return cached;
21 }
22 // If not cached, this is the first edit we're seeing - the document's current state
23 // in the event is already post-edit, so we can't get the true pre-edit content.
24 // Return empty string to indicate no prior content was tracked.
25 return "";
26};
27
28/**
29 * Updates the cache with the current document content.

Callers 1

handleTextDocumentChangeFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected