File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -81,9 +81,13 @@ 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+ vscode . window . showInformationMessage ( message ) ;
88+ await this . _pathUpdated ;
89+ this . _pathUpdated = null ;
90+ vscode . commands . executeCommand ( 'clangd.restart' ) ;
8791 }
8892
8993 async showHelp ( message : string , url : string ) {
@@ -129,6 +133,8 @@ class UI {
129133 return p ;
130134 }
131135 set clangdPath ( p : string ) {
132- config . update ( 'path' , p , vscode . ConfigurationTarget . Global ) ;
136+ this . _pathUpdated = new Promise ( resolve => {
137+ config . update ( 'path' , p , vscode . ConfigurationTarget . Global ) . then ( resolve ) ;
138+ } ) ;
133139 }
134140}
You can’t perform that action at this time.
0 commit comments