()
| 106 | setCurrentFile(url) |
| 107 | } |
| 108 | function getCurrent(): Promise<{ url: string, text: string } | undefined> { |
| 109 | return currentFileLock.withLock((currentFile, _) => { |
| 110 | if (!currentFile) { |
| 111 | return |
| 112 | } |
| 113 | const text = editor.getValue() |
| 114 | return { url: currentFile, text } |
| 115 | }) |
| 116 | } |
| 117 | async function requestSaveCurrent() { |
| 118 | const current = await getCurrent() |
| 119 | if (current === undefined) { |
no test coverage detected