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

Add a setting to disable inactive region code graying #1574

Closed
bobbrow opened this issue Feb 16, 2018 · 11 comments
Closed

Add a setting to disable inactive region code graying #1574

bobbrow opened this issue Feb 16, 2018 · 11 comments
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@bobbrow
Copy link
Member

bobbrow commented Feb 16, 2018

There are some cases where graying the code is undesirable for developers. A setting needs to be added to allow developers to disable the inactive region highlighting.

Consider also adding a lightbulb action to allow developers to toggle this without visiting the settings.json file.

See #1466 for a workaround if you need to disable this immediately. We'll target March (possibly in the insiders release too).

@bobbrow
Copy link
Member Author

bobbrow commented Mar 9, 2018

We just posted an insider release with the new setting to disable the inactive region colorization. If you want to get an early preview, you can install the VSIX that matches your OS from the link below.

https://github.com/Microsoft/vscode-cpptools/releases/tag/v0.16.0-insiders

@NiMiZ
Copy link

NiMiZ commented Mar 13, 2018

Can you also add option to define a list of defines that you want to be define?
In my project there are defines in the make file according to the make's arguments, so if it will be possible to give it a list or set of list of define it will be helpful

@sean-mcmanus
Copy link
Contributor

@NiMiZ When you use the "Edit Configurations" command, you should see the "defines" property in "c_cpp_properties.json" where you can add the list of defines. For defines with a value, use a = between the name and value. Let us know if you have a problem getting that to work.

@NiMiZ
Copy link

NiMiZ commented Mar 14, 2018

I'm kinda new in VS Code and I don't know this "Edit Configurations" command bu tI opened the file and I ee the defines property there, but I don't understand how to add a define.
is ti like that:
"defines": {
"description": "A list of preprocessor definitions for the IntelliSense engine to use while parsing files. Optionally, use = to set a value, e.g. VERSION=1.",
"type": "array",
"items": {
"type": "string"
"value": [ "VERSION=1", "DEBUG=2"]
}
},

Can you give an example?

thanks

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Mar 14, 2018

Use the View->Command Palette menu and type "Edit Configurations" after the >.
You can add defines like

"defines": [
                "_DEBUG=1",
                "UNICODE",
                "_UNICODE"
            ],

@unimun
Copy link

unimun commented Mar 19, 2018

I'm using -imacros option to implicitly include c macros to c source files. But cpptools do not appropriatly parse macros when I give header files to "defines" field of c_cpp_properties.json like:
"defines": [ "${workspaceRoot}/out/config.h", "_DEBUG", "UNICODE", "_UNICODE" ],
It enables syntax highlighting all conditional compile preprocessors including not defined symbols.
Is there a way to make inactiveRegions updater to recognize config.h file?

@bobbrow
Copy link
Member Author

bobbrow commented Mar 19, 2018

@unimun, do you want to always pre-include that file? We have a new setting "forcedInclude" that will allow you to do this. You can install the insiders build if you want to try it out now, or wait until we release the final version and let VSCode update you automatically (sometime this week).

@unimun
Copy link

unimun commented Mar 22, 2018

@bobbrow Thanks for adding this feature!! It works perfectly.

@floooh
Copy link

floooh commented Oct 20, 2018

I'm a bit late to the party, but I'm seeing really bad editing and scrolling performance on macOS when a big dimmed inactive ifdef region is visible in the editor. It gets slightly better when deactivating the dimming, but it's still slower than normal (maybe it has to do with generally being inside ifdef block).

Is this a known issue? It's a bit hard to search for this phenomenon.

@bobbrow
Copy link
Member Author

bobbrow commented Oct 22, 2018

@floooh, can you open a new issue for this? #1574 is closed.

@floooh
Copy link

floooh commented Oct 23, 2018

@bobbrow see #2704

@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

5 participants