Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass optional parameter to C_Cpp.ConfigurationSelect #12993

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions Extension/src/LanguageServer/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Loading