StefanKert / BuildVision

A Visual Studio extension to visualize the building process.
MIT License
261 stars 43 forks source link

Feature request: show references to source files that are in the #65

Open janwilmans opened 6 years ago

janwilmans commented 6 years ago

Excellent extension!! Very nice build stats, and overview of project types, I love it!

When a build error occurs, show all references to source files that are in the current solution below the error-message, so you can click to navigate there.

Example, this is one error message:

3>d:\project\debugviewpp\include\cobaltfusion\stringbuilder.h(23): error C2679: binary '<<': no operator found which takes a right-hand operand of type 'const T' (or there is no acceptable conversion)
3>        with
3>        [
3>            T=std::wstring
3>        ] (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(508): note: could be 'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(std::basic_streambuf<char,std::char_traits<char>> *)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(480): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(const void *)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(460): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(long double)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(440): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(double)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(420): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(float)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(400): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(unsigned __int64)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(380): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(__int64)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(360): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(unsigned long)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(340): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(long)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(320): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(unsigned int)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(295): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(int)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(275): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(unsigned short)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(241): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(short)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(221): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(bool)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(215): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(std::ios_base &(__cdecl *)(std::ios_base &))' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(209): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(std::basic_ios<char,std::char_traits<char>> &(__cdecl *)(std::basic_ios<char,std::char_traits<char>> &))' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(204): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(std::basic_ostream<char,std::char_traits<char>> &(__cdecl *)(std::basic_ostream<char,std::char_traits<char>> &))' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(502): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<<void>(std::nullptr_t)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(702): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,const char *)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(749): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,char)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(787): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,const char *)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(834): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,char)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(960): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,const signed char *)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(967): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,signed char)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(974): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,const unsigned char *)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(981): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,unsigned char)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\ostream(1047): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,const std::error_code &)' (compiling source file LogSources.cpp)
3>c:\program files (x86)\microsoft visual studio\preview\community\vc\tools\msvc\14.15.26720\include\thread(240): note: or       'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,std::thread::id)' (compiling source file LogSources.cpp)
3>d:\project\debugviewpp\include\cobaltfusion\stringbuilder.h(23): note: while trying to match the argument list '(std::stringstream, const T)'
3>        with
3>        [
3>            T=std::wstring
3>        ] (compiling source file LogSources.cpp)
3>d:\project\debugviewpp\debugview++lib\logsources.cpp(90): note: see reference to function template instantiation 'fusion::stringbuilder &fusion::stringbuilder::operator <<<std::wstring>(const T &)' being compiled
3>        with
3>        [
3>            T=std::wstring
3>        ]
3>d:\project\debugviewpp\packages\boost.1.66.0.0\lib\native\include\boost\asio\use_future.hpp(138): note: see reference to class template instantiation 'boost::asio::use_future_t<std::allocator<void>>::std_allocator_void' being compiled (compiling source file LogSources.cpp)
3>d:\project\debugviewpp\packages\boost.1.66.0.0\lib\native\include\boost\asio\use_future.hpp(146): note: see reference to class template instantiation 'boost::asio::use_future_t<std::allocator<void>>' being compiled (compiling source file LogSources.cpp)
3>Done building project "DebugView++Lib.vcxproj" -- FAILED.

But the only relevant lines to me are:

d:\project\debugviewpp\include\cobaltfusion\stringbuilder.h(23): error C2679: binary '<<': no operator found which takes a right-hand operand of type 'const T' (or there is no acceptable conversion)

and

3>d:\project\debugviewpp\debugview++lib\logsources.cpp(90): note: see reference to function template instantiation 'fusion::stringbuilder &fusion::stringbuilder::operator <<<std::wstring>(const T &)' being compiled
3>        with
3>        [
3>            T=std::wstring
3>        ]

because both lines reference a file in the current solution and all the template spew reference external libraries.

StefanKert commented 6 years ago

Hey there!

Can you send me a screenshot of the current behaviour of BuildVision? Is it showing up any error messages or is it just showing that a project build failed? I am not really familiar with C++ development so if it is possible for you and if you can offer some time it would be great if you could upload a small project that produces this behaviour. Thanks a lot :)

janwilmans commented 6 years ago

sure, I'll whip up an example!

janwilmans commented 6 years ago

ExampleError.zip

Here you can see an example of code that points to 'library' code in the error message. The real offending code is in a note at the bottom

consoleapplication12\ss.h(9): error C2679: binary '<<': no operator found ... lots of crap .... consoleapplication12.cpp(8): note: see reference to function template instantiation 'SS &SS::operator <<(const T &)' being compiled

The current behaviour of buildvision is that it jumps to the first line with the original error (which makes perfect sense) however it would be nice if all lines that reference files in the current solution would show up in the build result.

janwilmans commented 6 years ago

image

screenshot of the current behaviour as requested