Skip to content

Commit 5599e05

Browse files
committed
Add disclaimer link
1 parent ffb7aef commit 5599e05

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,26 @@ The debugging functionality in PowerShell Editor Services is available in the fo
143143
- [powershell.nvim for Neovim](https://github.com/TheLeoP/powershell.nvim)
144144
- [intellij-powershell](https://github.com/ant-druha/intellij-powershell)
145145

146+
### Rename Disclaimer
147+
148+
PowerShell is not a statically typed language. As such, the renaming of functions, parameters, and other symbols can only be done on a best effort basis. While this is sufficient for the majority of use cases, it cannot be relied upon to find all instances of a symbol and rename them across an entire code base such as in C# or TypeScript.
149+
150+
There are several edge case scenarios which may exist where rename is difficult or impossible, or unable to be determined due to the dynamic scoping nature of PowerShell.
151+
152+
The focus of the rename support is on quick updates to variables or functions within a self-contained script file. It is not intended for module developers to find and rename a symbol across multiple files, which is very difficult to do as the relationships are primarily only computed at runtime and not possible to be statically analyzed.
153+
154+
🤚🤚 Unsupported Scenarios
155+
156+
❌ Renaming can only be done within a single file. Renaming symbols across multiple files is not supported.
157+
❌ Files containing dotsourcing are currently not supported.
158+
❌ Functions or variables must have a corresponding definition within their scope to be renamed. If we cannot find the original definition of a variable or function, the rename will not be supported.
159+
160+
👍👍 [Implemented and Tested Rename Scenarios](https://github.com/PowerShell/PowerShellEditorServices/blob/main/test/PowerShellEditorServices.Test.Shared/Refactoring)
161+
162+
📄📄 Filing a Rename Issue
163+
164+
If there is a rename scenario you feel can be reasonably supported in PowerShell, please file a bug report in the PowerShellEditorServices repository with the "Expected" and "Actual" being the before and after rename. We will evaluate it and accept or reject it and give reasons why. Items that fall under the Unsupported Scenarios above will be summarily rejected, however that does not mean that they may not be supported in the future if we come up with a reasonably safe way to implement a scenario.
165+
146166
## API Usage
147167

148168
Please note that we only consider the following as stable APIs that can be relied on:

src/PowerShellEditorServices/Services/TextDocument/RenameService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ private async Task<bool> AcceptRenameDisclaimer(bool acceptDisclaimerOption, Can
215215
if (acceptDisclaimerOption || disclaimerAcceptedForSession) { return true; }
216216

217217
// TODO: Localization
218-
const string renameDisclaimer = "PowerShell rename functionality is only supported in a limited set of circumstances. Please review the notice and understand the limitations and risks.";
218+
const string renameDisclaimer = "PowerShell rename functionality is only supported in a limited set of circumstances. [Please review the notice](https://github.com/PowerShell/PowerShellEditorServices?tab=readme-ov-file#rename-disclaimer) and accept the limitations and risks.";
219219
const string acceptAnswer = "I Accept";
220220
// const string acceptWorkspaceAnswer = "I Accept [Workspace]";
221221
// const string acceptSessionAnswer = "I Accept [Session]";

0 commit comments

Comments
 (0)