pass optional parameter to C_Cpp.ConfigurationSelect (#12993)

This commit is contained in:
adrianstephens
2024-12-02 19:19:52 -08:00
committed by GitHub
parent a6089eaa6c
commit 9efde543c5
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -776,7 +776,7 @@ export interface Client {
PauseCodeAnalysis(): void;
ResumeCodeAnalysis(): void;
CancelCodeAnalysis(): void;
handleConfigurationSelectCommand(): Promise<void>;
handleConfigurationSelectCommand(config?: string): Promise<void>;
handleConfigurationProviderSelectCommand(): Promise<void>;
handleShowActiveCodeAnalysisCommands(): Promise<void>;
handleShowIdleCodeAnalysisCommands(): Promise<void>;
@@ -3271,11 +3271,11 @@ export class DefaultClient implements Client {
/**
* command handlers
*/
public async handleConfigurationSelectCommand(): Promise<void> {
public async handleConfigurationSelectCommand(config?: string): Promise<void> {
await this.ready;
const configNames: string[] | undefined = this.configuration.ConfigurationNames;
if (configNames) {
const index: number = await ui.showConfigurations(configNames);
const index: number = config ? configNames.indexOf(config) : await ui.showConfigurations(configNames);
if (index < 0) {
return;
}
+2 -2
View File
@@ -584,13 +584,13 @@ async function installCompiler(sender?: any): Promise<void> {
telemetry.logLanguageServerEvent('installCompiler', telemetryProperties);
}
async function onSelectConfiguration(): Promise<void> {
async function onSelectConfiguration(config?: string): Promise<void> {
if (!isFolderOpen()) {
void vscode.window.showInformationMessage(localize("configuration.select.first", 'Open a folder first to select a configuration.'));
} else {
// This only applies to the active client. You cannot change the configuration for
// a client that is not active since that client's UI will not be visible.
return clients.ActiveClient.handleConfigurationSelectCommand();
return clients.ActiveClient.handleConfigurationSelectCommand(config);
}
}