How to fix "This element cannot be renamed" in Typescript?

Viewed 779

What causes VS code editor to decide my typescript symbol cannot be renamed? I'm trying to change the symbol with the f2 key and run into the error message "This element cannot be renamed".

enter image description here

Although on some of my other projects the symbol is allowed to be renamed via f2. As I'm trying to troubleshoot this issue, I'm hoping to learn more about the issue so I can know if it is package issue, vscodes config or if having similar symbol names in a monorepo project can cause this issue?


"@typescript-eslint/eslint-plugin": "4.3.0",
"@typescript-eslint/parser": "4.3.0",
"typescript": "4.1.5"
1 Answers

Same problem happened to me but instead of using just F2. I used now ctrl+shift+L this will rename all the occurrences in program. It's not good as F2 command but it will do your work almost.

Related