powershellvisual-studio-coderefactoring

PowerShell rename refactor (F2) does nothing in VS Code


Pressing F2 when editing a PowerShell file does nothing in VS Code. (for other languages like C#, Python rename refactor (F2) works fine)

What I've tried:


Solution

  • This is not currently supported by VS Code's builtin PowerShell language support or the non-builtin PowerShell VS Code extension, but there is an open feature-request issue ticket for it: F2 (rename) doesn't work for PowerShell variables #1440, and also "Smart" variable rename #261. I suggest that you give those issue tickets a thumbs up to show support for it. You can also subscribe to them to get notified about discussion and progress. Please avoid making noisy comments there like ones that just consist of "+1" / "bump". If you're interested in helping implement the feature, there's related guidance here.