Title: Add support for renaming PowerShell class references · Issue #2293 · PowerShell/PowerShellEditorServices · GitHub
Open Graph Title: Add support for renaming PowerShell class references · Issue #2293 · PowerShell/PowerShellEditorServices
X Title: Add support for renaming PowerShell class references · Issue #2293 · PowerShell/PowerShellEditorServices
Description: Prerequisites I have written a descriptive issue title. I have searched all open and closed issues to ensure it has not already been reported. I have read the troubleshooting guide. I am sure this issue is with PowerShell Editor Services...
Open Graph Description: Prerequisites I have written a descriptive issue title. I have searched all open and closed issues to ensure it has not already been reported. I have read the troubleshooting guide. I am sure this ...
X Description: Prerequisites I have written a descriptive issue title. I have searched all open and closed issues to ensure it has not already been reported. I have read the troubleshooting guide. I am sure this ...
Opengraph URL: https://github.com/PowerShell/PowerShellEditorServices/issues/2293
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add support for renaming PowerShell class references","articleBody":"### Prerequisites\n\n- [x] I have written a descriptive issue title.\n- [x] I have searched all [_open and closed_ issues](https://github.com/PowerShell/PowerShellEditorServices/issues?q=is%3Aissue) to ensure it has not already been reported.\n- [x] I have read the [troubleshooting](https://github.com/PowerShell/vscode-powershell/blob/main/docs/troubleshooting.md) guide.\n- [x] I am sure this issue is with _PowerShell Editor Services itself_ and does not reproduce in a standalone [PowerShell](https://github.com/PowerShell/PowerShell/issues/new/choose) instance, and is not an issue with my editor.\n- [x] I have verified that I am using the latest version of PowerShell Editor Services.\n- [ ] If this is a security issue, I have read the [security issue reporting guidance](https://github.com/PowerShell/vscode-powershell/blob/main/SECURITY.md).\n\n### Summary\n\nThis is not a bug, but the README says that rename scenarios should be filed as bug reports, so that's what I'm doing.\nI think it should be fairly trivial to add renaming support for PowerShell classes defined in the same script file.\nExpected:\n\n```\nclass DemoClass\n{\n [string] $SomeProperty\n\n DemoClass ([string] $SomeArg)\n {\n $this.SomeProperty = $SomeArg\n }\n}\n\n[DemoClass]\n```\nActual:\n```\nclass NewName\n{\n [string] $SomeProperty\n\n NewName ([string] $SomeArg)\n {\n $this.SomeProperty = $SomeArg\n }\n}\n\n[NewName]\n```\n\nOne thing to keep in mind during implementation is that a PowerShell class can also be used to define an attribute, and an attribute type can drop the optional Attribute suffix in an attribute context as seen here:\n```\nclass ValidateSomethingAttribute : System.Management.Automation.ValidateArgumentsAttribute\n{\n [void]Validate([System.Object]$arguments, [System.Management.Automation.EngineIntrinsics]$engineIntrinsics)\n {\n }\n}\n[ValidateSomething()][string]$Path = \"c:\\windows\"\n```\n\n### PowerShell Version\n\n```console\nName Value\n---- -----\nPSVersion 7.6.1\nPSEdition Core\nGitCommitId 7.6.1\nOS Microsoft Windows 10.0.26200\nPlatform Win32NT\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\nPSRemotingProtocolVersion 2.4\nSerializationVersion 1.1.0.1\nWSManStackVersion 3.0\n```\n\n### Editor Version\n\n```console\nVS code:\n\nVersion: 1.117.0 (system setup)\nCommit: 10c8e557c8b9f9ed0a87f61f1c9a44bde731c409\nDate: 2026-04-21T16:12:14-07:00\nElectron: 39.8.7\nElectronBuildId: 13841579\nChromium: 142.0.7444.265\nNode.js: 22.22.1\nV8: 14.2.231.22-electron.0\nOS: Windows_NT x64 10.0.26200\n```\n\n### PowerShell Editor Services Version\n\n```console\nMajor Minor Build Revision\n----- ----- ----- --------\n4 6 0 0\n```\n\n### Steps to Reproduce\n\nUse the code blocks from before and press F2 on the class name references.\n\n### Visuals\n\n_No response_\n\n### Logs\n\n_No response_","author":{"url":"https://github.com/MartinGC94","@type":"Person","name":"MartinGC94"},"datePublished":"2026-05-30T20:57:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2293/PowerShellEditorServices/issues/2293"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:59acd954-7795-99ef-5d99-9cc3077092af |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A78:3A04D8:26B161:3738D9:6A572579 |
| html-safe-nonce | 6bbbc91d2a2cd7bf67fcfe980d5684a2b6f9c372ba0de5d538955fd568af536f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTc4OjNBMDREODoyNkIxNjE6MzczOEQ5OjZBNTcyNTc5IiwidmlzaXRvcl9pZCI6IjExNjUyOTcxMjgyMzY4NTI2MDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 044486522bef5529a6665eba59c2bfe54b3f10c796927a999ebd22df56a07ef9 |
| hovercard-subject-tag | issue:4555679994 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShellEditorServices/2293/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ccdb7c68eeee2defcca31578ce8292431993adcd234cdd8a9299fe0e89948000/PowerShell/PowerShellEditorServices/issues/2293 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ccdb7c68eeee2defcca31578ce8292431993adcd234cdd8a9299fe0e89948000/PowerShell/PowerShellEditorServices/issues/2293 |
| og:image:alt | Prerequisites I have written a descriptive issue title. I have searched all open and closed issues to ensure it has not already been reported. I have read the troubleshooting guide. I am sure this ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MartinGC94 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShellEditorServices git https://github.com/PowerShell/PowerShellEditorServices.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 36031537 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShellEditorServices |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36031537 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShellEditorServices |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2576d1f0198cf1588faf2edf27f1ed120903be10 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width