Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpp source file doesn't have syntax highlighting at all #35

Closed
zhongweiy opened this issue Mar 5, 2019 · 2 comments
Closed

cpp source file doesn't have syntax highlighting at all #35

zhongweiy opened this issue Mar 5, 2019 · 2 comments
Labels
question Further information is requested

Comments

@zhongweiy
Copy link

Hi, there,
In my project, some cpp file have syntax highlight but some have not at all. I even have seen a cpp file which half of it have syntax highlight but the other half doesn't (but this case can not be reproduced after revert-buffer).

And if put the cursor on the keyword (like if) of the cpp file doesn't have syntax highlight and call the describe-face gives the Face: Face: ccls-skipped-range-face. Is it caused by some issue in emacs-ccls? How can I get back my syntax highlight? Thanks!

@zhongweiy
Copy link
Author

zhongweiy commented Mar 8, 2019

I find setting the ccls-skipped-range-face to nil can get the highlighting back.

I have not debugged into it. And if any log or information needed, please tell me.

@MaskRay
Copy link
Member

MaskRay commented Mar 8, 2019

These ranges are skipped by clang because the #if #ifdef #else branch isn't taken.

In the following case,

#ifdef A
int a;
#else 
int b;
#endif

There is at least one skipped range. You may say that the file is compiled twice with -DA or without it, but each file is only indexed once.

You can also set (setq ccls-enable-skipped-ranges nil) if you don't like skipped ranges.

@MaskRay MaskRay closed this as completed Mar 8, 2019
@MaskRay MaskRay added the question Further information is requested label Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants