File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-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 > | undefined ;
85+ private _resolvePathUpdated : ( ( ) => void ) | undefined ;
86+
8487 async promptReload ( message : string ) {
85- if ( await vscode . window . showInformationMessage ( message , 'Reload window' ) )
86- vscode . commands . executeCommand ( 'workbench.action.reloadWindow' ) ;
88+ await this . _pathUpdated
89+ vscode . commands . executeCommand ( 'clangd.restart' )
8790 }
8891
8992 async showHelp ( message : string , url : string ) {
@@ -129,6 +132,11 @@ class UI {
129132 return p ;
130133 }
131134 set clangdPath ( p : string ) {
132- config . update ( 'path' , p , vscode . ConfigurationTarget . Global ) ;
135+ this . _pathUpdated =
136+ new Promise ( resolve => this . _resolvePathUpdated = resolve )
137+ config . update ( 'path' , p , vscode . ConfigurationTarget . Global ) . then ( ( ) => {
138+ if ( this . _resolvePathUpdated )
139+ this . _resolvePathUpdated ( )
140+ } ) ;
133141 }
134142}
You can’t perform that action at this time.
0 commit comments