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

reorder entries #173671

Merged
merged 1 commit into from Feb 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/vs/workbench/contrib/logs/common/logsActions.ts
Expand Up @@ -66,12 +66,12 @@ export class SetLogLevelAction extends Action {
const entries: (LogLevelQuickPickItem | LogChannelQuickPickItem | IQuickPickSeparator)[] = [];
entries.push({ type: 'separator', label: nls.localize('all', "All") });
entries.push(...this.getLogLevelEntries(defaultLogLevels.default, this.loggerService.getLogLevel()));
entries.push({ type: 'separator', label: nls.localize('loggers', "Logs") });
entries.push(...logs.sort((a, b) => a.label.localeCompare(b.label)));
if (extensionLogs.length && logs.length) {
if (extensionLogs.length) {
entries.push({ type: 'separator', label: nls.localize('extensionLogs', "Extension Logs") });
entries.push(...extensionLogs.sort((a, b) => a.label.localeCompare(b.label)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How many entries is extensionLogs going to have? Maybe you shouldn't use ... here, as it quickly causes a stack overflow for too long lists.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not many. So this is safe!

}
entries.push(...extensionLogs.sort((a, b) => a.label.localeCompare(b.label)));
entries.push({ type: 'separator', label: nls.localize('loggers', "Logs") });
entries.push(...logs.sort((a, b) => a.label.localeCompare(b.label)));

return new Promise((resolve, reject) => {
const disposables = new DisposableStore();
Expand Down