Wumpf / IncludeToolbox

Visual Studio extension to format, prune, and inspect include directives.
https://marketplace.visualstudio.com/items?itemName=Wumpf.IncludeToolbox
MIT License
50 stars 22 forks source link

Analyse includes and fix (or suggest fixes for) any that are absolute that should be relative #77

Open DanForever opened 3 years ago

DanForever commented 3 years ago

Depending on how a project has configured it's its include directory settings, it might be possible for a file to include another file relative to an incorrect path.

For instance, if I have the following file structure: mysln.sln proj/myproj.vcxproj proj/somepath/a.cpp proj/somepath/b.h

I can add the root folder of my solution to my search path, for easier includes between projects, it has the side effect of also allowing me to include b.h in a.cpp like so: #include <proj/somepath/b.h> (This also works with includes using "")

It would be nice if IncludeToolbox could examine #includes and inform the user that the include might be refactored to simply `#include "b.h"