{"id":246348,"date":"2023-12-18T08:00:31","date_gmt":"2023-12-18T16:00:31","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=246348"},"modified":"2024-02-13T06:28:49","modified_gmt":"2024-02-13T14:28:49","slug":"ai-powered-rename-suggestions","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/ai-powered-rename-suggestions\/","title":{"rendered":"Naming Made Easy: AI-Powered Rename Suggestions"},"content":{"rendered":"<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/12\/SmartRenameV4Cropped.png\"><img decoding=\"async\" class=\" wp-image-246349 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/12\/SmartRenameV4Cropped.png\" alt=\"Image SmartRenameNameSuggestions Cropped\" width=\"445\" height=\"251\" \/><\/a>\nEver struggled to name a variable, method, or class\u2014finding that perfect balance between expressiveness and conciseness? You&#8217;re not alone. We&#8217;ve tackled this universal challenge in the latest Visual Studio Preview via our GitHub Copilot Chat extension (subscription required). <span class=\"TextRun SCXW86548582 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW86548582 BCX8\" data-ccp-parastyle=\"paragraph\">Introducing: <\/span><\/span> AI-powered rename suggestions. This feature doesn&#8217;t just suggest names; it learns how your identifier is used and your code style to propose identifiers that seamlessly fit into your codebase. It&#8217;s like having a dedicated naming expert by your side, enhancing your code while keeping you in the coding flow.<\/p>\n<h2>The Power of AI in Naming<\/h2>\n<p>Our new feature utilizes AI to analyze your identifier&#8217;s current usage and the code&#8217;s naming style. By understanding how identifiers are used within your code, it generates a range of expressive name suggestions. Our goal is to help you improve the readability and maintainability of your code, ensuring its longevity and ease of comprehension for years to come.<\/p>\n<h2>How It Works<\/h2>\n<p>In Visual Studio, simply select any identifier, right-click, and choose Rename (Ctrl+R, Ctrl+R). Click on the rename suggestions button or use the Ctrl+Space shortcut. You will be presented with a list of naming suggestions tailored to the context of your code. Pick the name you like best and press Enter.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/12\/SmartRenameV4.gif\"><img decoding=\"async\" class=\"wp-image-246159 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/12\/SmartRenameV4.gif\" alt=\"Rename Suggestions\" width=\"1037\" height=\"583\" \/><\/a><\/p>\n<h2>Try it out!<\/h2>\n<p>This feature uses GitHub Copilot to analyze the code and generate the renaming suggestions. You\u2019ll need an active <a href=\"https:\/\/github.com\/features\/copilot?utm_source=vscom&amp;utm_medium=hero&amp;utm_campaign=cta-get#pricing\">GitHub\u00a0Copilot<\/a> subscription. Ensure you are using Visual Studio 2022 17.9 Preview 3 and update the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=VisualStudioExptTeam.VSGitHubCopilot\">GitHub Copilot Chat Extension<\/a> (if it\u2019s already installed). Enable this feature by going to Options &gt; GitHub &gt; Copilot chat &gt; and check the \u201cEnable rename suggestions\u201d option.<\/p>\n<h2>Your Feedback Matters<\/h2>\n<p>We&#8217;d love to hear your thoughts on how this feature impacts your coding workflow. Your feedback is instrumental as we continue to improve the feature and quality of the renaming suggestions provided. Please share your thoughts with us!<\/p>\n<p><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/www.research.net\/r\/renamesuggestionsblog\" target=\"_blank\">Take the Survey<\/a><\/div><\/p>\n<p>We appreciate the time you\u2019ve spent reporting issues\/suggestions and hope you continue to give us feedback when using Visual Studio on what you like and what we can improve. Your feedback is critical to help us make Visual Studio the best tool it can be! You can share feedback with us via\u202f<a href=\"https:\/\/developercommunity.visualstudio.com\/home%22%20\/t%20%22_blank\">Developer Community<\/a>: report any bugs or issues via\u202f<a href=\"https:\/\/learn.microsoft.com\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio?view=vs-2022\">report a problem<\/a>\u202fand\u202f<a href=\"https:\/\/developercommunity.microsoft.com\/VisualStudio\/suggest\">share your suggestions<\/a>\u202ffor new features or improvements to existing ones.<\/p>\n<p>Stay connected with the Visual Studio team by following us on <a href=\"https:\/\/www.youtube.com\/@visualstudio\">YouTube<\/a>, <a href=\"https:\/\/twitter.com\/VisualStudio\">Twitter<\/a>, <a href=\"https:\/\/www.linkedin.com\/showcase\/microsoft-visual-studio\/\">LinkedIn<\/a>, <a href=\"https:\/\/www.twitch.tv\/visualstudio\">Twitch<\/a> and on <a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/?view=vs-2022\">Microsoft Learn<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever struggled to name a variable, method, or class\u2014finding that perfect balance between expressiveness and conciseness? You&#8217;re not alone. We&#8217;ve tackled this universal challenge in the latest Visual Studio Preview via our GitHub Copilot Chat extension (subscription required). Introducing: AI-powered rename suggestions. This feature doesn&#8217;t just suggest names; it learns how your identifier is used [&hellip;]<\/p>\n","protected":false},"author":99106,"featured_media":246738,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[6888,155],"tags":[6883,6862,1422],"class_list":["post-246348","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-copilot","category-visual-studio","tag-copilot","tag-experiment","tag-preview-features"],"acf":[],"blog_post_summary":"<p>Ever struggled to name a variable, method, or class\u2014finding that perfect balance between expressiveness and conciseness? You&#8217;re not alone. We&#8217;ve tackled this universal challenge in the latest Visual Studio Preview via our GitHub Copilot Chat extension (subscription required). Introducing: AI-powered rename suggestions. This feature doesn&#8217;t just suggest names; it learns how your identifier is used [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/246348","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/99106"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=246348"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/246348\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/246738"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=246348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=246348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=246348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}