File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Extension/src/LanguageServer Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -989,7 +989,7 @@ export class DefaultClient implements Client {
989989 }
990990
991991 public async handleIntelliSenseConfigurationQuickPick ( showSecondPrompt : boolean , sender ?: any , compilersOnly ?: boolean ) : Promise < void > {
992- const settings : CppSettings = new CppSettings ( ) ;
992+ const settings : CppSettings = new CppSettings ( compilersOnly ? undefined : this . RootUri ) ;
993993 const selectCompiler : string = localize ( "selectCompiler.string" , "Select IntelliSense Configuration..." ) ;
994994 const paths : string [ ] = [ ] ;
995995 const configProviders : CustomConfigurationProvider1 [ ] | undefined = compilersOnly ? undefined : this . configStateReceived . configProviders ;
Original file line number Diff line number Diff line change @@ -382,10 +382,13 @@ export class CppSettings extends Settings {
382382 public set defaultCompilerPath ( value : string | undefined ) {
383383 const defaultCompilerPathStr : string = "default.compilerPath" ;
384384 const compilerPathInfo : any = this . Section . inspect ( defaultCompilerPathStr ) ;
385- this . Section . update ( defaultCompilerPathStr , value ,
386- compilerPathInfo . workspaceFolderValue !== undefined ? vscode . ConfigurationTarget . WorkspaceFolder :
387- ( compilerPathInfo . workspaceValue !== undefined ? vscode . ConfigurationTarget . Workspace :
388- vscode . ConfigurationTarget . Global ) ) ;
385+ let target : vscode . ConfigurationTarget = vscode . ConfigurationTarget . Global ;
386+ if ( this . resource !== undefined || compilerPathInfo . workspaceFolderValue !== undefined ) {
387+ target = vscode . ConfigurationTarget . WorkspaceFolder ;
388+ } else if ( compilerPathInfo . workspaceValue !== undefined ) {
389+ target = vscode . ConfigurationTarget . Workspace ;
390+ }
391+ this . Section . update ( defaultCompilerPathStr , value , target ) ;
389392 }
390393 public get defaultCompilerArgs ( ) : string [ ] | undefined { return super . getWithUndefinedDefault < string [ ] > ( "default.compilerArgs" ) ; }
391394 public get defaultCStandard ( ) : string | undefined { return super . Section . get < string > ( "default.cStandard" ) ; }
You can’t perform that action at this time.
0 commit comments