MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / openReferencesTab

Function openReferencesTab

src/components/referencesPanel/referencesTab.js:113–144  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

111}
112
113export async function openReferencesTab(options = {}) {
114 const { symbolName = "", references = [] } = options;
115
116 const tabName = `Refs: ${symbolName}`;
117 const existingFile = editorManager.getFile(tabName, "filename");
118 if (existingFile) {
119 existingFile.makeActive();
120 return existingFile;
121 }
122
123 clearHighlightCache();
124 const flatItems = await buildFlatList(references, symbolName);
125 const stats = getReferencesStats(references);
126
127 const tabView = createReferencesTab({ symbolName, references, flatItems });
128
129 const file = new EditorFile(tabName, {
130 type: "terminal",
131 content: tabView.container,
132 tabIcon: "icon linkinsert_link",
133 render: true,
134 });
135
136 file.setCustomTitle(() => stats.text);
137 tabView.init();
138
139 file.on("close", () => {
140 tabView.destroy();
141 });
142
143 return file;
144}
145
146export default {
147 createReferencesTab,

Callers 2

openInTabFunction · 0.90
findAllReferencesInTabFunction · 0.90

Calls 8

clearHighlightCacheFunction · 0.90
buildFlatListFunction · 0.90
getReferencesStatsFunction · 0.90
createReferencesTabFunction · 0.85
getFileMethod · 0.65
initMethod · 0.45
onMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected