Vscode-cpptools: Please don't gray out code in #ifdef sections even if symbol not defined

Created on 20 Mar 2018  路  7Comments  路  Source: microsoft/vscode-cpptools

https://github.com/Microsoft/vscode-textmate/issues/63
Because the symbol might be passed in by the compiler (e.g. gcc's -D).

Feature Request fixed (release pending)

Most helpful comment

@Mistuke The dimInactiveRegions setting and code action lightbulb that appears when the cursor is in the gray code in https://github.com/Microsoft/vscode-cpptools/releases/tag/v0.16.0-insiders2 is good enough, right?

All 7 comments

We are enabling a compilerPath setting which support adding compiler flags which modify the defines used with our 0.16.0 release (the insiders build has a preview, but it doesn't support compiler args https://github.com/Microsoft/vscode-cpptools/releases/tag/v0.16.0-insiders ). You can also add the define to the defines in c_cpp_properties.json. And the insiders build has a dimInactiveRegions setting for disabling the gray. Does that seem good enough?

Thanks! It seems good enough for now. Adding a toggle in settings is more desirable, though.

@Leedehai We decided again a toggle code action because we believed that would cause a lightbulb to appear for all code, but on 2nd thought, it seems like it might be possible to show it only for code that would be gray if the setting were re-enabled.

I also wish for an opt-out support, After this change all I saw was pages and pages full of gray C code. and the c_cpp_properties.json was a non-obvious thing. I'm glad it's there but since it's not available from the preferences menu I had to do some research to find it.

@Mistuke The dimInactiveRegions setting and code action lightbulb that appears when the cursor is in the gray code in https://github.com/Microsoft/vscode-cpptools/releases/tag/v0.16.0-insiders2 is good enough, right?

@sean-mcmanus yes that would be perfect. Thanks!

Oh, this has been fixed with 0.16.1 already. Let us know if anyone has problems with the dimInactiveRegions setting.

Was this page helpful?
0 / 5 - 0 ratings