MCPcopy Create free account
hub / github.com/esengine/esengine / getVisibleFilePaths

Function getVisibleFilePaths

packages/editor-app/src/components/FileTree.tsx:67–80  ·  view source on GitHub ↗
(nodes: TreeNode[])

Source from the content-addressed store, hash-verified

65
66 // Flatten visible file nodes for range selection
67 const getVisibleFilePaths = (nodes: TreeNode[]): string[] => {
68 const paths: string[] = [];
69 const traverse = (nodeList: TreeNode[]) => {
70 for (const node of nodeList) {
71 if (node.type === 'file') {
72 paths.push(node.path);
73 } else if (node.type === 'folder' && node.expanded && node.children) {
74 traverse(node.children);
75 }
76 }
77 };
78 traverse(nodes);
79 return paths;
80 };
81 const [contextMenu, setContextMenu] = useState<{
82 position: { x: number; y: number };
83 node: TreeNode | null;

Callers 1

handleNodeClickFunction · 0.85

Calls 1

traverseFunction · 0.70

Tested by

no test coverage detected