@@ -313,18 +313,6 @@ class VsCodeExtension {
313
313
vscode . workspace . onWillSaveTextDocument ( async ( event ) => {
314
314
const doc = event . document ;
315
315
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
-
328
316
// Auto-accept all diff decorations BEFORE saving (if enabled)
329
317
// This ensures the document is saved in its final state
330
318
if ( getConfigAutoAcceptOnSave ( ) && this . state . verticalDiffManager ) {
@@ -356,6 +344,22 @@ class VsCodeExtension {
356
344
} ) ,
357
345
) ;
358
346
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
+
359
363
this . listeners . push (
360
364
vscode . workspace . onDidChangeConfiguration ( ( event ) => {
361
365
this . state . logger . info ( "Configuration modified!" ) ;
0 commit comments