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

Function editCurrentFile

vscode-extension/src/extension.ts:133–150  ·  view source on GitHub ↗

Command 3: tell QodeX to edit the current file.

()

Source from the content-addressed store, hash-verified

131
132/** Command 3: tell QodeX to edit the current file. */
133async function editCurrentFile(): Promise<void> {
134 const editor = vscode.window.activeTextEditor;
135 if (!editor) {
136 vscode.window.showWarningMessage('QodeX: no active editor.');
137 return;
138 }
139 const filePath = editor.document.uri.fsPath;
140 const what = await vscode.window.showInputBox({
141 prompt: `What change should QodeX make to ${path.basename(filePath)}?`,
142 placeHolder: 'e.g. add error handling, refactor to async/await, add JSDoc',
143 });
144 if (!what) return;
145 const cfg = getConfig();
146 const cwd = getCwd();
147 const term = getOrCreateTerminal(cwd);
148 const promptText = `Edit ${filePath}: ${what}. Read the file first, then make the change. Verify by running typecheck/lint if available.`;
149 term.sendText(`${cfg.executablePath} ${shellQuote(promptText)}`);
150}
151
152/** Command 4: plan a change. */
153async function runPlan(): Promise<void> {

Callers

nothing calls this directly

Calls 4

getConfigFunction · 0.85
getCwdFunction · 0.85
getOrCreateTerminalFunction · 0.85
shellQuoteFunction · 0.70

Tested by

no test coverage detected