Change:
the setup of microsoft/vscode-python click the Test gutter decoration Numbers appear in random order: <img width="485" alt="image" src=""Also, if you change to , you'll get a very slow opening menu. cc
Maybe we should have a "X more tests..." item that opens a quickpick after like 10. What do you think
yeah agreed that its not worth displaying more than 10 tests in a quick pick and I think the "X more tests..." will be a good way to tell users

Discussion:
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; <ins> import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; </ins> import { themeColorFromId } from 'vs/platform/theme/common/themeService'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; import { EditorLineNumberContextMenu, GutterActionsRegistry } from 'vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu';

import { TestUriType, buildTestUri, parseTestUri } from 'vs/workbench/contrib/testing/common/testingUri'; const MAX_INLINE_MESSAGE_LENGTH = 128; <ins> const MAX_TESTS_IN_SUBMENU = 30; </ins> function isOriginalInDiffEditor(codeEditorService: ICodeEditorService, codeEditor: ICodeEditor): boolean { const diffEditors = codeEditorService.listDiffEditors();

} } <ins> interface IMultiRunTest { currentLabel: string; parent: TestId | undefined; testItem: { test: IncrementalTestCollectionItem; resultItem: TestResultItem | undefined; }; } </ins> class MultiRunTestDecoration extends RunTestDecoration implements ITestDecoration { <ins> constructor( tests: readonly { test: IncrementalTestCollectionItem; resultItem: TestResultItem | undefined; }[], visible: boolean, model: ITextModel, @ICodeEditorService codeEditorService: ICodeEditorService, @ITestService testService: ITestService, @IContextMenuService contextMenuService: IContextMenuService, @ICommandService commandService: ICommandService, @IConfigurationService configurationService: IConfigurationService, @ITestProfileService testProfileService: ITestProfileService, @IContextKeyService contextKeyService: IContextKeyService, @IMenuService menuService: IMenuService, @IQuickInputService private readonly quickInputService: IQuickInputService, ) { super(tests, visible, model, codeEditorService, testService, contextMenuService, commandService, configurationService, testProfileService, contextKeyService, menuService); } </ins> override getContextMenuActions() { const allActions: IAction[] = []; <del> if (this.tests.some(({ test }) => this.testProfileService.capabilitiesForTest(test) & TestRunProfileBitset.Run)) { </del> <ins> const canRun = this.tests.some(({ test }) => this.testProfileService.capabilitiesForTest(test) & TestRunProfileBitset.Run); if (canRun) { </ins> allActions.push(new Action('testing.gutter.runAll', localize('run all test', 'Run All Tests'), undefined, undefined, () => this.defaultRun())); } <del> if (this.tests.some(({ test }) => this.testProfileService.capabilitiesForTest(test) & TestRunProfileBitset.Debug)) { </del> <ins> const canDebug = this.tests.some(({ test }) => this.testProfileService.capabilitiesForTest(test) & TestRunProfileBitset.Debug); if (canDebug) { </ins> allActions.push(new Action('testing.gutter.debugAll', localize('debug all test', 'Debug All Tests'), undefined, undefined, () => this.defaultDebug())); } <del> const testItems = this.tests.map(testItem => ({ </del> <ins> const testItems = this.tests.map((testItem): IMultiRunTest => ({ </ins> currentLabel: testItem.test.item.label, testItem, parent: TestId.fromString(testItem.test.item.extId).parentId,

} } <ins> testItems.sort((a, b) => { const ai = a.testItem.test.item; const bi = b.testItem.test.item; return (ai.sortText || ai.label).localeCompare(bi.sortText || bi.label); }); </ins> const disposable = new DisposableStore(); <del> const testSubmenus = testItems.map(({ currentLabel, testItem }) => { </del> <ins> let testSubmenus: IAction[] = testItems.map(({ currentLabel, testItem }) => { </ins> const actions = this.getTestContextMenuActions(testItem.test, testItem.resultItem); disposable.add(actions); return new SubmenuAction(testItem.test.item.extId, stripIcons(currentLabel), actions.object); }); <ins> const overflow = testSubmenus.length - MAX_TESTS_IN_SUBMENU; if (overflow > 0) { testSubmenus = testSubmenus.slice(0, MAX_TESTS_IN_SUBMENU); testSubmenus.push(new Action( 'testing.gutter.overflow', localize('testOverflowItems', '{0} more tests...', overflow), undefined, undefined, () => this.pickAndRun(testItems), )); } </ins> return { object: Separator.join(allActions, testSubmenus), dispose: () => disposable.dispose() }; } <ins> private async pickAndRun(testItems: IMultiRunTest[]) { const doPick = <T extends IQuickPickItem>(items: T[], title: string) => new Promise<T | undefined>(resolve => { const pick = this.quickInputService.createQuickPick<T>(); pick.placeholder = title; pick.items = items; pick.onDidHide(() => { resolve(undefined); pick.dispose(); }); pick.onDidAccept(() => { resolve(pick.selectedItems[0]); pick.dispose(); }); pick.show(); }); const item = await doPick( testItems.map(({ currentLabel, testItem }) => ({ label: currentLabel, test: testItem.test, result: testItem.resultItem })), localize('selectTestToRun', 'Select a test to run'), ); if (!item) { return; } const actions = this.getTestContextMenuActions(item.test, item.result); try { (await doPick(actions.object, item.label))?.run(); } finally { actions.dispose(); } } </ins> } class RunSingleTestDecoration extends RunTestDecoration implements ITestDecoration {