Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 1 addition & 3 deletions src/status-bar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ describe('StatusBar', () => {
targetType: 'target'
}]);
const cmsisToolboxManager = cmsisToolboxManagerFactory();
cmsisToolboxManager.getSetupMessages = jest.fn().mockReturnValue(['message1', 'message2']);

const statusBar = new StatusBar(solutionManager, cmsisToolboxManager, themeProvider);
await statusBar.activate(extensionContext);
Expand All @@ -110,10 +109,9 @@ describe('StatusBar', () => {

// end cmsis tool
cmsisToolboxManager.mockTriggerOnRunCmsisTool(false, false);
expect(cmsisToolboxManager.getSetupMessages).toHaveBeenCalledWith('project.build+target');
expect(statusBarItem.show).toHaveBeenCalledTimes(4);
expect(statusBarItem.text).toBe('$(target) target@set');
expect(statusBarItem.tooltip.valueOf()).toEqual('**solution/test**\n - project.build\n - message1\n - message2\n');
expect(statusBarItem.tooltip.valueOf()).toEqual('**solution/test**\n - project.build\n');

// cbuild setup completed and files loaded successfully
solutionManager.onLoadedBuildFilesEmitter.fire(['success', false]);
Expand Down
3 changes: 1 addition & 2 deletions src/status-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,8 @@ export class StatusBar {
}

protected contextToolTip(context: ContextDescriptor): string {
const messages = this.cmsisToolboxManager.getSetupMessages(context.displayName)?.map(m => ` - ${m}`) ?? [];
const build = context.buildType ? `.${context.buildType}` : '';
return ` - ${context.projectName}${build}\n${messages.join('\n')}\n`;
return ` - ${context.projectName}${build}\n`;
}

protected updateIconStatus(statusBarItem: vscode.StatusBarItem, start: boolean, packs?: boolean): void {
Expand Down
Loading