File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -81,9 +81,12 @@ class UI {
8181 }
8282 }
8383
84+ private _pathUpdated : Promise < void > | null = null ;
85+
8486 async promptReload ( message : string ) {
85- if ( await vscode . window . showInformationMessage ( message , 'Reload window' ) )
86- vscode . commands . executeCommand ( 'workbench.action.reloadWindow' ) ;
87+ await this . _pathUpdated ;
88+ this . _pathUpdated = null ;
89+ vscode . commands . executeCommand ( 'clangd.restart' ) ;
8790 }
8891
8992 async showHelp ( message : string , url : string ) {
@@ -129,6 +132,8 @@ class UI {
129132 return p ;
130133 }
131134 set clangdPath ( p : string ) {
132- config . update ( 'path' , p , vscode . ConfigurationTarget . Global ) ;
135+ this . _pathUpdated = new Promise ( resolve => {
136+ config . update ( 'path' , p , vscode . ConfigurationTarget . Global ) . then ( resolve ) ;
137+ } ) ;
133138 }
134139}
You can’t perform that action at this time.
0 commit comments