C++ syntax highlighting issue when using preproc. definitions

Discussion of open issues, suggestions and bugs regarding file and folder merge tool – Code Compare
Post Reply
naniii
Posts: 1
Joined: Wed 27 Sep 2017 08:08

C++ syntax highlighting issue when using preproc. definitions

Post by naniii » Wed 27 Sep 2017 08:18

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.

mstislavs
Devart Team
Posts: 66
Joined: Mon 16 Jan 2017 12:48

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

Post by mstislavs » Fri 29 Sep 2017 08:36

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

michalz
Posts: 1
Joined: Fri 15 Jun 2018 15:28

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

Post by michalz » Fri 15 Jun 2018 15:42

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

mstislavs
Devart Team
Posts: 66
Joined: Mon 16 Jan 2017 12:48

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

Post by mstislavs » Thu 21 Jun 2018 13:37

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

mstislavs
Devart Team
Posts: 66
Joined: Mon 16 Jan 2017 12:48

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

Post by mstislavs » Thu 04 Oct 2018 11:51

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

Post Reply