MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / saveIfOpen

Function saveIfOpen

vscode-extension/src/extension.ts:222–227  ·  view source on GitHub ↗

Save the document (if open + dirty) so the agent reads current contents from disk.

(uri: vscode.Uri)

Source from the content-addressed store, hash-verified

220
221/** Save the document (if open + dirty) so the agent reads current contents from disk. */
222async 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). */
230async function fixDiagnostics(documentUri?: vscode.Uri, range?: vscode.Range): Promise<void> {

Callers 1

fixDiagnosticsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected