Change:
configure "testing.defaultGutterClickAction": "contextMenu", open a test file and click on a test icon a context menu opens but the test commands aren't atop <img width="356" alt="Screenshot 2023-03-31 at 15 41 37" src="https://user-"

Discussion:
import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { registerEditorContribution, EditorContributionInstantiation } from 'vs/editor/browser/editorExtensions'; import { IEditorContribution } from 'vs/editor/common/editorCommon'; <del> import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; </del> <ins> import { IMenuService, MenuId, MenuItemAction, SubmenuItemAction } from 'vs/platform/actions/common/actions'; </ins> import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { TextEditorSelectionSource } from 'vs/platform/editor/common/editor';

import { Registry } from 'vs/platform/registry/common/platform'; export interface IGutterActionsGenerator { <del> (context: { lineNumber: number; editor: ICodeEditor; accessor: ServicesAccessor }, result: { push(action: IAction): void }): void; </del> <ins> (context: { lineNumber: number; editor: ICodeEditor; accessor: ServicesAccessor }, result: { push(action: IAction, group?: string): void }): void; </ins> } export class GutterActionsRegistryImpl {

const contextKeyService = this.contextKeyService.createOverlay([['editorLineNumber', lineNumber]]); const menu = this.menuService.createMenu(MenuId.EditorLineNumberContext, contextKeyService); <del> const actions: IAction[][] = []; </del> <ins> const allActions: [string, (IAction | MenuItemAction | SubmenuItemAction)[]][] = []; </ins> this.instantiationService.invokeFunction(accessor => { for (const generator of GutterActionsRegistry.getGutterActionsGenerators()) { <del> const collectedActions: IAction[] = []; generator({ lineNumber, editor: this.editor, accessor }, { push: (action: IAction) => collectedActions.push(action) }); actions.push(collectedActions); </del> <ins> const collectedActions = new Map<string, IAction[]>(); generator({ lineNumber, editor: this.editor, accessor }, { push: (action: IAction, group: string = 'navigation') => { const actions = (collectedActions.get(group) ?? []); actions.push(action); collectedActions.set(group, actions); } }); for (const [group, actions] of collectedActions.entries()) { allActions.push([group, actions]); } </ins> } <ins> allActions.sort((a, b) => a[0].localeCompare(b[0])); </ins> const menuActions = menu.getActions({ arg: { lineNumber, uri: model.uri }, shouldForwardArgs: true }); <del> actions.push(...menuActions.map(a => a[1])); </del> <ins> allActions.push(...menuActions); </ins> // if the current editor selections do not contain the target line number, // set the selection to the clicked line number

this.contextMenuService.showContextMenu({ getAnchor: () => anchor, <del> getActions: () => Separator.join(...actions), </del> <ins> getActions: () => Separator.join(...allActions.map((a) => a[1])), </ins> onHide: () => menu.dispose(), }); });

const actions = breakpointEditorContribution.getContextMenuActionsAtPosition(lineNumber, model); for (const action of actions) { <del> result.push(action); </del> <ins> result.push(action, '2_debug'); </ins> } });

if (decoration) { const { object: actions } = decoration.getContextMenuActions(); for (const action of actions) { <del> result.push(action); </del> <ins> result.push(action, '1_testing'); </ins> } } }