Skip to content

enum.rename() does not rename references when enum.setIsExported(true) is called first #1661

@guillaume-docquier-vention

Description

Great library by the way!

I use the following code to prefix all variables, functions and enums in my file.

sourceFile.getEnumOrThrow(`MyEnum`).setIsExported(true)

const thingsToRename = [...sourceFile.getVariableDeclarations(), ...sourceFile.getFunctions(), ...sourceFile.getEnums()]
for (const thingToRename of thingsToRename) {
  thingToRename.rename(`${prefix}${thingToRename.getName()}`)
}

It works great, everything gets renamed.
However, MyEnum references are not handled (other enums are fine).

If I call setIsExported after doing the renaming, everything is okay.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions