diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 54590cbd2..1a70695f7 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -423,75 +423,16 @@ export function registerCommands(enabled: boolean): void { commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RestartIntelliSenseForFile', enabled ? onRestartIntelliSenseForFile : onDisabledCommand)); commandDisposables.push(vscode.commands.registerCommand('C_Cpp.GenerateDoxygenComment', enabled ? onGenerateDoxygenComment : onDisabledCommand)); commandDisposables.push(vscode.commands.registerCommand('C_Cpp.CreateDeclarationOrDefinition', enabled ? onCreateDeclarationOrDefinition : onDisabledCommand)); - // ---------------- Wrappers ------------- - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationSelectUI_Telemetry', enabled ? - () => { - logForUIExperiment("ConfigurationSelect"); - onSelectConfiguration(); - } - : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RescanWorkspaceUI_Telemetry', enabled ? - () => { - logForUIExperiment("RescanWorkspace"); - onRescanWorkspace(); - } - : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowIdleCodeAnalysisCommandsUI_Telemetry', enabled ? - () => { - logForUIExperiment("ShowIdleCodeAnalysisCommands"); - onShowIdleCodeAnalysisCommands(); - } - : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowActiveCodeAnalysisCommandsUI_Telemetry', enabled ? - () => { - logForUIExperiment("ShowActiveCodeAnalysisCommands"); - onShowActiveCodeAnalysisCommands(); - } - : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.PauseParsingUI_Telemetry', enabled ? - () => { - logForUIExperiment("ParsingCommands"); - onPauseParsing(); - } - : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ResumeParsingUI_Telemetry', enabled ? - () => { - logForUIExperiment("ParsingCommands"); - onResumeParsing(); - } - : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.CheckForCompilerUI_Telemetry', enabled ? - () => { - logForUIExperiment("CheckForCompiler"); - onCheckForCompiler(); - } - : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RestartIntelliSenseForFileUI_Telemetry', enabled ? - () => { - logForUIExperiment("RestartIntelliSenseForFile"); - onRestartIntelliSenseForFile(); - } - : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowReferencesProgressUI_Telemetry', enabled ? - () => { - logForUIExperiment("ShowReferencesProgress"); - onShowReferencesProgress(); - } - : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowParsingCommandsUI_Telemetry', enabled ? - () => { - logForUIExperiment("ParsingCommands"); - onShowParsingCommands(); - } - : onDisabledCommand)); - // ---------------------------------------- } -async function logForUIExperiment(command: string): Promise { +async function logForUIExperiment(command: string, sender?: any): Promise { const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined); - const isNewUI: string = ui.isNewUI.toString(); - const isOverridden: string = (settings.experimentalFeatures ?? false).toString(); - telemetry.logLanguageServerEvent(`experiment${command}`, { newUI: isNewUI, uiOverride: isOverridden }); + const properties: {[key: string]: string} = { + newUI: ui.isNewUI.toString(), + uiOverride: (settings.experimentalFeatures ?? false).toString(), + sender: util.isString(sender) ? sender : 'commandPalette' + }; + telemetry.logLanguageServerEvent(`experiment${command}`, properties); } function onDisabledCommand(): void { @@ -506,7 +447,8 @@ function onDisabledCommand(): void { vscode.window.showWarningMessage(message); } -function onRestartIntelliSenseForFile(): void { +function onRestartIntelliSenseForFile(sender?: any): void { + logForUIExperiment("RestartIntelliSenseForFile", sender); const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor; if (!activeEditor || !activeEditor.document || activeEditor.document.uri.scheme !== "file" || (activeEditor.document.languageId !== "c" && activeEditor.document.languageId !== "cpp" && activeEditor.document.languageId !== "cuda-cpp")) { @@ -590,7 +532,8 @@ function selectDefaultCompiler(): void { clients.ActiveClient.promptSelectCompiler(true); } -function onSelectConfiguration(): void { +function onSelectConfiguration(sender?: any): void { + logForUIExperiment("ConfigurationSelect", sender); if (!isFolderOpen()) { vscode.window.showInformationMessage(localize("configuration.select.first", 'Open a folder first to select a configuration.')); } else { @@ -656,7 +599,8 @@ function onGoToPrevDirectiveInGroup(): void { client.handleGoToDirectiveInGroup(false); } -function onCheckForCompiler(): void { +function onCheckForCompiler(sender?: any): void { + logForUIExperiment("CheckForCompiler", sender); const client: Client = getActiveClient(); client.handleCheckForCompiler(); } @@ -769,11 +713,13 @@ function onToggleDimInactiveRegions(): void { settings.update("dimInactiveRegions", !settings.dimInactiveRegions); } -function onPauseParsing(): void { +function onPauseParsing(sender?: any): void { + logForUIExperiment("ParsingCommands", sender); clients.ActiveClient.pauseParsing(); } -function onResumeParsing(): void { +function onResumeParsing(sender?: any): void { + logForUIExperiment("ParsingCommands", sender); clients.ActiveClient.resumeParsing(); } @@ -789,19 +735,23 @@ function onCancelCodeAnalysis(): void { clients.ActiveClient.CancelCodeAnalysis(); } -function onShowParsingCommands(): void { +function onShowParsingCommands(sender?: any): void { + logForUIExperiment("ParsingCommands", sender); clients.ActiveClient.handleShowParsingCommands(); } -function onShowActiveCodeAnalysisCommands(): void { +function onShowActiveCodeAnalysisCommands(sender?: any): void { + logForUIExperiment("ShowActiveCodeAnalysisCommands", sender); clients.ActiveClient.handleShowActiveCodeAnalysisCommands(); } -function onShowIdleCodeAnalysisCommands(): void { +function onShowIdleCodeAnalysisCommands(sender?: any): void { + logForUIExperiment("ShowIdleCodeAnalysisCommands", sender); clients.ActiveClient.handleShowIdleCodeAnalysisCommands(); } -function onShowReferencesProgress(): void { +function onShowReferencesProgress(sender?: any): void { + logForUIExperiment("ShowReferencesProgress", sender); clients.ActiveClient.handleReferencesIcon(); } @@ -898,7 +848,8 @@ function onLogDiagnostics(): void { clients.ActiveClient.logDiagnostics(); } -function onRescanWorkspace(): void { +function onRescanWorkspace(sender?: string): void { + logForUIExperiment("RescanWorkspace", sender); clients.ActiveClient.rescanFolder(); } diff --git a/Extension/src/LanguageServer/ui.ts b/Extension/src/LanguageServer/ui.ts index 4e47556ee..c8eb52f30 100644 --- a/Extension/src/LanguageServer/ui.ts +++ b/Extension/src/LanguageServer/ui.ts @@ -56,6 +56,8 @@ interface ConfigurationStatus { priority: ConfigurationPriority; } +const commandArguments: string[] = ['oldUI']; // We report the sender of the command + export class OldUI implements UI { private configStatusBarItem: vscode.StatusBarItem; private browseEngineStatusBarItem: vscode.StatusBarItem; @@ -84,14 +86,22 @@ export class OldUI implements UI { const configTooltip: string = localize("c.cpp.configuration.tooltip", "C/C++ Configuration"); this.configStatusBarItem = vscode.window.createStatusBarItem("c.cpp.configuration.tooltip", vscode.StatusBarAlignment.Right, 0); this.configStatusBarItem.name = configTooltip; - this.configStatusBarItem.command = "C_Cpp.ConfigurationSelectUI_Telemetry"; + this.configStatusBarItem.command = { + command: "C_Cpp.ConfigurationSelect", + title: configTooltip, + arguments: commandArguments + }; this.configStatusBarItem.tooltip = configTooltip; this.ShowConfiguration = true; this.referencesStatusBarItem = vscode.window.createStatusBarItem("c.cpp.references.statusbar", vscode.StatusBarAlignment.Right, 901); this.referencesStatusBarItem.name = localize("c.cpp.references.statusbar", "C/C++ References Status"); this.referencesStatusBarItem.tooltip = ""; - this.referencesStatusBarItem.command = "C_Cpp.ShowReferencesProgressUI_Telemetry"; + this.referencesStatusBarItem.command = { + command: "C_Cpp.ShowReferencesProgress", + title: this.referencesStatusBarItem.name, + arguments: commandArguments + }; this.ShowReferencesIcon = false; this.intelliSenseStatusBarItem = vscode.window.createStatusBarItem("c.cpp.intellisense.statusbar", vscode.StatusBarAlignment.Right, 903); @@ -133,7 +143,11 @@ export class OldUI implements UI { private setIsParsingWorkspacePausable(val: boolean): void { if (val) { - this.browseEngineStatusBarItem.command = "C_Cpp.ShowParsingCommandsUI_Telemetry"; + this.browseEngineStatusBarItem.command = { + command: "C_Cpp.ShowParsingCommands", + title: this.browseEngineStatusBarItem.name ?? '', + arguments: commandArguments + }; } else { this.browseEngineStatusBarItem.command = undefined; } @@ -189,7 +203,11 @@ export class OldUI implements UI { this.intelliSenseStatusBarItem.tooltip = (this.isUpdatingIntelliSense ? this.updatingIntelliSenseTooltip : "") + (twoStatus ? " | " : "") + (val ? this.runningCodeAnalysisTooltip : ""); - this.intelliSenseStatusBarItem.command = val ? "C_Cpp.ShowActiveCodeAnalysisCommandsUI_Telemetry" : undefined; + this.intelliSenseStatusBarItem.command = val ? { + command: "C_Cpp.ShowActiveCodeAnalysisCommands", + title: this.intelliSenseStatusBarItem.name ?? '', + arguments: commandArguments + } : undefined; } private updateCodeAnalysisTooltip(): void { diff --git a/Extension/src/LanguageServer/ui_new.ts b/Extension/src/LanguageServer/ui_new.ts index 2cb62a62d..e679c2642 100644 --- a/Extension/src/LanguageServer/ui_new.ts +++ b/Extension/src/LanguageServer/ui_new.ts @@ -43,12 +43,14 @@ enum LanguageStatusPriority { Low = 3 } +const commandArguments: string[] = ['newUI']; // We report the sender of the command + export class NewUI implements UI { - private configStatusBarItem: vscode.LanguageStatusItem; - private browseEngineStatusBarItem: vscode.LanguageStatusItem; - private intelliSenseStatusBarItem: vscode.LanguageStatusItem; + private configStatusItem: vscode.LanguageStatusItem; + private browseEngineStatusItem: vscode.LanguageStatusItem; + private intelliSenseStatusItem: vscode.LanguageStatusItem; private referencesStatusBarItem: vscode.StatusBarItem; - private codeAnalysisStatusBarItem: vscode.LanguageStatusItem; + private codeAnalysisStatusItem: vscode.LanguageStatusItem; private configDocumentSelector: vscode.DocumentFilter[] = [ { scheme: 'file', language: 'c' }, { scheme: 'file', language: 'cpp' }, @@ -90,72 +92,79 @@ export class NewUI implements UI { get isNewUI(): boolean { return true; }; constructor() { - this.configStatusBarItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.First}.configuration`, this.configDocumentSelector); - this.configStatusBarItem.name = localize("cpptools.status.configuration", "Select Configuration"); - this.configStatusBarItem.text = "Loading configuration..."; - this.configStatusBarItem.command = { - command: "C_Cpp.ConfigurationSelectUI_Telemetry", - title: this.configStatusBarItem.name as string, - tooltip: this.configStatusBarItem.name as string + this.configStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.First}.configuration`, this.configDocumentSelector); + this.configStatusItem.name = localize("cpptools.status.configuration", "Select Configuration"); + this.configStatusItem.text = "Loading configuration..."; + this.configStatusItem.command = { + command: "C_Cpp.ConfigurationSelect", + title: this.configStatusItem.name, + tooltip: this.configStatusItem.name, + arguments: commandArguments }; this.referencesStatusBarItem = vscode.window.createStatusBarItem(`c.cpp.references.statusbar`, vscode.StatusBarAlignment.Right, 901); this.referencesStatusBarItem.name = localize("c.cpp.references.statusbar", "C/C++ References Status"); this.referencesStatusBarItem.tooltip = ""; - this.referencesStatusBarItem.command = "C_Cpp.ShowReferencesProgressUI_Telemetry"; + this.referencesStatusBarItem.command = { + command: "C_Cpp.ShowReferencesProgress", + title: this.referencesStatusBarItem.name, + arguments: commandArguments + }; this.ShowReferencesIcon = false; - this.intelliSenseStatusBarItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.intellisense`, documentSelector); - this.intelliSenseStatusBarItem.name = localize("cpptools.status.intellisense", "C/C++ IntelliSense Status"); - this.intelliSenseStatusBarItem.text = this.idleIntelliSenseText; - - this.browseEngineStatusBarItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.tagparser`, documentSelector); - this.browseEngineStatusBarItem.name = localize("cpptools.status.tagparser", "C/C++ Tag Parser Status"); - this.browseEngineStatusBarItem.detail = localize("cpptools.detail.tagparser", "Initializing..."); - this.browseEngineStatusBarItem.text = "$(database)"; - this.browseEngineStatusBarItem.command = { - command: "C_Cpp.RescanWorkspaceUI_Telemetry", - title: this.workspaceRescanText + this.intelliSenseStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.intellisense`, documentSelector); + this.intelliSenseStatusItem.name = localize("cpptools.status.intellisense", "C/C++ IntelliSense Status"); + this.intelliSenseStatusItem.text = this.idleIntelliSenseText; + + this.browseEngineStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.tagparser`, documentSelector); + this.browseEngineStatusItem.name = localize("cpptools.status.tagparser", "C/C++ Tag Parser Status"); + this.browseEngineStatusItem.detail = localize("cpptools.detail.tagparser", "Initializing..."); + this.browseEngineStatusItem.text = "$(database)"; + this.browseEngineStatusItem.command = { + command: "C_Cpp.RescanWorkspace", + title: this.workspaceRescanText, + arguments: commandArguments }; this.workspaceParsingStatus = this.workspaceParsingRunningText; - this.codeAnalysisStatusBarItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Low}.codeanalysis`, documentSelector); - this.codeAnalysisStatusBarItem.name = localize("cpptools.status.codeanalysis", "C/C++ Code Analysis Status"); - this.codeAnalysisStatusBarItem.text = `Code Analysis Mode: ${this.codeAnalysisCurrentMode()}`; - this.codeAnalysisStatusBarItem.command = { - command: "C_Cpp.ShowIdleCodeAnalysisCommandsUI_Telemetry", - title: localize("c.cpp.codeanalysis.statusbar.runNow", "Run Now") + this.codeAnalysisStatusItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Low}.codeanalysis`, documentSelector); + this.codeAnalysisStatusItem.name = localize("cpptools.status.codeanalysis", "C/C++ Code Analysis Status"); + this.codeAnalysisStatusItem.text = `Code Analysis Mode: ${this.codeAnalysisCurrentMode()}`; + this.codeAnalysisStatusItem.command = { + command: "C_Cpp.ShowIdleCodeAnalysisCommands", + title: localize("c.cpp.codeanalysis.statusbar.runNow", "Run Now"), + arguments: commandArguments }; } private set ActiveConfig(label: string) { - this.configStatusBarItem.text = label ?? localize("configuration.notselected.text", "Configuration: Not selected"); - if (this.configStatusBarItem.command) { - this.configStatusBarItem.command.title = localize("configuration.selected.text", "Select Configuration"); + this.configStatusItem.text = label ?? localize("configuration.notselected.text", "Configuration: Not selected"); + if (this.configStatusItem.command) { + this.configStatusItem.command.title = localize("configuration.selected.text", "Select Configuration"); } } private set TagParseStatus(label: string) { this.workspaceParsingProgress = label; - if (this.browseEngineStatusBarItem.command) { + if (this.browseEngineStatusItem.command) { // Currently needed in order to update hover tooltip - this.browseEngineStatusBarItem.command.tooltip = (this.isParsingFiles ? `${this.parsingFilesTooltip} | ` : "") + this.workspaceParsingProgress; - this.browseEngineStatusBarItem.text = this.browseEngineStatusBarItem.text; + this.browseEngineStatusItem.command.tooltip = (this.isParsingFiles ? `${this.parsingFilesTooltip} | ` : "") + this.workspaceParsingProgress; + this.browseEngineStatusItem.text = this.browseEngineStatusItem.text; } } private setIsInitializingWorkspace(val: boolean): void { if (val) { - this.browseEngineStatusBarItem.text = "$(database)"; - this.browseEngineStatusBarItem.detail = this.workspaceParsingInitializing; + this.browseEngineStatusItem.text = "$(database)"; + this.browseEngineStatusItem.detail = this.workspaceParsingInitializing; } } private setIsIndexingWorkspace(val: boolean): void { if (val) { - this.browseEngineStatusBarItem.text = "$(database)"; - this.browseEngineStatusBarItem.detail = this.workspaceParsingIndexing; - this.browseEngineStatusBarItem.busy = true; + this.browseEngineStatusItem.text = "$(database)"; + this.browseEngineStatusItem.detail = this.workspaceParsingIndexing; + this.browseEngineStatusItem.busy = true; } } @@ -165,22 +174,23 @@ export class NewUI implements UI { const showIcon: boolean = val || this.isParsingFiles; // Leave this outside for more realtime respone - this.browseEngineStatusBarItem.busy = showIcon; + this.browseEngineStatusItem.busy = showIcon; if (showIcon) { - this.browseEngineStatusBarItem.text = "$(database)"; - this.browseEngineStatusBarItem.detail = this.tagParseText(); + this.browseEngineStatusItem.text = "$(database)"; + this.browseEngineStatusItem.detail = this.tagParseText(); if (this.dbTimeout) { clearTimeout(this.dbTimeout); } } else { this.dbTimeout = setTimeout(() => { - this.browseEngineStatusBarItem.text = this.workspaceParsingDoneText; - this.browseEngineStatusBarItem.detail = ""; - this.browseEngineStatusBarItem.command = { - command: "C_Cpp.RescanWorkspaceUI_Telemetry", - title: this.workspaceRescanText + this.browseEngineStatusItem.text = this.workspaceParsingDoneText; + this.browseEngineStatusItem.detail = ""; + this.browseEngineStatusItem.command = { + command: "C_Cpp.RescanWorkspace", + title: this.workspaceRescanText, + arguments: commandArguments }; }, this.iconDelayTime); } @@ -199,9 +209,10 @@ export class NewUI implements UI { private setIsParsingWorkspacePausable(val: boolean): void { if (val && this.isParsingWorkspace) { - this.browseEngineStatusBarItem.command = { - command: "C_Cpp.PauseParsingUI_Telemetry", - title: localize("tagparser.pause.text", "Pause") + this.browseEngineStatusItem.command = { + command: "C_Cpp.PauseParsing", + title: localize("tagparser.pause.text", "Pause"), + arguments: commandArguments }; } } @@ -212,16 +223,18 @@ export class NewUI implements UI { return; } this.isParsingWorkspacePaused = val; - this.browseEngineStatusBarItem.busy = !val || this.isParsingFiles; - this.browseEngineStatusBarItem.text = "$(database)"; + this.browseEngineStatusItem.busy = !val || this.isParsingFiles; + this.browseEngineStatusItem.text = "$(database)"; this.workspaceParsingStatus = val ? this.workspaceParsingPausedText : this.workspaceParsingRunningText; - this.browseEngineStatusBarItem.detail = this.tagParseText(); - this.browseEngineStatusBarItem.command = val ? { - command: "C_Cpp.ResumeParsingUI_Telemetry", - title: localize("tagparser.resume.text", "Resume") + this.browseEngineStatusItem.detail = this.tagParseText(); + this.browseEngineStatusItem.command = val ? { + command: "C_Cpp.ResumeParsing", + title: localize("tagparser.resume.text", "Resume"), + arguments: commandArguments } : { - command: "C_Cpp.PauseParsingUI_Telemetry", - title: localize("tagparser.pause.text", "Pause") + command: "C_Cpp.PauseParsing", + title: localize("tagparser.pause.text", "Pause"), + arguments: commandArguments }; } @@ -231,32 +244,32 @@ export class NewUI implements UI { } this.isCodeAnalysisPaused = val; - this.codeAnalysisStatusBarItem.busy = !val; - this.codeAnalysisStatusBarItem.text = val ? this.codeAnalysisPausedText : this.codeAnalysisRunningText; + this.codeAnalysisStatusItem.busy = !val; + this.codeAnalysisStatusItem.text = val ? this.codeAnalysisPausedText : this.codeAnalysisRunningText; } private setIsParsingFiles(val: boolean): void { - this.isParsingFiles = val; const showIcon: boolean = val || this.isParsingWorkspace; // Leave this outside for more realtime respone - this.browseEngineStatusBarItem.busy = val || (!this.isParsingWorkspacePaused && this.isParsingWorkspace); + this.browseEngineStatusItem.busy = val || (!this.isParsingWorkspacePaused && this.isParsingWorkspace); if (showIcon) { - this.browseEngineStatusBarItem.text = "$(database)"; - this.browseEngineStatusBarItem.detail = this.tagParseText(); + this.browseEngineStatusItem.text = "$(database)"; + this.browseEngineStatusItem.detail = this.tagParseText(); if (this.dbTimeout) { clearTimeout(this.dbTimeout); } } else { this.dbTimeout = setTimeout(() => { - this.browseEngineStatusBarItem.text = this.workspaceParsingDoneText; - this.browseEngineStatusBarItem.detail = ""; - this.browseEngineStatusBarItem.command = { - command: "C_Cpp.RescanWorkspaceUI_Telemetry", - title: this.workspaceRescanText + this.browseEngineStatusItem.text = this.workspaceParsingDoneText; + this.browseEngineStatusItem.detail = ""; + this.browseEngineStatusItem.command = { + command: "C_Cpp.RescanWorkspace", + title: this.workspaceRescanText, + arguments: commandArguments }; }, this.iconDelayTime); } @@ -264,40 +277,41 @@ export class NewUI implements UI { private flameTimeout?: NodeJS.Timeout; private setIsUpdatingIntelliSense(val: boolean): void { - const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined); // TODO: Integrate with Tarik's feature to determine if compiler/bare-intellisense is configured if (settings.intelliSenseEngine === "disabled") { - this.intelliSenseStatusBarItem.text = this.missingIntelliSenseText; - this.intelliSenseStatusBarItem.command = { - command: "C_Cpp.CheckForCompilerUI_Telemetry", - title: localize("intellisense.select.text", "Select a Compiler") + this.intelliSenseStatusItem.text = this.missingIntelliSenseText; + this.intelliSenseStatusItem.command = { + command: "C_Cpp.CheckForCompiler", + title: localize("intellisense.select.text", "Select a Compiler"), + arguments: commandArguments }; return; } - this.intelliSenseStatusBarItem.busy = val; + this.intelliSenseStatusItem.busy = val; if (this.flameTimeout) { clearTimeout(this.flameTimeout); } if (val) { - this.intelliSenseStatusBarItem.text = "$(flame)"; - this.intelliSenseStatusBarItem.detail = this.updatingIntelliSenseText; + this.intelliSenseStatusItem.text = "$(flame)"; + this.intelliSenseStatusItem.detail = this.updatingIntelliSenseText; } else { this.flameTimeout = setTimeout(() => { - if (this.intelliSenseStatusBarItem) { - this.intelliSenseStatusBarItem.text = this.idleIntelliSenseText; - this.intelliSenseStatusBarItem.detail = ""; + if (this.intelliSenseStatusItem) { + this.intelliSenseStatusItem.text = this.idleIntelliSenseText; + this.intelliSenseStatusItem.detail = ""; } }, this.iconDelayTime); } - this.intelliSenseStatusBarItem.command = { - command: "C_Cpp.RestartIntelliSenseForFileUI_Telemetry", + this.intelliSenseStatusItem.command = { + command: "C_Cpp.RestartIntelliSenseForFile", title: localize("rescan.intellisense.text", "Rescan"), - tooltip: localize("rescan.intellisense.tooltip", "Rescan IntelliSense") + tooltip: localize("rescan.intellisense.tooltip", "Rescan IntelliSense"), + arguments: commandArguments }; } @@ -315,18 +329,20 @@ export class NewUI implements UI { this.codeAnalysisProcessed = 0; } this.isRunningCodeAnalysis = val; - this.codeAnalysisStatusBarItem.busy = val; + this.codeAnalysisStatusItem.busy = val; const activeText: string = this.isCodeAnalysisPaused ? this.codeAnalysisPausedText : this.codeAnalysisRunningText; const idleText: string = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode(); - this.codeAnalysisStatusBarItem.text = val ? activeText : idleText; - this.codeAnalysisStatusBarItem.command = val ? { - command: "C_Cpp.ShowActiveCodeAnalysisCommandsUI_Telemetry", + this.codeAnalysisStatusItem.text = val ? activeText : idleText; + this.codeAnalysisStatusItem.command = val ? { + command: "C_Cpp.ShowActiveCodeAnalysisCommands", title: localize("c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions", "Options"), // Make sure not to overwrite current progress - tooltip: this.codeAnalysisStatusBarItem.command?.tooltip ?? localize("startup.codeanalysis.status", "Starting...") + tooltip: this.codeAnalysisStatusItem.command?.tooltip ?? localize("startup.codeanalysis.status", "Starting..."), + arguments: commandArguments } : { - command: "C_Cpp.ShowIdleCodeAnalysisCommandsUI_Telemetry", - title: localize("c.cpp.codeanalysis.statusbar.showRunNowOptions", "Run Now") + command: "C_Cpp.ShowIdleCodeAnalysisCommands", + title: localize("c.cpp.codeanalysis.statusbar.showRunNowOptions", "Run Now"), + arguments: commandArguments }; } @@ -334,9 +350,9 @@ export class NewUI implements UI { this.codeAnalysProgress = localize({ key: "running.analysis.processed.tooltip", comment: [this.codeAnalysisTranslationHint] }, "Running {0}: {1} / {2} ({3}%)", this.codeAnalysisProgram, this.codeAnalysisProcessed, Math.max(this.codeAnalysisTotal, 1), Math.floor(100 * this.codeAnalysisProcessed / Math.max(this.codeAnalysisTotal, 1))); - if (this.codeAnalysisStatusBarItem.command) { - this.codeAnalysisStatusBarItem.command.tooltip = this.codeAnalysProgress; - this.codeAnalysisStatusBarItem.text = this.codeAnalysisStatusBarItem.text; + if (this.codeAnalysisStatusItem.command) { + this.codeAnalysisStatusItem.command.tooltip = this.codeAnalysProgress; + this.codeAnalysisStatusItem.text = this.codeAnalysisStatusItem.text; } this.setIsRunningCodeAnalysis(true); @@ -564,11 +580,11 @@ export class NewUI implements UI { } public dispose(): void { - this.configStatusBarItem.dispose(); - this.browseEngineStatusBarItem.dispose(); - this.intelliSenseStatusBarItem.dispose(); + this.configStatusItem.dispose(); + this.browseEngineStatusItem.dispose(); + this.intelliSenseStatusItem.dispose(); this.referencesStatusBarItem.dispose(); - this.codeAnalysisStatusBarItem.dispose(); + this.codeAnalysisStatusItem.dispose(); } }