Skip to content

Commit 9efde54

Browse files
pass optional parameter to C_Cpp.ConfigurationSelect (#12993)
1 parent a6089ea commit 9efde54

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: Extension/src/LanguageServer/client.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ export interface Client {
776776
PauseCodeAnalysis(): void;
777777
ResumeCodeAnalysis(): void;
778778
CancelCodeAnalysis(): void;
779-
handleConfigurationSelectCommand(): Promise<void>;
779+
handleConfigurationSelectCommand(config?: string): Promise<void>;
780780
handleConfigurationProviderSelectCommand(): Promise<void>;
781781
handleShowActiveCodeAnalysisCommands(): Promise<void>;
782782
handleShowIdleCodeAnalysisCommands(): Promise<void>;
@@ -3271,11 +3271,11 @@ export class DefaultClient implements Client {
32713271
/**
32723272
* command handlers
32733273
*/
3274-
public async handleConfigurationSelectCommand(): Promise<void> {
3274+
public async handleConfigurationSelectCommand(config?: string): Promise<void> {
32753275
await this.ready;
32763276
const configNames: string[] | undefined = this.configuration.ConfigurationNames;
32773277
if (configNames) {
3278-
const index: number = await ui.showConfigurations(configNames);
3278+
const index: number = config ? configNames.indexOf(config) : await ui.showConfigurations(configNames);
32793279
if (index < 0) {
32803280
return;
32813281
}

Diff for: Extension/src/LanguageServer/extension.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -584,13 +584,13 @@ async function installCompiler(sender?: any): Promise<void> {
584584
telemetry.logLanguageServerEvent('installCompiler', telemetryProperties);
585585
}
586586

587-
async function onSelectConfiguration(): Promise<void> {
587+
async function onSelectConfiguration(config?: string): Promise<void> {
588588
if (!isFolderOpen()) {
589589
void vscode.window.showInformationMessage(localize("configuration.select.first", 'Open a folder first to select a configuration.'));
590590
} else {
591591
// This only applies to the active client. You cannot change the configuration for
592592
// a client that is not active since that client's UI will not be visible.
593-
return clients.ActiveClient.handleConfigurationSelectCommand();
593+
return clients.ActiveClient.handleConfigurationSelectCommand(config);
594594
}
595595
}
596596

0 commit comments

Comments
 (0)