Skip to content

Commit

Permalink
Check related files API flag when IntelliSense is disabled (#12743)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmcmorran authored Sep 20, 2024
1 parent 478765f commit 8d7668e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Extension/src/LanguageServer/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ function onInterval(): void {
/**
* registered commands
*/
export function registerCommands(enabled: boolean, isRelatedFilesApiEnabled: boolean = false): void {
export function registerCommands(enabled: boolean, isRelatedFilesApiEnabled: boolean): void {
commandDisposables.forEach(d => d.dispose());
commandDisposables.length = 0;
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SwitchHeaderSource', enabled ? onSwitchHeaderSource : onDisabledCommand));
Expand Down
3 changes: 2 additions & 1 deletion Extension/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
if (shouldActivateLanguageServer) {
await LanguageServer.activate();
} else if (isIntelliSenseEngineDisabled) {
LanguageServer.registerCommands(false);
const isRelatedFilesApiEnabled = await Telemetry.isExperimentEnabled("CppToolsRelatedFilesApi");
LanguageServer.registerCommands(false, isRelatedFilesApiEnabled);
// The check here for isIntelliSenseEngineDisabled avoids logging
// the message on old Macs that we've already displayed a warning for.
log(localize("intellisense.disabled", "intelliSenseEngine is disabled"));
Expand Down

0 comments on commit 8d7668e

Please sign in to comment.