@@ -129,9 +129,47 @@ export async function activate(context: vscode.ExtensionContext) {
129129 // activate providers common to browser/node
130130 activateCommon ( context , host , engine , commands ) ;
131131
132+ // Register configuration change listener for Quarto path settings
133+ registerQuartoPathConfigListener ( context , outputChannel ) ;
134+
132135 outputChannel . info ( "Activated Quarto extension." ) ;
133136}
134137
138+ /**
139+ * Register a listener for changes to Quarto path settings that require a restart
140+ */
141+ function registerQuartoPathConfigListener ( context : vscode . ExtensionContext , outputChannel : vscode . LogOutputChannel ) {
142+ // List of settings that require restart when changed
143+ const quartoPathSettings = [
144+ 'quarto.path' ,
145+ 'quarto.usePipQuarto' ,
146+ 'quarto.useBundledQuartoInPositron'
147+ ] ;
148+
149+ // Listen for configuration changes
150+ context . subscriptions . push (
151+ vscode . workspace . onDidChangeConfiguration ( event => {
152+ // Check if any of our path settings changed
153+ const requiresRestart = quartoPathSettings . some ( setting => event . affectsConfiguration ( setting ) ) ;
154+
155+ if ( requiresRestart ) {
156+ outputChannel . info ( `Quarto path settings changed, restart required: ${ quartoPathSettings . filter ( setting =>
157+ event . affectsConfiguration ( setting ) ) . join ( ', ' ) } `) ;
158+
159+ // Prompt user to restart
160+ vscode . window . showInformationMessage (
161+ 'Quarto path settings have changed. Please reload the window for changes to take effect.' ,
162+ 'Reload Window'
163+ ) . then ( selection => {
164+ if ( selection === 'Reload Window' ) {
165+ vscode . commands . executeCommand ( 'workbench.action.reloadWindow' ) ;
166+ }
167+ } ) ;
168+ }
169+ } )
170+ ) ;
171+ }
172+
135173export async function deactivate ( ) {
136174 return deactivateLsp ( ) ;
137175}
0 commit comments