{"id":32556,"date":"2023-07-11T17:00:13","date_gmt":"2023-07-11T17:00:13","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=32556"},"modified":"2023-11-20T21:46:11","modified_gmt":"2023-11-20T21:46:11","slug":"include-cleanup-in-visual-studio","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/include-cleanup-in-visual-studio\/","title":{"rendered":"#include cleanup in Visual Studio"},"content":{"rendered":"<p><div class=\"alert alert-primary\"><em><span style=\"font-size: 10pt;\">We are gradually rolling out this feature in Visual Studio 2022 version 17.8 to monitor some data. This means that not everyone will have access to the feature immediately after its release.<\/span><\/em><\/div><\/p>\n<p><span class=\"TextRun SCXW163033654 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\">We are thrilled to announce the return of <\/span><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\">#<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\">include<\/span> <span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\">c<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\">leanup<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\">, a <\/span><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\">tool that helps you <\/span><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\">maintain<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\"> clean code, now available in Visual Studio 17.8 Preview 1<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\">.<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\"> To start using <\/span><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\">this<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\"> feature<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\">, make sure to update to the latest version of Visual Studio Preview.<\/span><\/span><span class=\"TextRun SCXW163033654 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun CommentHighlightRest SCXW163033654 BCX8\" data-ccp-charstyle=\"normaltextrun\">\u202f<\/span><\/span><\/p>\n<p><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\" target=\"_blank\">Download Visual Studio Preview\u202f <\/a><\/div><\/p>\n<h3><span class=\"TextRun SCXW84681502 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW84681502 BCX8\" data-ccp-charstyle=\"normaltextrun\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;66dbb666-5f50-4e5b-9628-36f655bc3212|12&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;normaltextrun&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;normaltextrun&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">#include cleanup<\/span><\/span><span class=\"TextRun SCXW84681502 BCX8\" lang=\"EN-029\" xml:lang=\"EN-029\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW84681502 BCX8\" data-ccp-charstyle=\"eop\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;66dbb666-5f50-4e5b-9628-36f655bc3212|13&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;eop&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;eop&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">\u202f<\/span><\/span><span class=\"EOP SCXW84681502 BCX8\" data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h3>\n<p>Visual Studio now offers #include cleanup, a feature that improves the quality of your code by generating suggestions to remove unused headers and add direct headers. Our suggested workflow is to first go through the direct include suggestions to add direct headers where indirect headers are used, followed by removing the unused includes.<\/p>\n<h4><span class=\"TrackChangeTextInsertion TrackedChange TrackChangeHoverSelectColorRed SCXW140775236 BCX8\"><span class=\"TrackedChange SCXW140775236 BCX8\"><span class=\"TextRun SCXW140775236 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun TrackChangeHoverSelectHighlightRed SCXW140775236 BCX8\" data-ccp-parastyle=\"heading 2\">Remove unused <\/span><\/span><\/span><\/span><span class=\"TrackChangeTextInsertion TrackedChange TrackChangeHoverSelectColorRed SCXW140775236 BCX8\"><span class=\"TrackedChange SCXW140775236 BCX8\"><span class=\"TextRun SCXW140775236 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun TrackChangeHoverSelectHighlightRed SCXW140775236 BCX8\" data-ccp-parastyle=\"heading 2\">#include statements<\/span><\/span><\/span><\/span><span class=\"EOP SCXW140775236 BCX8\" data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h4>\n<p>This feature provides suggestions to remove unused headers from your files, enhancing code cleanliness. When an unused include is detected, it is visually dimmed by default. By hovering over the dimmed include, a quick action (indicated by three dots in the default view) prompt will appear, notifying you about the unused include in the file. You can click on the light bulb to remove the unused include or all unused includes. This makes it easier to clean up your code and ensures that you keep only the necessary includes to keep your code well-organized.<\/p>\n<p><figure id=\"attachment_32557\" aria-labelledby=\"figcaption_attachment_32557\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/remove_unused_includes.gif\"><img decoding=\"async\" class=\"size-full wp-image-32557\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/remove_unused_includes.gif\" alt=\"Gif showing remove unused includes.\" width=\"1266\" height=\"633\" \/><\/a><figcaption id=\"figcaption_attachment_32557\" class=\"wp-caption-text\">Gif showing remove unused includes.<\/figcaption><\/figure><\/p>\n<h4><span class=\"TrackChangeTextInsertion TrackedChange SCXW151690853 BCX8\"><span class=\"TrackedChange SCXW151690853 BCX8\"><span class=\"TextRun SCXW151690853 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW151690853 BCX8\" data-ccp-parastyle=\"heading 2\">Add <\/span><\/span><\/span><\/span><span class=\"TrackChangeTextInsertion TrackedChange SCXW151690853 BCX8\"><span class=\"TrackedChange SCXW151690853 BCX8\"><span class=\"TextRun SCXW151690853 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW151690853 BCX8\" data-ccp-parastyle=\"heading 2\">transitively used #include statements<\/span><\/span><\/span><\/span><span class=\"EOP TrackedChange SCXW151690853 BCX8\" data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h4>\n<p>In Visual Studio, there is an existing feature that alerts users when an include is used but not added to the file. This is indicated by a squiggle and suggests adding the required include. Currently, we have added a new feature that provides suggestions for adding direct includes when your file has indirect dependencies. Including indirect dependencies can result in longer compilation times. However, with the help of direct include suggestions, you can optimize compilation time by including only the essential direct dependencies.<\/p>\n<p><span class=\"NormalTextRun SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;66dbb666-5f50-4e5b-9628-36f655bc3212|12&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;normaltextrun&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;normaltextrun&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">In instances where the direct include for certain content is missing, a quick action (<\/span><span class=\"NormalTextRun SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\">indicated<\/span><span class=\"NormalTextRun SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\"> by three dots in the default view)<\/span> will appear. Hovering over it will inform you that content from that transitive include is being used. <span class=\"TextRun SCXW128197081 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\">Then, you have the <\/span><span class=\"NormalTextRun SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\">option<\/span><span class=\"NormalTextRun SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\"> to either <\/span><span class=\"NormalTextRun CommentStart CommentHighlightPipeRest CommentHighlightRest SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\">add the direct include individually<\/span><span class=\"NormalTextRun CommentHighlightPipeRest SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\"> or <\/span><span class=\"NormalTextRun SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\">add<\/span><span class=\"NormalTextRun SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\"> all transitively used <\/span><span class=\"NormalTextRun SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\">includes<\/span><\/span><span class=\"TrackChangeTextInsertion TrackedChange TrackChangeHoverSelectColorRed SCXW128197081 BCX8\"><span class=\"TextRun SCXW128197081 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun TrackChangeHoverSelectHighlightRed SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\">. By choosing to include all transitively used includes, all the <\/span><\/span><\/span><span class=\"TrackChangeTextInsertion TrackedChange TrackChangeHoverSelectColorRed SCXW128197081 BCX8\"><span class=\"TextRun SCXW128197081 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun TrackChangeHoverSelectHighlightRed SCXW128197081 BCX8\" data-ccp-charstyle=\"normaltextrun\">direct headers will be automatically added wherever indirect headers are used in the file.<\/span><\/span><\/span> After including the direct dependencies, it is crucial to remove any unused includes, retaining only those that are necessary.<\/p>\n<p><figure id=\"attachment_32560\" aria-labelledby=\"figcaption_attachment_32560\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/transitively_used_includes.gif\"><img decoding=\"async\" class=\"size-full wp-image-32560\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/transitively_used_includes.gif\" alt=\"Gif showing add direct include suggestion.\" width=\"2060\" height=\"487\" \/><\/a><figcaption id=\"figcaption_attachment_32560\" class=\"wp-caption-text\">Gif showing add direct include suggestion.<\/figcaption><\/figure><\/p>\n<p>To quickly perform code cleanup, you can configure code cleanup by adding \u201cAdd transitively used and remove unused #include statements (C++)\u201d. Once this setup is complete, you&#8217;ll have the convenience of adding all transitively used includes and removing all unused includes with just a single click on the broom icon. This streamlines the process and ensures that your code remains clean.<\/p>\n<p><figure id=\"attachment_32561\" aria-labelledby=\"figcaption_attachment_32561\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/code_cleanup_entry.gif\"><img decoding=\"async\" class=\"wp-image-32561 size-full\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/code_cleanup_entry.gif\" alt=\"Gif displaying Configure Code Cleanup \" width=\"2233\" height=\"1578\" \/><\/a><figcaption id=\"figcaption_attachment_32561\" class=\"wp-caption-text\">Gif displaying Configure Code Cleanup.<\/figcaption><\/figure><\/p>\n<p>By default, #include cleanup is disabled, but you can enable it by navigating to Tools &gt; Options &gt; Text Editor &gt; C\/C++ &gt; IntelliSense and selecting &#8220;Enable #include cleanup.&#8221; Once enabled, you have the flexibility to adjust the settings and configure different levels to meet your specific needs and preferences.<\/p>\n<p><figure id=\"attachment_32562\" aria-labelledby=\"figcaption_attachment_32562\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Code_cleanup_enable.png\"><img decoding=\"async\" class=\"wp-image-32562 size-full\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Code_cleanup_enable.png\" alt=\"Image displaying Code cleanup setting. \" width=\"2915\" height=\"2112\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Code_cleanup_enable.png 2915w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Code_cleanup_enable-300x217.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Code_cleanup_enable-1024x742.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Code_cleanup_enable-768x556.png 768w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Code_cleanup_enable-1536x1113.png 1536w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Code_cleanup_enable-2048x1484.png 2048w\" sizes=\"(max-width: 2915px) 100vw, 2915px\" \/><\/a><figcaption id=\"figcaption_attachment_32562\" class=\"wp-caption-text\">Image displaying code cleanup setting.<\/figcaption><\/figure><\/p>\n<h3>Customization Options<\/h3>\n<p>You have the flexibility to customize how the #include cleanup generates suggestions, allowing it to seamlessly adapt and integrate with intricate and extensive codebases. By making these changes or adjustments, you can ensure that the process better aligns with the specific needs and complexities of your project, resulting in a more efficient and effective code cleanup. In the EditorConfig (<a class=\"Hyperlink SCXW70620419 BCX8\" href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/ide\/create-portable-custom-editor-options?view=vs-2022\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW70620419 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW70620419 BCX8\" data-ccp-charstyle=\"Hyperlink\">EditorConfig settings<\/span><\/span><\/a>), you can add a single header, and if you want to include multiple headers, you should separate them using commas.<\/p>\n<h5><span class=\"TextRun SCXW29901305 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun CommentStart SCXW29901305 BCX8\" data-ccp-charstyle=\"normaltextrun\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;66dbb666-5f50-4e5b-9628-36f655bc3212|12&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;normaltextrun&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;normaltextrun&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">Exclude Files<\/span><\/span><span class=\"EOP SCXW29901305 BCX8\" data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h5>\n<p>To exclude specific includes from #include cleanup suggestions, you can utilize EditorConfig. This allows you to categorize and define which files should not be considered for suggestions, providing greater control over the suggestions generated by #include cleanup.\nExamples of excluding single and multiple files (exclude <code class=\"language-cpp\">vcruntime.h<\/code> and <code class=\"language-cpp\">vcruntime_string.h<\/code> from cleanup suggestions):<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cpp_include_cleanup_excluded_files = vcruntime.h<\/code><\/pre>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cpp_include_cleanup_excluded_files = vcruntime.h,vcruntime_string.h<\/code><\/pre>\n<h5>Required Files<\/h5>\n<p>In cases where headers require other headers, and you don&#8217;t want suggestions generated, you can specify the dependencies in the EditorConfig. This ensures that required files won&#8217;t be marked as unused.\nExamples of single and multiple required files (<code class=\"language-cpp\">atlwin.h<\/code> requires <code class=\"language-cpp\">altbase.h<\/code> and <code class=\"language-cpp\">atlcom.h<\/code> requires <code class=\"language-cpp\">altbase.h<\/code>):<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cpp_include_cleanup_required_files = atlwin.h:altbase.h<\/code><\/pre>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cpp_include_cleanup_required_files = atlwin.h:altbase.h,atlcom.h:altbase.h<\/code><\/pre>\n<h5><span class=\"TextRun SCXW100896032 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW100896032 BCX8\" data-ccp-charstyle=\"normaltextrun\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;66dbb666-5f50-4e5b-9628-36f655bc3212|12&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;normaltextrun&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;normaltextrun&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">Files Replacement<\/span><\/span><\/h5>\n<p>This feature also supports the remapping of facade headers. If a file is intended to represent a different file, you can redirect the usage of the first file to the usage of the second file in EditorConfig.\nExamples of single and multiple replaced files (replace <code class=\"language-cpp\">stdio.h<\/code> by <code class=\"language-cpp\">cstdio<\/code>, and replace <code class=\"language-cpp\">stdint.h<\/code> by <code class=\"language-cpp\">cstdint<\/code>):<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cpp_include_cleanup_replacement_files = stdio.h:cstdio<\/code><\/pre>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cpp_include_cleanup_replacement_files = stdio.h:cstdio,stdint.h:cstdint<\/code><\/pre>\n<h5><span class=\"TextRun SCXW264697628 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW264697628 BCX8\" data-ccp-charstyle=\"normaltextrun\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;66dbb666-5f50-4e5b-9628-36f655bc3212|12&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;normaltextrun&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;normaltextrun&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">Alternate Files<\/span><\/span><span class=\"TextRun SCXW264697628 BCX8\" lang=\"EN-029\" xml:lang=\"EN-029\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW264697628 BCX8\" data-ccp-charstyle=\"eop\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;66dbb666-5f50-4e5b-9628-36f655bc3212|13&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;eop&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;eop&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">\u202f<\/span><\/span><span class=\"EOP SCXW264697628 BCX8\" data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h5>\n<p>In certain situations, you may have alternative options for including a file, such as facade files. When the usage of one file can be considered as an alternative to the usage of another file, you can specify this relationship in EditorConfig. By doing so, you can prevent #include cleanup from generating suggestions for alternate matches.\nExamples of single and multiple alternate files (<code class=\"language-cpp\">windows.h<\/code> is an alternate for <code class=\"language-cpp\">minwindef.h<\/code> and <code class=\"language-cpp\">windows.h<\/code> is an alternate for <code class=\"language-cpp\">winerror.h<\/code>):<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cpp_include_cleanup_alternate_files = windows.h:minwindef.h<\/code><\/pre>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">cpp_include_cleanup_alternate_files = windows.h:minwindef.h,windows.h:winerror.h<\/code><\/pre>\n<h3><span class=\"TextRun SCXW201451968 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW201451968 BCX8\" data-ccp-charstyle=\"normaltextrun\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;66dbb666-5f50-4e5b-9628-36f655bc3212|12&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;normaltextrun&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;normaltextrun&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">Send us your feedback!<\/span><\/span><span class=\"TextRun SCXW201451968 BCX8\" lang=\"EN-029\" xml:lang=\"EN-029\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW201451968 BCX8\" data-ccp-charstyle=\"eop\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;66dbb666-5f50-4e5b-9628-36f655bc3212|13&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;eop&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;eop&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">\u202f<\/span><\/span><span class=\"EOP SCXW201451968 BCX8\" data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h3>\n<p><span class=\"TextRun SCXW255712242 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;66dbb666-5f50-4e5b-9628-36f655bc3212|12&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;normaltextrun&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;normaltextrun&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">Explore <\/span><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\">#<\/span><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\">Include Cleanup by downloading the <\/span><\/span><a class=\"Hyperlink SCXW255712242 BCX8\" href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW255712242 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\">latest version of Visual Studio Preview<\/span><\/span><\/a><span class=\"TextRun SCXW255712242 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\">.<\/span><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\"> We genuinely value your feedback as it plays a crucial role in shaping our development process. <\/span><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\">Please share your thoughts in the comments below, on <\/span><\/span><a class=\"Hyperlink SCXW255712242 BCX8\" href=\"https:\/\/developercommunity.visualstudio.com\/cpp\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW255712242 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\">Developer Community<\/span><\/span><\/a><span class=\"TextRun SCXW255712242 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\">, or reach out to us on Twitter\u202f(<\/span><\/span><a class=\"Hyperlink SCXW255712242 BCX8\" href=\"https:\/\/twitter.com\/visualc\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW255712242 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\">@VisualC<\/span><\/span><\/a><span class=\"TextRun SCXW255712242 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\">) or via email at <\/span><\/span><a class=\"Hyperlink SCXW255712242 BCX8\" href=\"mailto:visualcpp@microsoft.com\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW255712242 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\">visualcpp@microsoft.com<\/span><\/span><\/a><span class=\"TextRun SCXW255712242 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"normaltextrun\">. Your input is highly appreciated!<\/span><\/span><span class=\"TextRun SCXW255712242 BCX8\" lang=\"EN-029\" xml:lang=\"EN-029\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW255712242 BCX8\" data-ccp-charstyle=\"eop\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;66dbb666-5f50-4e5b-9628-36f655bc3212|13&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;eop&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;eop&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">\u202f<\/span><\/span><span class=\"EOP SCXW255712242 BCX8\" data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are thrilled to announce the return of #include cleanup, a tool that helps you maintain clean code, now available in Visual Studio 17.8 Preview 1. To start using this feature, make sure to update to the latest version of Visual Studio Preview.\u202f #include cleanup\u202f\u00a0 Visual Studio now offers #include cleanup, a feature that improves [&hellip;]<\/p>\n","protected":false},"author":96741,"featured_media":35994,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,3927],"tags":[],"class_list":["post-32556","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","category-game-development"],"acf":[],"blog_post_summary":"<p>We are thrilled to announce the return of #include cleanup, a tool that helps you maintain clean code, now available in Visual Studio 17.8 Preview 1. To start using this feature, make sure to update to the latest version of Visual Studio Preview.\u202f #include cleanup\u202f\u00a0 Visual Studio now offers #include cleanup, a feature that improves [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/32556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/96741"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=32556"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/32556\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=32556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=32556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=32556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}