Skip to main content

A real example

Same name. Different code.

Kin tells two same-name functions apart, shows the callers it recorded for each, and keeps an edit to one of them through a restart.

Two functions named listRun

Behind gh issue list

listRun

  • NewCmdList
  • runCommand
  • TestIssueList_web

Behind gh secret list

listRun

  • NewCmdList
  • Test_listRun
  • Test_listRun_populatesNumSelectedReposIfRequired
Both functions are named listRun. Kin keeps them apart by identity, not by name, and lists the callers it recorded for each. Both are called by a function named NewCmdList, and those are two different functions too.

An edit that survives a restart

listRun behind gh issue list

Recorded as "Cache issue feature detection for twelve hours"

if opts.Detector == nil {
Before: cachedClient := api.NewCachedHTTPClient(httpClient, time.Hour*24)
After: cachedClient := api.NewCachedHTTPClient(httpClient, time.Hour*12)
opts.Detector = fd.NewDetector(cachedClient, baseRepo.RepoHost())
}
features, err := opts.Detector.IssueFeatures()
The edit changes how long a cache is kept, from 24 hours to 12. It was made for this example, not taken from GitHub CLI.
  1. RecordedKin kept the edit as a change in its own history.
  2. StoppedKin's background service for the project was shut down.
  3. ReopenedA new session read the edit back, with the same three callers.
How this was captured

These are saved runs, not live queries. They used released Kin 0.7.20, an older build than the current release, on a one-commit snapshot of GitHub CLI at 14d339d9ba87e87f34b7a25f00200a2062f87039.

The two caller answers come from separate saved runs with the Go language server, gopls. Each answer reports 20 functions named listRun in the project, and this page shows two of them.

The edit and the restart come from another run on the same snapshot, in a repository of its own, with Kin's full tool set, on CPU and without gopls.

Coverage is partial. This Kin build records no links for Go imports, so each list shows the callers Kin recorded, which may not be all of them. After the edit, Kin reported that linking across files was still catching up, at 0 of 708 files.

The function keeps one identity across the edit and the restart within this run only. The imported state is change 7c16ade6f772 and the recorded edit is change db6e4fb4cedc.

Read the full case record

Try it on your own code.