#include Diagnostics feature arrives in Visual Studio 2022

Microsoft announced Visual Studio from Mac a few months back.

Reading time icon 2 min. read


Readers help support MSPoweruser. When you make a purchase using links on our site, we may earn an affiliate commission. Tooltip Icon

Read the affiliate disclosure page to find out how can you help MSPoweruser effortlessly and without spending any money. Read more

Key notes

  • Microsoft launched #include Diagnostics in Visual Studio 2022 17.9 Preview 2
  • It provides detailed insights into the usage and performance of #include directives.
  • Besides, #include Diagnostics also includes a CodeLens feature that displays the number of references.

Microsoft has released a new feature in Visual Studio 2022 17.9 Preview 2 that provides detailed insights into the usage and performance of #include directives. 

This new feature, called #include Diagnostics, can help developers identify and optimize their code to improve compile times and reduce development time.

One of the key components of #include Diagnostics is the ability to track the number of references to each #include directive. This information can be used to identify directives that are rarely used but still contribute to compile times. 

Developers can then remove these directives or move them to header files that are only included when necessary.

Besides, #include Diagnostics also includes a CodeLens feature that displays the number of references to each #include directive directly in the code editor. This makes it easy for developers to see at a glance how often a directive is used.

But it’s been quite a tumultuous few months for several Visual Studio users. Last year, the Redmond-based tech giant announced its retirement of the Mac version. After August this year, Visual Studio for Mac will still be available as a “legacy installation” via its official website.

You can download Visual Studio Preview 2022 on Microsoft’s official site here.