MCPcopy Create free account
hub / github.com/DTStack/molecule / closeToRight

Method closeToRight

src/services/workbench/editorService.ts:501–531  ·  view source on GitHub ↗
(tab: IEditorTab, groupId: UniqueId)

Source from the content-addressed store, hash-verified

499 }
500
501 public closeToRight(tab: IEditorTab, groupId: UniqueId) {
502 const groupIndex = this.getGroupIndexById(groupId);
503 if (groupIndex <= -1) return;
504
505 const { groups = [] } = this.state;
506 const nextGroups = [...groups];
507 const tabId = tab.id;
508 const nextGroup = nextGroups[groupIndex];
509 const nextTabData = nextGroup.data;
510
511 const tabIndex = nextTabData!.findIndex(searchById(tabId));
512 if (tabIndex <= -1) return;
513
514 const updateTabs = nextTabData?.slice(0, tabIndex + 1);
515 const removedTabs = cloneDeep(
516 nextTabData?.slice(tabIndex + 1).filter(
517 (item) =>
518 !this.isOpened(
519 item.id!,
520 nextGroups.filter((g) => g.id !== groupId)
521 )
522 )
523 );
524
525 this.updateGroup(groupId, {
526 data: updateTabs,
527 });
528 this.setActive(groupId, tabId!);
529 this.disposeModel(removedTabs || []);
530 this.explorerService.forceUpdate();
531 }
532
533 public closeToLeft(tab: IEditorTab, groupId: UniqueId) {
534 const groupIndex = this.getGroupIndexById(groupId);

Callers

nothing calls this directly

Calls 7

getGroupIndexByIdMethod · 0.95
isOpenedMethod · 0.95
updateGroupMethod · 0.95
setActiveMethod · 0.95
disposeModelMethod · 0.95
searchByIdFunction · 0.90
forceUpdateMethod · 0.80

Tested by

no test coverage detected