Funny behaviour with Deno's 'Rename Symbol'

There’s one command in the Deno extension which doesn’t quite work. As the author of said extension, I don’t think there’s anything missing which I’m supposed to be providing.

The command is ‘Rename Symbol’. So if you have a MAXIMUM_LENGTH variable that you’re importing in many places, and you decide it’d be better as MAXIMUM_SIZE, this command helps you update every reference to this variable to the new name.

This command works great when the variable being renamed only exists in a single file.

But when the variable being renamed is referenced from many files, things get weird: after the command is triggered, Nova only updates one file’s references to that variable. To rename it in the other files, you have to rerun the command multiple times until the file the variable originates from is modified.

For example:

  • constants.ts contains our variable MAXIMUM_LENGTH
  • fns.ts contains references to said variable
  • classes.ts contains references to said variable.
  1. On the first run of Rename Symbol, the references in classes.ts will be updated, but nowhere else.
  2. On the second run of Rename Symbol, the references in fns.ts will be updated, but not in constants.ts
  3. When all files referencing the variable have been modified, the file the variable originates from, constants.ts will be update.

My hunch is that the Deno LSP is sending multiple / concurrent requests to modify documents in the workspace, and that Nova only handles the first of these. If there’s something that I as the extension author need to do, I’d love to know!