Is there anyway to safely rename symbols across multiple files?

As an example I have the following type:

data NodeF atom a
 = Fraction { id :: Int, numerator :: Array a, denominator :: Array a }
 | Atom { id :: Int, value :: atom }

I would like to rename numerator to num and denominator to den. Are there any tools for doing this safely across a codebase? I don’t want to rely on my editor’s find-and-replace since it might renamed instances of “numerator” that aren’t part of Fraction.

I had a look at externs.json for a couple of the files, but it seems like they don’t have enough information to determine what symbols to rename.

1 Like

Usages from the PROTOCOL.md was somewhat helpful. I was able to issue the following command using purs ide client:

{
  "command": "usages", 
  "params": {
    "module": "Editor.Node", 
    "namespace": "value", 
    "identifier": "Fraction",
  }
}

And it return some results. Unfortunately, when I tried to do the same for "identifier": "numerator" it returned:

{"result":"Declaration not found","resultType":"error"}

I tried changing the namespace to "type" and "kind" but go the same result. Would it be possible to add this information to externs.json? I assume that’s what purs ide to respond to these querues.