You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Every #[tauri::command] looks like dead code #1543
tl;dr: in a Tauri app, callers and impact come back empty for every #[tauri::command], even when the whole frontend calls it.
Details here:
The frontend reaches Rust through a runtime IPC hop, so there's no call for tree-sitter to see. With tauri-specta there's a name change on top (get_mcp_port becomes getMcpPort), so even a name-based guess misses.
On main (c6aaa20): ℹ No callers found for "get_mcp_port", 6 nodes and 4 edges.
With #878: Callers of "get_mcp_port" (1): src/app.ts:1, 6 nodes and 5 edges.
On real apps
Cmdr (tauri-specta, Tauri 2 + Svelte 5, ~25k nodes): 291 commands gain their frontend callers, events bridge across the case change too.
clash-verge-rev (raw invoke): 76 of 79 commands bridge through its cmds.ts wrapper.
pot-desktop (raw invoke): 3 of 3.
#878 has the fix: one new file, a 4-line registration, 23 tests, no new deps. Rebased on current main today.
Reframing my earlier #772, which asked whether you'd want this. Closing that one in favor of this.
Thanks for the detailed report, @vdavid, and thanks for using CodeGraph! This is fixed on main by #2019: Rust functions annotated #[tauri::command] are now recorded as decorated entry points, so the dead-code report no longer lists them (they're invoked from the frontend at runtime). The fix will be in the next release.
@colbymchenry, unfortunately, this doesn't solve my problem. callers and impact still return nothing for a #[tauri::command] that the frontend calls. The repro in the issue body still gives No callers found for "get_mcp_port" on main, because #2019 marks commands as used but adds no edges from the frontend invoke(...) calls. In my app Cmdr, that's ~290 commands where impact can't see the frontend at all.
Could you reopen this issue? Or I can open a new issue just for callers/impact if you'd prefer.
If you want the bridge in CodeGraph, I'm happy to rework my earlier PR #878 (got no reviews so far). My ideas:
Activity
fix(dead-code): exclude annotated Tauri commands (#1543) (#2019)
colbymchenry commentedon Sep 27, 2026
Thanks for the detailed report, @vdavid, and thanks for using CodeGraph! This is fixed on
mainby #2019: Rust functions annotated#[tauri::command]are now recorded as decorated entry points, so the dead-code report no longer lists them (they're invoked from the frontend at runtime). The fix will be in the next release.vdavid commentedon Sep 27, 2026
@colbymchenry, unfortunately, this doesn't solve my problem.
callersandimpactstill return nothing for a#[tauri::command]that the frontend calls. The repro in the issue body still givesNo callers found for "get_mcp_port"onmain, because #2019 marks commands as used but adds no edges from the frontendinvoke(...)calls. In my app Cmdr, that's ~290 commands whereimpactcan't see the frontend at all.Could you reopen this issue? Or I can open a new issue just for
callers/impactif you'd prefer.If you want the bridge in CodeGraph, I'm happy to rework my earlier PR #878 (got no reviews so far). My ideas:
tauri::commanddecorator to find commands, which removes the detection code from feat(tauri): cross-language IPC bridge resolver (#772) #878invoke('snake_name')first, andtauri-specta's camelCase names as a separate PRmain.And if an IPC bridge isn't something you want in CodeGraph, that's fine too. Just say so and I'll close #878.