Skip to content

Commit be7328e

Browse files
TylerMSFTTylerMSFT
authored andcommitted
add note about recommended steps
1 parent c7e6065 commit be7328e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

docs/ide/include-cleanup-overview.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ int main()
107107

108108
The tool doesn't update the comments, but you can see that the code is now using `std::string` and `std::cout` directly. This code is no longer brittle because it doesn't depend on `myHeader.h` to include the other required headers.
109109

110-
If you want a more conservative approach to include cleanup, you can first add direct headers where indirect headers are used, and then go through and remove the unused includes.
110+
## Working with large codebases
111+
112+
If your codebase is large, you may want a more conservative approach to cleaning up your includes. A good approach is to first add direct headers where indirect headers are used. Places where code relies on an indirect include will have a squiggle. You can right-click those lines and choose to add the header. After you have done this for all indirect headers in the file, then remove the unused includes using the **Remove all unused includes** quick action.
111113

112114
In this brief overview, you've seen how include cleanup can help you remove unused headers, and add headers that were indirectly included. This helps you keep your code clean, potentially build faster, and reduces the brittleness of your code.
113115

0 commit comments

Comments
 (0)