Page 1 of 1

C++ syntax highlighting issue when using preproc. definitions

Posted: Wed 27 Sep 2017 08:18
by naniii
Hello!

I'm trying Code Compare currently and I noticed a small but annoying problem when diffing C++ files.

=> All the code that is inside a kind-of "#if" directive will not be highlighted.

For instance:

#ifdef PLATFORM_PS4
// ... everything in here will not be syntax-highlighted
#endif

I have quite a lof of files with directives like this, most of them surround the full file content so I have a lot of missing syntax highlighting.

I think that the application should ignore the #if / #ifdef / #ifndef etc. preprocessor directives or provide a way to specify them.

Is there any workaround or fix planned?

Many thanks!

Best regards,
N.

Re: C++ syntax highlighting issue when using preproc. definitions

Posted: Fri 29 Sep 2017 08:36
by mstislavs
Hi,

Thank you for reporting the problem. Unfortunately, we cannot reproduce this issue. Please provide us with the file where the issue reproduces using the following form
https://www.devart.com/company/contactf ... odecompare
Does this problem reproduce in the VS and in the standalone instance?

Best regards,
Mstislav Sakidon
Devart Team
www.devart.com

Re: C++ syntax highlighting issue when using preproc. definitions

Posted: Fri 15 Jun 2018 15:42
by michalz
Hi,
I'm facing same issue - code inside #ifdef is not highlighted. It is realy hard to check diffs without highlighted syntax.
If you have two files:

Includes.h

Code: Select all

#define DO_INCLUDE_CODE
Code.h

Code: Select all

#include "Includes.h"

#ifdef DO_INCLUDE_CODE
//No code here is highlighted, even included header file Include.h defines DO_INCLUDE_CODE macro
void Foo(); 
#endif //DO_INCLUDE_CODE
Can you enable highlighting by opt/default. Or look up for defines in include files, seach paths are defined in project files (eg. .vcprojx in Visual Studio)

Image

Re: C++ syntax highlighting issue when using preproc. definitions

Posted: Thu 21 Jun 2018 13:37
by mstislavs
Hi Michal,

We apologize for the delayed answer. Now we are working to establish a new version of Code Compare and we will investigate problems related with preprocessor directives.

Best regards,
Mstislav Sakidon
Devart Team
www.devart.com

Re: C++ syntax highlighting issue when using preproc. definitions

Posted: Thu 04 Oct 2018 11:51
by mstislavs
Hi michalz,

We have investigated the problem with syntax highlighting. Unfortunately, we can not improve this behavior because we use QWhale syntax edit which does not work fine with preprocessor directives.

Best regards,
Mstislav Sakidon
Devart Team
www.devart.com