« Home

sauron supports find references in project [programming-0003]

sauron now supports find references of a definition in a whole project scope at commit: 3f78957a. This is a final piece of my IDE development for Racket, I had this idea three years ago, but get completed till now. This is because the resource stability of Racket get a huge improved, make this possible, I don't have detailed number, but the same program three years earlier will take down DrRacket.

After the above nonsense, I should quickly explain the idea, it can be break to a few steps

  1. Everytime the project-directory is change (this is a configuration item), send update command to files' maintainer

  2. In each collector, record entries of reference like this: key is filename of definition and identifier of definition, value is the binding location (filename, start, and end position)

  3. When user use Cmd+B/Click, check the cursor is on a definition or on a binding. If cursor is on the later, open list-box to pick a reference/binding, and the selection will bring user to a new location

Now, let's look at the result: a definition in a.rkt, a provide and a local reference/binding, and a reference from another file b.rkt. Three references are showed in the list-box

After click the item, the frame move to binding location at b.rkt.

Anyway, this is a nice end for this project, in the future I will more focus on racket-langserver because it can help more users.