{"id":251728,"date":"2024-12-09T08:11:34","date_gmt":"2024-12-09T16:11:34","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=251728"},"modified":"2024-12-09T11:57:55","modified_gmt":"2024-12-09T19:57:55","slug":"keep-working-with-non-blocking-code-cleanup","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/keep-working-with-non-blocking-code-cleanup\/","title":{"rendered":"Keep working with non-blocking Code Cleanup"},"content":{"rendered":"<p>Are you tired of waiting for Code Cleanup to finish every time you save your work? Visual Studio 2022 will no longer lock up and get in the way of your tasks as it\u2019s cleaning up the code under the covers.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/async-code-cleanup-on-save.gif\"><img decoding=\"async\" class=\"alignnone wp-image-251733\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/async-code-cleanup-on-save.gif\" alt=\"Image async code cleanup on save\" width=\"773\" height=\"515\" \/><\/a><\/p>\n<p>Every developer knows the importance of <a id=\"post-251728-_Int_7kjpjNfF\"><\/a>maintaining clean code. However, the traditional Code Cleanup process in Visual Studio could take a while to run and lock up the entire IDE, which made it inappropriate to run on save for all scenarios. These interruptions could break your flow and slow down your development progress.<\/p>\n<p>Now, when you save your work, Code Cleanup can run seamlessly in the background without interrupting your workflow.<\/p>\n<h1>Background cleanup for uninterrupted coding<\/h1>\n<p>With this enhancement enabled, the cleanup process runs quietly in the background without locking up the IDE. This means no more waiting for the cleanup to be completed before resuming your work, whether that\u2019s opening tools or navigating around to different files in your codebase. Your IDE stays fully responsive, ensuring a smoother and more efficient user experience.<\/p>\n<h1>Automatic cancellation for real-time adjustments<\/h1>\n<p>Need to make a quick edit, but Code Cleanup started up after you saved? When the editor detects typing, the cleanup process stops. Simply save again to restart cleanup on the updated code. This ensures that you can stay in your workflow and make changes to your code without any worries.<\/p>\n<h1>Setting up Code Cleanup on save<\/h1>\n<p>To enable Code Cleanup on save, navigate to <em>Tools &gt; Options &gt; Text Editor &gt; Code Cleanup<\/em>. Turn on <a id=\"post-251728-_Int_HxPZIIOJ\"><\/a>the option <em>Run Code Cleanup profile on Save<\/em> and choose your desired profile.<\/p>\n<p><img decoding=\"async\" width=\"762\" height=\"467\" class=\"wp-image-251730\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/second-item-in-options-window-shows-checkbox-for-r.png\" alt=\"Second item in Options window shows checkbox for Run Code Cleanup profile on Save\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/second-item-in-options-window-shows-checkbox-for-r.png 762w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/second-item-in-options-window-shows-checkbox-for-r-300x184.png 300w\" sizes=\"(max-width: 762px) 100vw, 762px\" \/><\/p>\n<h1>Thank you for your feedback<\/h1>\n<p>We continuously strive to enhance your development experience based on your invaluable feedback. These updates to the Code Cleanup feature are a testament to our commitment to making Visual Studio the best it can be. Your insights drive our innovations, and we appreciate your continuous support.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you tired of waiting for Code Cleanup to finish every time you save your work? Visual Studio 2022 will no longer lock up and get in the way of your tasks as it\u2019s cleaning up the code under the covers. Every developer knows the importance of maintaining clean code. However, the traditional Code Cleanup [&hellip;]<\/p>\n","protected":false},"author":105708,"featured_media":251730,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[6868,155],"tags":[],"class_list":["post-251728","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-performance","category-visual-studio"],"acf":[],"blog_post_summary":"<p>Are you tired of waiting for Code Cleanup to finish every time you save your work? Visual Studio 2022 will no longer lock up and get in the way of your tasks as it\u2019s cleaning up the code under the covers. Every developer knows the importance of maintaining clean code. However, the traditional Code Cleanup [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/251728","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\/105708"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=251728"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/251728\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/251730"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=251728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=251728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=251728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}