diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 478055e6c..9a853477b 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,6 +1,9 @@ # C/C++ for Visual Studio Code Change Log -## Version 0.17.7: July 19, 2018 +## Version 0.17.8: August 16, 2018 +* Add `inactiveRegionForegroundColor` and `inactiveRegionBackgroundColor` to settings. [#2212](https://github.com/Microsoft/vscode-cpptools/issues/2212) + +## Version 0.17.7: July 22, 2018 * Fix `Go to Definition` for code scoped with an aliased namespace. [#387](https://github.com/Microsoft/vscode-cpptools/issues/387) * Fix incorrect IntelliSense errors with template template-arguments. [#1014](https://github.com/Microsoft/vscode-cpptools/issues/1014) * Fix crash when using designated initializer lists. [#1440](https://github.com/Microsoft/vscode-cpptools/issues/1440) diff --git a/Extension/package.json b/Extension/package.json index 924330524..9d8e6f7e7 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -154,6 +154,24 @@ "minimum": 0.1, "maximum": 1 }, + "C_Cpp.inactiveRegionForegroundColor": { + "type": [ + "string", + "null" + ], + "default": null, + "description": "Controls the font coloring of inactive preprocessor blocks. Input is in the form a hexadecimal color code or a valid Theme Color. If not set, this defaults to the syntax coloring scheme of the editor. This setting only applies when inactive region dimming is enabled.", + "scope": "resource" + }, + "C_Cpp.inactiveRegionBackgroundColor": { + "type": [ + "string", + "null" + ], + "default": null, + "description": "Controls the background coloring of inactive preprocessor blocks. Input is in the form a hexadecimal color code or a valid Theme Color. If not set, this defaults to transparent. This setting only applies when inactive region dimming is enabled.", + "scope": "resource" + }, "C_Cpp.formatting": { "type": "string", "enum": [ diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index c3af87f00..01779d7ae 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -840,6 +840,8 @@ class DefaultClient implements Client { let decoration: vscode.TextEditorDecorationType = vscode.window.createTextEditorDecorationType({ opacity: settings.inactiveRegionOpacity.toString(), + backgroundColor: settings.inactiveRegionBackgroundColor, + color: settings.inactiveRegionForegroundColor, rangeBehavior: vscode.DecorationRangeBehavior.ClosedOpen }); diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 738f8f402..452eddb7f 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -41,6 +41,8 @@ export class CppSettings extends Settings { public get errorSquiggles(): string { return super.Section.get("errorSquiggles"); } public get dimInactiveRegions(): boolean { return super.Section.get("dimInactiveRegions"); } public get inactiveRegionOpacity(): number { return super.Section.get("inactiveRegionOpacity"); } + public get inactiveRegionForegroundColor(): string { return super.Section.get("inactiveRegionForegroundColor"); } + public get inactiveRegionBackgroundColor(): string { return super.Section.get("inactiveRegionBackgroundColor"); } public get autoComplete(): string { return super.Section.get("autocomplete"); } public get loggingLevel(): string { return super.Section.get("loggingLevel"); } public get navigationLength(): number { return super.Section.get("navigation.length", 60); }