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

Function activate

src/extensions/editorTree/index.ts:8–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6 name: 'Extends Editor Tree',
7 dispose() {},
8 activate() {
9 molecule.editorTree.onSelect((tabId, groupId) => {
10 molecule.editor.setActive(groupId, tabId);
11 });
12
13 molecule.editorTree.onClose((tabId, groupId) => {
14 molecule.editor.closeTab(tabId, groupId);
15 });
16
17 molecule.editorTree.onCloseOthers((tabItem, groupId) => {
18 molecule.editor.closeOther(tabItem, groupId);
19 });
20
21 molecule.editorTree.onCloseAll((groupId) => {
22 if (groupId) {
23 molecule.editor.closeAll(groupId);
24 } else {
25 const { groups } = molecule.editor.getState();
26 groups?.forEach((group) => {
27 molecule.editor.closeAll(group.id!);
28 });
29 }
30 });
31 },
32};

Callers

nothing calls this directly

Calls 9

getStateMethod · 0.80
onSelectMethod · 0.65
setActiveMethod · 0.65
onCloseMethod · 0.65
closeTabMethod · 0.65
onCloseOthersMethod · 0.65
closeOtherMethod · 0.65
onCloseAllMethod · 0.65
closeAllMethod · 0.65

Tested by

no test coverage detected