Skip to content

Commit f4d9f56

Browse files
committed
Address inadvertent move of provider setup
Signed-off-by: Ian Bolton <[email protected]>
1 parent 1b66031 commit f4d9f56

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

vscode/src/extension.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -313,18 +313,6 @@ class VsCodeExtension {
313313
vscode.workspace.onWillSaveTextDocument(async (event) => {
314314
const doc = event.document;
315315

316-
// Handle settings.yaml configuration changes
317-
if (doc.uri.fsPath === paths().settingsYaml.fsPath) {
318-
const configError = await this.setupModelProvider(paths().settingsYaml);
319-
this.state.mutateData((draft) => {
320-
draft.configErrors = [];
321-
if (configError) {
322-
draft.configErrors.push(configError);
323-
}
324-
updateConfigErrors(draft, paths().settingsYaml.fsPath);
325-
});
326-
}
327-
328316
// Auto-accept all diff decorations BEFORE saving (if enabled)
329317
// This ensures the document is saved in its final state
330318
if (getConfigAutoAcceptOnSave() && this.state.verticalDiffManager) {
@@ -356,6 +344,22 @@ class VsCodeExtension {
356344
}),
357345
);
358346

347+
// Handle settings.yaml configuration changes AFTER save
348+
this.listeners.push(
349+
vscode.workspace.onDidSaveTextDocument(async (doc) => {
350+
if (doc.uri.fsPath === paths().settingsYaml.fsPath) {
351+
const configError = await this.setupModelProvider(paths().settingsYaml);
352+
this.state.mutateData((draft) => {
353+
draft.configErrors = [];
354+
if (configError) {
355+
draft.configErrors.push(configError);
356+
}
357+
updateConfigErrors(draft, paths().settingsYaml.fsPath);
358+
});
359+
}
360+
}),
361+
);
362+
359363
this.listeners.push(
360364
vscode.workspace.onDidChangeConfiguration((event) => {
361365
this.state.logger.info("Configuration modified!");

0 commit comments

Comments
 (0)