Save the document (if open + dirty) so the agent reads current contents from disk.
(uri: vscode.Uri)
| 220 | |
| 221 | /** Save the document (if open + dirty) so the agent reads current contents from disk. */ |
| 222 | async function saveIfOpen(uri: vscode.Uri): Promise<void> { |
| 223 | try { |
| 224 | const doc = await vscode.workspace.openTextDocument(uri); |
| 225 | if (doc.isDirty) await doc.save(); |
| 226 | } catch { /* not open / not saveable — fine */ } |
| 227 | } |
| 228 | |
| 229 | /** Command 6: let QodeX fix the editor's reported problems in a file (or one diagnostic). */ |
| 230 | async function fixDiagnostics(documentUri?: vscode.Uri, range?: vscode.Range): Promise<void> { |