actions.ts ×7

Frontier kind: Code frontier

unlabeled · c_5fd10092f67c

5 tests · 16140 LOC · 70 files · introduces 0 tests · 32 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges32 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2053 ranges16140 lines · 70 files · Browse complete extent
All tests (intent)
5 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 32 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/actions/common/actions.ts 30 introduced LOC · 7 ranges

Open complete file

56
57 export function isIMenuItem(item: unknown): item is IMenuItem {
58 > return (item as IMenuItem).command !== undefined; actions.ts
59 > }
60
61 export function isISubmenuItem(item: unknown): item is ISubmenuItem {
428
429 static for(id: MenuId): MenuRegistryChangeEvent {
430 > let value = this._all.get(id); actions.ts
431 > if (!value) {
432 > value = new MenuRegistryChangeEvent(id);
433 > this._all.set(id, value);
434 > }
435 > return value;
436 > }
437
438 static merge(events: IMenuRegistryChangeEvent[]): IMenuRegistryChangeEvent {
449
450 private constructor(private readonly id: MenuId) {
451 > this.has = candidate => candidate === id; actions.ts
452 > }
453 }
454
500
501 appendMenuItem(id: MenuId, item: IMenuItem | ISubmenuItem): IDisposable {
502 > let list = this._menuItems.get(id); actions.ts
503 > if (!list) {
504 > list = new LinkedList();
505 > this._menuItems.set(id, list);
506 > }
507 > const rm = list.push(item);
508 > this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(id));
509 > return markAsSingleton(toDisposable(() => {
510 > rm();
511 > this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(id));
512 > }));
513 > }
514
515 appendMenuItems(items: Iterable<{ id: MenuId; item: IMenuItem | ISubmenuItem }>): IDisposable {
522
523 getMenuItems(id: MenuId): Array<IMenuItem | ISubmenuItem> {
524 > let result: Array<IMenuItem | ISubmenuItem>; actions.ts
525 > if (this._menuItems.has(id)) {
526 > result = [...this._menuItems.get(id)!];
527 > } else {
528 result = [];
529 }
530 > if (id === MenuId.CommandPalette) { actions.ts
531 // CommandPalette is special because it shows
532 // all commands by default
533 this._appendImplicitItems(result);
534 }
535 > return result; actions.ts
536 > }
537
538 private _appendImplicitItems(result: Array<IMenuItem | ISubmenuItem>) {
src/vs/base/common/event.ts 2 introduced LOC · 1 range

Open complete file

1603
1604 if (!this.hasListeners()) {
1605 > return; event.ts
1606 > }
1607
1608 this._queuedEvents.push(event);