Andrew
Andrew3mo ago

Find Usages of a procedure do not show client calls.

If I define a procedure:
const appRouter = router({
list: publicProcedure.query(...)
})
const appRouter = router({
list: publicProcedure.query(...)
})
and then use it in the client:
const res = await client.list.query()
const res = await client.list.query()
these usages don't show up with Find usages functionality for VS Code, and only inconsistently for WebStorm. How do people find the places where they're calling their endpoints in their client code? Are people just doing raw text searches?
3 Replies
Alex / KATT 🐱
Find references on list:
Andrew
Andrew3mo ago
Thanks for the response! Interestingly, finding references on list: works on VS Code, but not on WebStorm. For WS it appears to do nothing at all. A slight wrench in that approach is we're planning to spread the module in, like this:
import * as ping from "./api/ping";

export const appRouter = router({
ping: router({ ...ping }),
});
import * as ping from "./api/ping";

export const appRouter = router({
ping: router({ ...ping }),
});
Not a dealbreaker, and we could change that, but we're hoping to cut back on boilerplate for defining new endpoints. I'm curious if anyone's found an approach that works for WebStorm?
Alex / KATT 🐱
if i remember correctly, webstorm has it's own ts compiler or something so I have no idea