(document: vscode.TextDocument)
| 14 | * This should be called BEFORE processing the edit to get the pre-edit state. |
| 15 | */ |
| 16 | export 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. |
no test coverage detected